From 8e133f08328eac647a96cb76297fc73390f80ffd Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 13 Mar 2023 20:58:53 +0100 Subject: [PATCH] Probable fix for SelfJoin Event Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/script/ScriptListener.java | 2 +- .../bausystem/features/script/custom/event/EventListener.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java index fbdbf0f2..ef9abe06 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java @@ -47,7 +47,7 @@ public class ScriptListener implements Listener { new ScriptExecutor((BookMeta) item.getItemMeta(), event.getPlayer(), null); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onPlayerJoin(PlayerJoinEvent event) { GLOBAL_CONTEXT.put(event.getPlayer(), new Context()); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/custom/event/EventListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/custom/event/EventListener.java index f8913e28..4ee1a97d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/custom/event/EventListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/custom/event/EventListener.java @@ -30,6 +30,7 @@ import org.bukkit.Bukkit; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; @@ -58,7 +59,7 @@ public class EventListener implements Listener { }, 2, 2); } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { manager.callEvent(EventType.SelfJoin, event.getPlayer(), event); }