From 5d90a00ea20e7e403fe61084899c04079a58f6c6 Mon Sep 17 00:00:00 2001 From: MrMacor <57609259+MrMacor@users.noreply.github.com> Date: Sun, 7 Feb 2021 08:53:45 -0800 Subject: [PATCH] Fix when boosted items cache is not removed after swap items (#1076) --- .../java/com/gamingmesh/jobs/listeners/JobsListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 9381d1d2..69d0bb99 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -58,6 +58,7 @@ import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerSwapHandItemsEvent; import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; @@ -715,4 +716,9 @@ public class JobsListener implements Listener { public void PlayerItemBreakEvent(InventoryClickEvent event) { Jobs.getPlayerManager().resetiItemBonusCache(((Player) event.getWhoClicked()).getUniqueId()); } + + @EventHandler + public void onPlayerHandSwap(PlayerSwapHandItemsEvent event) { + Jobs.getPlayerManager().resetiItemBonusCache(event.getPlayer().getUniqueId()); + } }