1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-03-11 22:31:04 +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))
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;
if (!(event.getWhoClicked() instanceof Player))