Added various 1.6 portal events.
This commit is contained in:
43
src/main/java/org/bukkit/event/world/PortalCreateEvent.java
Normal file
43
src/main/java/org/bukkit/event/world/PortalCreateEvent.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user