1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-03-12 06:40:09 +01:00

Better check for slots when we have another inventory with only 1 slot

This commit is contained in:
montlikadani 2020-05-19 17:30:24 +02:00
parent c22875bb59
commit db6b2bc929

View File

@ -773,7 +773,11 @@ public class JobsPaymentListener implements Listener {
if (!(inv instanceof AnvilInventory) && !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory)) if (!(inv instanceof AnvilInventory) && !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory))
return; return;
if (!event.getSlotType().equals(SlotType.RESULT) || (event.getSlot() != 2 && event.getSlot() != 1)) int slot = event.getSlot();
if (!event.getSlotType().equals(SlotType.RESULT) || (slot != 2 && slot != 1))
return;
if (!(inv instanceof StonecutterInventory) && slot == 1)
return; return;
if (!(event.getWhoClicked() instanceof Player)) if (!(event.getWhoClicked() instanceof Player))