From b7f6de79654e6d8160c1ef74d9c148f48172f033 Mon Sep 17 00:00:00 2001 From: Zrips Date: Wed, 3 May 2023 14:28:49 +0300 Subject: [PATCH] Fix for JobsChunkChangeEvent --- .../java/com/gamingmesh/jobs/listeners/JobsListener.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 53a1fd52..1cc822f9 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -87,6 +87,7 @@ import net.Zrips.CMILib.Items.ArmorTypes; import net.Zrips.CMILib.Items.CMIItemStack; import net.Zrips.CMILib.Items.CMIMaterial; import net.Zrips.CMILib.Locale.LC; +import net.Zrips.CMILib.Logs.CMIDebug; import net.Zrips.CMILib.Messages.CMIMessages; import net.Zrips.CMILib.NBT.CMINBT; import net.Zrips.CMILib.Version.Version; @@ -137,7 +138,7 @@ public class JobsListener implements Listener { return; Player player = event.getPlayer(); - + if (CMIItemStack.getItemInMainHand(player).getType() != CMIMaterial.get(Jobs.getGCManager().getSelectionTool()).getMaterial()) return; @@ -531,9 +532,9 @@ public class JobsListener implements Listener { Chunk from = event.getFrom().getChunk(); Chunk to = event.getTo().getChunk(); -// if (from != to) { -// plugin.getServer().getPluginManager().callEvent(new JobsChunkChangeEvent(event.getPlayer(), from, to)); -// } + if (!from.equals(to)) { + plugin.getServer().getPluginManager().callEvent(new JobsChunkChangeEvent(event.getPlayer(), from, to)); + } } @EventHandler(ignoreCancelled = true)