From 411a0abc66d563c3e2063143c0d176229b4c342b Mon Sep 17 00:00:00 2001 From: mastercake10 Date: Wed, 19 Apr 2023 20:30:18 +0200 Subject: [PATCH] make config option `IgnoreHeldItems` work by removing Enum#ordinal --- .../dev/villagertradelimiter/listeners/PlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/pretzel/dev/villagertradelimiter/listeners/PlayerListener.java b/src/com/pretzel/dev/villagertradelimiter/listeners/PlayerListener.java index b1fc5fd..665c76a 100644 --- a/src/com/pretzel/dev/villagertradelimiter/listeners/PlayerListener.java +++ b/src/com/pretzel/dev/villagertradelimiter/listeners/PlayerListener.java @@ -48,7 +48,7 @@ public class PlayerListener implements Listener { if(instance.getCfg().getStringList("DisableWorlds").contains(villager.getWorld().getName())) return; //Skips when player is holding an ignored item - ItemStack heldItem = player.getInventory().getItem(event.getHand().ordinal()); + ItemStack heldItem = player.getInventory().getItem(event.getHand()); if(heldItem != null) { Material heldItemType = heldItem.getType(); for(String ignoredType : instance.getCfg().getStringList("IgnoreHeldItems")) {