From 4d0e4be8dd2389c1153ba1e7f6ca23a9027b7c4b Mon Sep 17 00:00:00 2001 From: montlikadani Date: Wed, 17 Jun 2020 12:37:17 +0200 Subject: [PATCH] Another fix when some inventory types are not exists Fixes #825 --- .../gamingmesh/jobs/listeners/JobsPaymentListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 52ee84c3..362b08a0 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -793,8 +793,8 @@ public class JobsPaymentListener implements Listener { else if (b == null) return false; - CMIMaterial mat1 = CMIMaterial.get(a); - CMIMaterial mat2 = CMIMaterial.get(b); + CMIMaterial mat1 = CMIMaterial.get(a), + mat2 = CMIMaterial.get(b); return mat1 == mat2 && Jobs.getNms().getDurability(a) == Jobs.getNms().getDurability(b) && Objects.equal(a.getData(), b.getData()) && 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)) return; - if (!(inv instanceof StonecutterInventory) && slot == 1) + if ((Version.isCurrentEqualOrHigher(Version.v1_14_R1) && !(inv instanceof StonecutterInventory)) && slot == 1) return; if (!(event.getWhoClicked() instanceof Player)) @@ -909,7 +909,7 @@ public class JobsPaymentListener implements Listener { if (jPlayer == null) return; - if (inv instanceof StonecutterInventory) { + if (Version.isCurrentEqualOrHigher(Version.v1_14_R1) && inv instanceof StonecutterInventory) { Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT)); return; }