Skip to content

Commit

Permalink
[build] Check if chest actually has salmon
Browse files Browse the repository at this point in the history
Woops...
  • Loading branch information
TwoLeggedCat committed Jan 1, 2022
1 parent e853423 commit b709626
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/me/twoleggedcat/bettercats/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Entity> entities = e.getPlayer().getWorld().getNearbyEntities(e.getPlayer().getLocation(), 10, 10, 10);
for (Entity entity : entities) {
if (entity instanceof Cat cat && Math.random() < 0.15) {
Expand Down

0 comments on commit b709626

Please sign in to comment.