diff options
| author | Krakenied <Krakenied1@gmail.com> | 2023-03-21 16:23:51 +0100 |
|---|---|---|
| committer | Leonardo Bishop <13875753+LMBishop@users.noreply.github.com> | 2023-04-02 12:20:10 +0100 |
| commit | 97e4ae66a26bf86028c07148a1dff4ef3b7c50fb (patch) | |
| tree | dbc3e6dd3b0f23d20b6ef179a583536820dcb481 | |
| parent | 9b186a312b8e1713a5b00690c203222aa369fc8c (diff) | |
Fix and improve listener plugin comparing condition
| -rw-r--r-- | bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/playerblocktracker/PlayerBlockTrackerHook.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/playerblocktracker/PlayerBlockTrackerHook.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/playerblocktracker/PlayerBlockTrackerHook.java index 0ab896b7..72705312 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/playerblocktracker/PlayerBlockTrackerHook.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/playerblocktracker/PlayerBlockTrackerHook.java @@ -3,6 +3,7 @@ package com.leonardobishop.quests.bukkit.hook.playerblocktracker; import com.gestankbratwurst.playerblocktracker.PlayerBlockTracker; import org.bukkit.Bukkit; import org.bukkit.block.Block; +import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.plugin.RegisteredListener; @@ -20,7 +21,7 @@ public class PlayerBlockTrackerHook implements AbstractPlayerBlockTrackerHook { HandlerList handlerList = BlockBreakEvent.getHandlerList(); RegisteredListener[] listeners = handlerList.getRegisteredListeners(); for (RegisteredListener listener : listeners) { - if (listener.getPlugin() != playerBlockTracker) { + if (listener.getPlugin() == playerBlockTracker && listener.getPriority() == EventPriority.MONITOR) { handlerList.unregister(listener); handlerList.register(listener); } |
