sourcetype fixes; making sure in game commands work only in game
This commit is contained in:
speedxx
2020-07-28 23:14:58 -04:00
parent 05abebea65
commit 0ae835aa04
11 changed files with 49 additions and 39 deletions

View File

@ -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)
{