PlayerInteractEvent in MinecleanerListener now shouldn't prevent players from opening chests (i hope)

This commit is contained in:
LunarAkai 2024-03-30 11:41:59 +01:00
commit 8e3590db00
2 changed files with 2 additions and 2 deletions

View file

@ -31,11 +31,11 @@ public class MinecleanerListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(PlayerInteractEvent e) {
if(e.getHand() != EquipmentSlot.HAND) return;
if((e.getAction() == Action.LEFT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
Block block = e.getClickedBlock();
MinecleanerArena arena = plugin.getArenaList().getPlayerArena(e.getPlayer());
if(arena != null) {
if(e.getHand() != EquipmentSlot.HAND) return;
e.setCancelled(true);
MinecleanerArena arenaClicked = plugin.getArenaList().getArenaAtBlock(block);
if(arenaClicked == arena && arena.getArenaStatus() == ArenaStatus.PLAYING) {