Added various 1.6 portal events.

This commit is contained in:
Stephen
2011-06-07 14:12:08 -04:00
committed by EvilSeph
parent e72fe8bfe3
commit 92f8f6aba8
9 changed files with 150 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package org.bukkit.event.world;
import org.bukkit.block.Block;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import java.util.ArrayList;
/**
* Called when the world attempts to create a matching end to a portal
*/
public class PortalCreateEvent extends WorldEvent implements Cancellable {
private boolean cancel = false;
private ArrayList<Block> blocks = new ArrayList<Block>();
public PortalCreateEvent(final ArrayList<Block> blocks, final World world) {
super(Type.PORTAL_CREATE, world);
this.blocks = blocks;
}
public ArrayList<Block> getBlocks(){
return this.blocks;
}
/**
* Gets the cancellation state of this event. A canceled event will not
* be executed in the server, but will still pass to other plugins
*
* @return true if this event is canceled
*/
public boolean isCancelled() {
return cancel;
}
/**
* Sets the cancellation state of this event. A canceled event will not
* be executed in the server, but will still pass to other plugins
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}

View File

@@ -29,6 +29,13 @@ public class WorldListener implements Listener {
*/
public void onSpawnChange(SpawnChangeEvent event) {}
/**
* Called when the world generates a portal end point
*
* @param event Relevant event details
*/
public void onPortalCreate(PortalCreateEvent event) {}
/**
* Called when a world is saved
*