Whitelist inventory events
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
e6eb4a416b
commit
598dcd7e09
@ -4,10 +4,12 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.inventory.*;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import wtf.beatrice.limbomanager.LimboManager;
|
||||
@ -65,4 +67,20 @@ public class PlayerChecker implements Listener
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryEvent(InventoryEvent event)
|
||||
{
|
||||
if(event instanceof Cancellable)
|
||||
{
|
||||
if(!(event instanceof InventoryCloseEvent) &&
|
||||
!(event instanceof InventoryClickEvent) &&
|
||||
!(event instanceof InventoryDragEvent) &&
|
||||
!(event instanceof InventoryOpenEvent))
|
||||
{
|
||||
((Cancellable) event).setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user