Disable all entities generation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e68326cb87
commit
7abfb4d536
@ -2,9 +2,11 @@ package wtf.beatrice.limbomanager.listeners;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import wtf.beatrice.limbomanager.LimboManager;
|
||||
@ -36,6 +38,9 @@ public class PlayerChecker implements Listener
|
||||
|
||||
// set gamemode
|
||||
joiner.setGameMode(GameMode.CREATIVE);
|
||||
|
||||
// clear inventory
|
||||
joiner.getInventory().clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -43,7 +48,14 @@ public class PlayerChecker implements Listener
|
||||
{
|
||||
event.setQuitMessage(null);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntityCreate(EntitySpawnEvent event)
|
||||
{
|
||||
// disable ALL entities
|
||||
if(event.getEntity().getType() != EntityType.PLAYER)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// todo: entity drop cancel
|
Loading…
Reference in New Issue
Block a user