Merge pull request #6 from mastercake10/master

make config option `IgnoreHeldItems` work by removing Enum#ordinal
This commit is contained in:
PretzelJohn 2023-04-19 14:39:13 -04:00 committed by GitHub
commit 5f279ea12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")) {