diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2010-12-30 22:07:37 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2010-12-30 22:07:37 +0000 |
commit | 728122befc0298c39707f238b61f8d2493b82e96 (patch) | |
tree | daf0bea6d8122cc6368d667a2b7d0d1d90edfd02 | |
parent | 6f6c4d7ce06a7e2cf0e28a608704daccef5d88c4 (diff) | |
download | bukkit-728122befc0298c39707f238b61f8d2493b82e96.tar bukkit-728122befc0298c39707f238b61f8d2493b82e96.tar.gz bukkit-728122befc0298c39707f238b61f8d2493b82e96.tar.lz bukkit-728122befc0298c39707f238b61f8d2493b82e96.tar.xz bukkit-728122befc0298c39707f238b61f8d2493b82e96.zip |
BlockPhysics can be canceled
-rw-r--r-- | src/org/bukkit/event/block/BlockPhysicsEvent.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/org/bukkit/event/block/BlockPhysicsEvent.java b/src/org/bukkit/event/block/BlockPhysicsEvent.java index 845491f2..77cdece0 100644 --- a/src/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/org/bukkit/event/block/BlockPhysicsEvent.java @@ -11,6 +11,7 @@ import org.bukkit.event.Event; public class BlockPhysicsEvent extends BlockEvent { private final Block block; private final int changed; + private boolean cancel = false; public BlockPhysicsEvent(final Event.Type type, final Block block, final int changed) { super(type); @@ -44,4 +45,24 @@ public class BlockPhysicsEvent extends BlockEvent { public ItemStack.Type getChangedType() { return ItemStack.Type.getType(changed); // TODO: Move type to its own file } + + /** + * Gets the cancellation state of this event. A cancelled event will not + * be executed in the server, but will still pass to other plugins + * + * @return true if this event is cancelled + */ + public boolean isCancelled() { + return cancel; + } + + /** + * Sets the cancellation state of this event. A cancelled 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; + } } |