From b7096268928825cd62be8b5476cd9cc95e54284a Mon Sep 17 00:00:00 2001 From: TwoLeggedCat <80929284+TwoLeggedCat@users.noreply.github.com> Date: Sat, 1 Jan 2022 11:08:06 -0600 Subject: [PATCH] [build] Check if chest actually has salmon Woops... --- src/main/java/me/twoleggedcat/bettercats/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/twoleggedcat/bettercats/Main.java b/src/main/java/me/twoleggedcat/bettercats/Main.java index ca3d19c..9e126a8 100644 --- a/src/main/java/me/twoleggedcat/bettercats/Main.java +++ b/src/main/java/me/twoleggedcat/bettercats/Main.java @@ -50,7 +50,7 @@ public void onEntityLoad(EntityAddToWorldEvent e) { @EventHandler public void onInventoryOpen(InventoryOpenEvent e) { Inventory inv = e.getInventory(); - if (inv.getType() == InventoryType.CHEST) { + if (inv.getType() == InventoryType.CHEST && inv.contains(Material.SALMON)) { Collection entities = e.getPlayer().getWorld().getNearbyEntities(e.getPlayer().getLocation(), 10, 10, 10); for (Entity entity : entities) { if (entity instanceof Cat cat && Math.random() < 0.15) {