1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-07 00:38:42 +01:00

Another fix when some inventory types are not exists

Fixes #825
This commit is contained in:
montlikadani 2020-06-17 12:37:17 +02:00
parent 9ae9de678b
commit 4d0e4be8dd

View File

@ -793,8 +793,8 @@ public class JobsPaymentListener implements Listener {
else if (b == null) else if (b == null)
return false; return false;
CMIMaterial mat1 = CMIMaterial.get(a); CMIMaterial mat1 = CMIMaterial.get(a),
CMIMaterial mat2 = CMIMaterial.get(b); mat2 = CMIMaterial.get(b);
return mat1 == mat2 && Jobs.getNms().getDurability(a) == Jobs.getNms().getDurability(b) && Objects.equal(a.getData(), b.getData()) && return mat1 == mat2 && Jobs.getNms().getDurability(a) == Jobs.getNms().getDurability(b) && Objects.equal(a.getData(), b.getData()) &&
Objects.equal(a.getEnchantments(), b.getEnchantments()); Objects.equal(a.getEnchantments(), b.getEnchantments());
} }
@ -838,7 +838,7 @@ public class JobsPaymentListener implements Listener {
if (!event.getSlotType().equals(SlotType.RESULT) || (slot != 2 && slot != 1)) if (!event.getSlotType().equals(SlotType.RESULT) || (slot != 2 && slot != 1))
return; return;
if (!(inv instanceof StonecutterInventory) && slot == 1) if ((Version.isCurrentEqualOrHigher(Version.v1_14_R1) && !(inv instanceof StonecutterInventory)) && slot == 1)
return; return;
if (!(event.getWhoClicked() instanceof Player)) if (!(event.getWhoClicked() instanceof Player))
@ -909,7 +909,7 @@ public class JobsPaymentListener implements Listener {
if (jPlayer == null) if (jPlayer == null)
return; return;
if (inv instanceof StonecutterInventory) { if (Version.isCurrentEqualOrHigher(Version.v1_14_R1) && inv instanceof StonecutterInventory) {
Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT)); Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT));
return; return;
} }