From 8c6f3725eeada65cce71d0c5f7e4bc4b9c1279cd Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 26 Sep 2011 15:32:05 -0700 Subject: [PATCH] Added server list ping event. By: sk89q --- .../bukkit/craftbukkit/event/CraftEventFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index f86dded7e5..8e3b6b1196 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.event; +import java.net.InetAddress; import java.util.List; import net.minecraft.server.ChunkCoordinates; import net.minecraft.server.EntityCaveSpider; @@ -29,6 +30,7 @@ import net.minecraft.server.ItemStack; import net.minecraft.server.World; import net.minecraft.server.WorldServer; import org.bukkit.Bukkit; +import org.bukkit.Server; import org.bukkit.Material; import org.bukkit.block.Block; @@ -48,6 +50,7 @@ import org.bukkit.event.block.*; import org.bukkit.event.entity.*; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.player.*; +import org.bukkit.event.server.ServerListPingEvent; public class CraftEventFactory { private static boolean canBuild(CraftWorld world, Player player, int x, int z) { @@ -308,4 +311,13 @@ public class CraftEventFactory { return event; } + + /** + * Server methods + */ + public static ServerListPingEvent callServerListPingEvent(Server craftServer, InetAddress address, String motd, int numPlayers, int maxPlayers) { + ServerListPingEvent event = new ServerListPingEvent(address, motd, numPlayers, maxPlayers); + craftServer.getPluginManager().callEvent(event); + return event; + } }