diff options
author | h31ix <zero_gravity@outlook.com> | 2013-07-19 18:02:40 -0400 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-08-02 15:49:08 -0500 |
commit | 5c04714882c72dbb2ff9ece081cb772148cb0b18 (patch) | |
tree | 87fe47aa6ab051bcec29746d2eb825d41baf3ae1 /src/main/java/org | |
parent | 2f044fe1f8085087f232a2feff5e668d4fe9b87d (diff) | |
download | bukkit-5c04714882c72dbb2ff9ece081cb772148cb0b18.tar bukkit-5c04714882c72dbb2ff9ece081cb772148cb0b18.tar.gz bukkit-5c04714882c72dbb2ff9ece081cb772148cb0b18.tar.lz bukkit-5c04714882c72dbb2ff9ece081cb772148cb0b18.tar.xz bukkit-5c04714882c72dbb2ff9ece081cb772148cb0b18.zip |
Add 1.6 effect clear functionality. Fixes BUKKIT-4473
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/command/defaults/EffectCommand.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/command/defaults/EffectCommand.java b/src/main/java/org/bukkit/command/defaults/EffectCommand.java index bfa5b2a5..8d9b7425 100644 --- a/src/main/java/org/bukkit/command/defaults/EffectCommand.java +++ b/src/main/java/org/bukkit/command/defaults/EffectCommand.java @@ -16,7 +16,7 @@ public class EffectCommand extends VanillaCommand { public EffectCommand() { super("effect"); this.description = "Adds/Removes effects on players"; - this.usageMessage = "/effect <player> <effect> [seconds] [amplifier]"; + this.usageMessage = "/effect <player> <effect|clear> [seconds] [amplifier]"; this.setPermission("bukkit.command.effect"); } @@ -50,6 +50,14 @@ public class EffectCommand extends VanillaCommand { return true; } + if ("clear".equalsIgnoreCase(args[1])) { + for (PotionEffect effect : player.getActivePotionEffects()) { + player.removePotionEffect(effect.getType()); + } + sender.sendMessage(String.format("Took all effects from %s", args[0])); + return true; + } + PotionEffectType effect = PotionEffectType.getByName(args[1]); if (effect == null) { |