Generic cleanup

This commit is contained in:
Erik Broes
2011-06-12 01:18:17 +02:00
parent 9ca26882d1
commit c54ec090c8
9 changed files with 142 additions and 134 deletions

View File

@@ -1,43 +1,45 @@
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;
}
}
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;
}
}