summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-09-26 15:32:05 -0700
committersk89q <the.sk89q@gmail.com>2011-09-26 15:32:05 -0700
commitafd95b7e309309cdfb59ed62c4303a18544e3c83 (patch)
tree18cab1a417f38b17112edcab0cf78be181bd2aba /src/main/java/org
parent87494d46f86738084c52f20acb399f787a436ba5 (diff)
downloadcraftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar
craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.gz
craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.lz
craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.xz
craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.zip
Added server list ping event.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f86dded7..8e3b6b11 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/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;
+ }
}