New event WORLD_LOADED

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-02-08 12:06:34 +00:00
parent 002613da66
commit 516b5b2226
3 changed files with 19 additions and 0 deletions

View File

@ -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
*/

View File

@ -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) {
}
}

View File

@ -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: