mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
added /potion clearall
This commit is contained in:
parent
ac0dc43cd7
commit
3399207fd7
@ -3,6 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||||
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -31,6 +32,21 @@ public class Command_potion extends TFM_Command
|
|||||||
}
|
}
|
||||||
playerMsg("Potion effect types: " + StringUtils.join(potionEffectTypeNames, ", "), ChatColor.AQUA);
|
playerMsg("Potion effect types: " + StringUtils.join(potionEffectTypeNames, ", "), ChatColor.AQUA);
|
||||||
}
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("clearall"))
|
||||||
|
{
|
||||||
|
if (!(TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole))
|
||||||
|
{
|
||||||
|
playerMsg(TotalFreedomMod.MSG_NO_PERMS);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (Player target : server.getOnlinePlayers())
|
||||||
|
{
|
||||||
|
for (PotionEffect potion_effect : target.getActivePotionEffects())
|
||||||
|
{
|
||||||
|
target.removePotionEffect(potion_effect.getType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (args[0].equalsIgnoreCase("clear"))
|
else if (args[0].equalsIgnoreCase("clear"))
|
||||||
{
|
{
|
||||||
Player target = sender_p;
|
Player target = sender_p;
|
||||||
|
Loading…
Reference in New Issue
Block a user