Fix invalid crate usage.

This commit is contained in:
Brianna 2020-06-11 09:20:35 -05:00
parent af788389cd
commit c0bfa2431a
1 changed files with 3 additions and 1 deletions

View File

@ -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();