mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 12:36:41 +00:00
weSmart
sourcetype fixes; making sure in game commands work only in game
This commit is contained in:
@ -70,20 +70,18 @@ public class Command_potion extends FreedomCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (!target.equals(playerSender))
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(ChatColor.RED + "Only admins can clear potion effects from other players.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (senderIsConsole)
|
||||
if (senderIsConsole)
|
||||
{
|
||||
msg("You must specify a target player when using this command from the console.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(ChatColor.RED + "Only admins can clear potion effects from other players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PotionEffect potion_effect : target.getActivePotionEffects())
|
||||
{
|
||||
target.removePotionEffect(potion_effect.getType());
|
||||
@ -113,20 +111,18 @@ public class Command_potion extends FreedomCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (!target.equals(playerSender))
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Only admins can apply potion effects to other players.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (senderIsConsole)
|
||||
if (senderIsConsole)
|
||||
{
|
||||
sender.sendMessage("You must specify a target player when using this command from the console.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Only admins can apply potion effects to other players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
PotionEffectType potion_effect_type = PotionEffectType.getByName(args[1]);
|
||||
if (potion_effect_type == null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user