Some more backwards incompatible changes (minor though), also a ton of small cleanup.

onPluginEnable(PluginEvent event)   -> onPluginEnable(PluginEnableEvent event)
onPluginDisable(PluginEvent event)  -> onPluginDisable(PluginDisableEvent event)
onVehicleUpdate(VehicleEvent event) -> onVehicleUpdate(VehicleUpdateEvent event)
onWorldSave(WorldEvent event)       -> onWorldSave(WorldSaveEvent event)
onWorldLoad(WorldEvent event)       -> onWorldLoad(WorldLoadEvent event)
This commit is contained in:
Erik Broes
2011-03-26 22:21:20 +01:00
parent 7788522d65
commit 158906c132
60 changed files with 312 additions and 376 deletions

View File

@@ -0,0 +1,21 @@
package org.bukkit.event.world;
import org.bukkit.Chunk;
public class ChunkEvent extends WorldEvent {
protected Chunk chunk;
protected ChunkEvent(Type type, Chunk chunk) {
super(type, chunk.getWorld());
this.chunk = chunk;
}
/**
* Gets the chunk being loaded/unloaded
*
* @return Chunk that triggered this event
*/
public Chunk getChunk() {
return chunk;
}
}

View File

@@ -6,21 +6,8 @@ import org.bukkit.Chunk;
/**
* Called when a chunk is loaded
*/
public class ChunkLoadEvent extends WorldEvent {
private final Chunk chunk;
public ChunkLoadEvent(final Type type, final Chunk chunk) {
super(type, chunk.getWorld());
this.chunk = chunk;
}
/**
* Gets the chunk being loaded/unloaded
*
* @return Chunk that triggered this event
*/
public Chunk getChunk() {
return chunk;
public class ChunkLoadEvent extends ChunkEvent {
public ChunkLoadEvent(final Chunk chunk) {
super(Type.CHUNK_LOAD, chunk);
}
}

View File

@@ -7,11 +7,11 @@ import org.bukkit.event.Cancellable;
/**
* Called when a chunk is unloaded
*/
public class ChunkUnloadEvent extends ChunkLoadEvent implements Cancellable {
public class ChunkUnloadEvent extends ChunkEvent implements Cancellable {
private boolean cancel = false;
public ChunkUnloadEvent(final Type type, final Chunk chunk) {
super(type, chunk);
public ChunkUnloadEvent(final Chunk chunk) {
super(Type.CHUNK_UNLOAD, chunk);
}
/**

View File

@@ -26,9 +26,9 @@ public class WorldListener implements Listener {
/**
* Called when a world is saved
*
* param event Relevant event details
* @param event Relevant event details
*/
public void onWorldSave(WorldEvent event) {
public void onWorldSave(WorldSaveEvent event) {
}
/**
@@ -36,6 +36,6 @@ public class WorldListener implements Listener {
*
* @param event Relevant event details
*/
public void onWorldLoad(WorldEvent event) {
public void onWorldLoad(WorldLoadEvent event) {
}
}

View File

@@ -0,0 +1,9 @@
package org.bukkit.event.world;
import org.bukkit.World;
public class WorldLoadEvent extends WorldEvent {
public WorldLoadEvent(World world) {
super(Type.WORLD_LOAD, world);
}
}

View File

@@ -0,0 +1,9 @@
package org.bukkit.event.world;
import org.bukkit.World;
public class WorldSaveEvent extends WorldEvent {
public WorldSaveEvent(World world) {
super(Type.WORLD_SAVE, world);
}
}