From 105182117534ce0258aa29330b920d8b2719605c Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 24 Nov 2024 19:25:32 +1300 Subject: [PATCH] Change SavedDisguises to run before a normal event priority, so EventPriority.LOW. Hopefully fixes skbee --- .../disguise/utilities/listeners/DisguiseListener.java | 4 ++-- .../disguise/utilities/listeners/DisguiseListener1_18.java | 3 ++- .../disguise/utilities/listeners/PaperDisguiseListener.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java index 8a95a978..6b89c21e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java @@ -344,7 +344,7 @@ public class DisguiseListener implements Listener { } } - @EventHandler + @EventHandler(priority = EventPriority.LOW) public void onChunkLoad(ChunkLoadEvent event) { if (!DisguiseConfig.isSaveEntityDisguises() || NmsVersion.v1_18.isSupported()) { return; @@ -366,7 +366,7 @@ public class DisguiseListener implements Listener { } } - @EventHandler + @EventHandler(priority = EventPriority.LOW) public void onWorldLoad(WorldLoadEvent event) { if (!DisguiseConfig.isSaveEntityDisguises()) { return; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener1_18.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener1_18.java index b7a0cf38..a6861666 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener1_18.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener1_18.java @@ -5,12 +5,13 @@ import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import org.bukkit.entity.Entity; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.EntitiesLoadEvent; import org.bukkit.event.world.EntitiesUnloadEvent; public class DisguiseListener1_18 implements Listener { - @EventHandler + @EventHandler(priority = EventPriority.LOW) public void onEntitiesLoad(EntitiesLoadEvent event) { if (!DisguiseConfig.isSaveEntityDisguises()) { return; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PaperDisguiseListener.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PaperDisguiseListener.java index 206be46a..eee1f958 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PaperDisguiseListener.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PaperDisguiseListener.java @@ -11,6 +11,7 @@ import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.scheduler.BukkitRunnable; @@ -21,7 +22,7 @@ public class PaperDisguiseListener implements Listener { private Boolean isWeird; private int count; - @EventHandler + @EventHandler(priority = EventPriority.LOW) public void onEntityLoad(EntityAddToWorldEvent event) { if (!DisguiseConfig.isSaveEntityDisguises()) { return;