Implemented WorldUnloadEvent and unloadWorld().
By: Rigby <rigby@onarandombox.com>
This commit is contained in:
@@ -479,6 +479,10 @@ public abstract class Event implements Serializable {
|
||||
* Called when a World is loaded
|
||||
*/
|
||||
WORLD_LOAD (Category.WORLD),
|
||||
/**
|
||||
* Called when a World is unloaded
|
||||
*/
|
||||
WORLD_UNLOAD (Category.WORLD),
|
||||
|
||||
/**
|
||||
* ENTITY EVENTS
|
||||
|
||||
@@ -57,6 +57,13 @@ public class WorldListener implements Listener {
|
||||
throw new AuthorNagException("onWorldLoad has been replaced with a new signature, (WorldLoadEvent)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a World is unloaded
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onWorldUnload(WorldUnloadEvent event) { }
|
||||
|
||||
// TODO: Remove after RB
|
||||
@Deprecated public void onWorldLoad(WorldEvent event) {}
|
||||
@Deprecated public void onWorldSave(WorldEvent event) {}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class WorldUnloadEvent extends WorldEvent implements Cancellable {
|
||||
|
||||
private boolean isCancelled;
|
||||
|
||||
public WorldUnloadEvent(World world) {
|
||||
super(Type.WORLD_UNLOAD, world);
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.isCancelled = cancel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user