mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
New event WORLD_LOADED
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
002613da66
commit
516b5b2226
@ -439,6 +439,11 @@ public abstract class Event {
|
|||||||
*/
|
*/
|
||||||
ITEM_SPAWN (Category.WORLD),
|
ITEM_SPAWN (Category.WORLD),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a World is loaded
|
||||||
|
*/
|
||||||
|
WORLD_LOADED (Category.WORLD),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LIVING_ENTITY EVENTS
|
* LIVING_ENTITY EVENTS
|
||||||
*/
|
*/
|
||||||
|
@ -22,4 +22,12 @@ public class WorldListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
public void onChunkUnloaded(ChunkUnloadEvent event) {
|
public void onChunkUnloaded(ChunkUnloadEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a World is loaded
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
|
public void onWorldLoaded(WorldEvent event) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import org.bukkit.event.server.*;
|
|||||||
import org.bukkit.event.vehicle.*;
|
import org.bukkit.event.vehicle.*;
|
||||||
import org.bukkit.event.world.ChunkLoadEvent;
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||||
|
import org.bukkit.event.world.WorldEvent;
|
||||||
import org.bukkit.event.world.WorldListener;
|
import org.bukkit.event.world.WorldListener;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.plugin.*;
|
import org.bukkit.plugin.*;
|
||||||
@ -285,6 +286,11 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||||||
((WorldListener)listener).onChunkUnloaded( (ChunkUnloadEvent)event );
|
((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
|
// Entity Events
|
||||||
case ENTITY_DAMAGEDBY_BLOCK:
|
case ENTITY_DAMAGEDBY_BLOCK:
|
||||||
|
Loading…
Reference in New Issue
Block a user