From 516b5b22266bc4fab853991c5b784d3eb841d105 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 8 Feb 2011 12:06:34 +0000 Subject: [PATCH] New event WORLD_LOADED By: Dinnerbone --- paper-api/src/main/java/org/bukkit/event/Event.java | 5 +++++ .../main/java/org/bukkit/event/world/WorldListener.java | 8 ++++++++ .../java/org/bukkit/plugin/java/JavaPluginLoader.java | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/Event.java b/paper-api/src/main/java/org/bukkit/event/Event.java index e608ed5c05..a9448252ed 100644 --- a/paper-api/src/main/java/org/bukkit/event/Event.java +++ b/paper-api/src/main/java/org/bukkit/event/Event.java @@ -439,6 +439,11 @@ public abstract class Event { */ ITEM_SPAWN (Category.WORLD), + /** + * Called when a World is loaded + */ + WORLD_LOADED (Category.WORLD), + /** * LIVING_ENTITY EVENTS */ diff --git a/paper-api/src/main/java/org/bukkit/event/world/WorldListener.java b/paper-api/src/main/java/org/bukkit/event/world/WorldListener.java index 09133beab5..848274b0b5 100644 --- a/paper-api/src/main/java/org/bukkit/event/world/WorldListener.java +++ b/paper-api/src/main/java/org/bukkit/event/world/WorldListener.java @@ -22,4 +22,12 @@ public class WorldListener implements Listener { */ public void onChunkUnloaded(ChunkUnloadEvent event) { } + + /** + * Called when a World is loaded + * + * @param event Relevant event details + */ + public void onWorldLoaded(WorldEvent event) { + } } diff --git a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index d9979c7025..1d38952397 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -23,6 +23,7 @@ import org.bukkit.event.server.*; import org.bukkit.event.vehicle.*; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; +import org.bukkit.event.world.WorldEvent; import org.bukkit.event.world.WorldListener; import org.bukkit.inventory.PlayerInventory; import org.bukkit.plugin.*; @@ -285,6 +286,11 @@ public final class JavaPluginLoader implements PluginLoader { ((WorldListener)listener).onChunkUnloaded( (ChunkUnloadEvent)event ); } }; + case WORLD_LOADED: + return new EventExecutor() { public void execute( Listener listener, Event event ) { + ((WorldListener)listener).onWorldLoaded( (WorldEvent)event ); + } + }; // Entity Events case ENTITY_DAMAGEDBY_BLOCK: