From 4f894ddac73084dfccc3bc6eee4c75b49afd176c Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 26 Nov 2016 17:06:21 +0100 Subject: [PATCH] Fix ClassCastException when using Shulker Boxes Closes #34 --- .../de/epiceric/shopchest/listeners/WorldGuardListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/listeners/WorldGuardListener.java b/src/main/java/de/epiceric/shopchest/listeners/WorldGuardListener.java index 6003ed2..2fc8fdd 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/WorldGuardListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/WorldGuardListener.java @@ -20,7 +20,6 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.inventory.InventoryOpenEvent; -import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerInteractEvent; public class WorldGuardListener implements Listener { @@ -103,7 +102,7 @@ public class WorldGuardListener implements Listener { } else if (event.getOriginalEvent() instanceof InventoryOpenEvent) { InventoryOpenEvent orig = (InventoryOpenEvent) event.getOriginalEvent(); - if (orig.getInventory().getType() == InventoryType.CHEST) { + if (orig.getInventory().getHolder() instanceof Chest) { if (isAllowed(event, ((Chest)orig.getInventory().getHolder()).getLocation(), Action.RIGHT_CLICK_BLOCK)) { event.setAllowed(true); orig.setCancelled(false);