mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 17:52:28 +01:00
Added server list ping event.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
9d39647939
commit
8c6f3725ee
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue