From c0bfa2431a374eee216d9c6d68618aee548ad6d1 Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 11 Jun 2020 09:20:35 -0500 Subject: [PATCH] Fix invalid crate usage. --- .../com/songoda/ultimatekits/listeners/InteractListeners.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/ultimatekits/listeners/InteractListeners.java b/src/main/java/com/songoda/ultimatekits/listeners/InteractListeners.java index edf864c..0b1f1eb 100644 --- a/src/main/java/com/songoda/ultimatekits/listeners/InteractListeners.java +++ b/src/main/java/com/songoda/ultimatekits/listeners/InteractListeners.java @@ -98,11 +98,13 @@ public class InteractListeners implements Listener { @EventHandler public void onCrateClick(PlayerInteractEvent event) { // Would be better to use NBT to make the item persist over aesthetic changes. + // Yes you really should have used NBT. In fact we have an API for this in SongodaCore... // Filter physical actions (pressure plates, buttons) if (event.getAction() == Action.PHYSICAL || event.getItem() == null - || event.getItem().getType() == CompatibleMaterial.AIR.getMaterial()) + || event.getItem().getType() == CompatibleMaterial.AIR.getMaterial() + || CompatibleMaterial.getMaterial(event.getItem()) != CompatibleMaterial.CHEST) return; ItemStack item = event.getItem();