diff options
author | Matt <mattbdev@outlook.com> | 2015-04-29 12:14:29 -0400 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-07-12 19:45:00 +1000 |
commit | c31fcfe3a19c4ee597df75e750af1542ac020b92 (patch) | |
tree | 0943e04834bde466897c7cba8a5ba5eb54db9208 | |
parent | 5ce44d45312122ecf210dbf614e125f72289f43f (diff) | |
download | bukkit-c31fcfe3a19c4ee597df75e750af1542ac020b92.tar bukkit-c31fcfe3a19c4ee597df75e750af1542ac020b92.tar.gz bukkit-c31fcfe3a19c4ee597df75e750af1542ac020b92.tar.lz bukkit-c31fcfe3a19c4ee597df75e750af1542ac020b92.tar.xz bukkit-c31fcfe3a19c4ee597df75e750af1542ac020b92.zip |
Server Commands and Remote Commands are now Cancellable.
-rw-r--r-- | src/main/java/org/bukkit/event/server/ServerCommandEvent.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index 8a5972ae..10ea0f00 100644 --- a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java @@ -1,6 +1,7 @@ package org.bukkit.event.server; import org.bukkit.command.CommandSender; +import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; /** @@ -37,10 +38,11 @@ import org.bukkit.event.HandlerList; * beginning of the message should be preserved. If a slash is added or * removed, unexpected behavior may result. */ -public class ServerCommandEvent extends ServerEvent { +public class ServerCommandEvent extends ServerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private String command; private final CommandSender sender; + private boolean cancel = false; public ServerCommandEvent(final CommandSender sender, final String command) { this.command = command; @@ -83,4 +85,14 @@ public class ServerCommandEvent extends ServerEvent { public static HandlerList getHandlerList() { return handlers; } + + @Override + public boolean isCancelled() { + return cancel; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancel = cancel; + } } |