From 3487f98021a68f85fbe9d2fa6d62e6cb5b4eea60 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 7 Oct 2024 21:01:34 +0200 Subject: [PATCH] Update WorldLoadEvent to WorldInitEvent in WorldListener Changing the event from WorldLoadEvent to WorldInitEvent ensures areas are loaded earlier in the world lifecycle. This prevents issues arising from accessing not fully initialized worlds in the ProtectPlugin. --- .../java/net/thenextlvl/protect/listener/WorldListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/net/thenextlvl/protect/listener/WorldListener.java b/plugin/src/main/java/net/thenextlvl/protect/listener/WorldListener.java index 4709c51..e469336 100644 --- a/plugin/src/main/java/net/thenextlvl/protect/listener/WorldListener.java +++ b/plugin/src/main/java/net/thenextlvl/protect/listener/WorldListener.java @@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerBucketFillEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.world.StructureGrowEvent; -import org.bukkit.event.world.WorldLoadEvent; +import org.bukkit.event.world.WorldInitEvent; import org.bukkit.event.world.WorldUnloadEvent; @RequiredArgsConstructor @@ -23,7 +23,7 @@ public class WorldListener implements Listener { private final ProtectPlugin plugin; @EventHandler(priority = EventPriority.MONITOR) - public void onWorldLoad(WorldLoadEvent event) { + public void onWorldInit(WorldInitEvent event) { plugin.areaProvider().loadAreas(event.getWorld()); }