From 41d2e04b50fb1b48043e36a819e47a86eb50f4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20Duman?= Date: Mon, 16 Sep 2019 17:53:23 +0300 Subject: [PATCH] Fixes #541 and some duplication bugs (#542) --- .../jobs/listeners/JobsPaymentListener.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 663efc42..b2132c85 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -802,9 +802,20 @@ public class JobsPaymentListener implements Listener { if (Jobs.getGCManager().disablePaymentIfRiding && player.isInsideVehicle()) return; + // Fix for possible money duplication bugs. + switch (event.getClick()) { + case UNKNOWN: + case WINDOW_BORDER_LEFT: + case WINDOW_BORDER_RIGHT: + case NUMBER_KEY: + return; + default: + break; + } + // Fix money dupping issue when clicking continuously in the result item, but if in the // cursor have item, then dupping the money, #438 - if (event.isLeftClick() && !player.getInventory().contains(inv.getItem(2))) + if (event.isLeftClick() && !event.getCursor().getType().equals(Material.AIR)) return; JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);