mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-30 02:08:24 +00:00
Cleanup
This commit is contained in:
parent
be31b1695d
commit
64e089e15b
12 changed files with 15 additions and 15 deletions
|
@ -45,7 +45,7 @@ public class Commandban extends EssentialsCommand
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.ban.exempt") && sender instanceof Player)
|
if (user.isAuthorized("essentials.ban.exempt") && sender.isPlayer())
|
||||||
{
|
{
|
||||||
throw new Exception(_("banExempt"));
|
throw new Exception(_("banExempt"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,7 @@ public class Commandessentials extends EssentialsCommand
|
||||||
if (sender.isPlayer())
|
if (sender.isPlayer())
|
||||||
{
|
{
|
||||||
sender.getSender().sendMessage(playerMoo);
|
sender.getSender().sendMessage(playerMoo);
|
||||||
final Player player = (Player)sender;
|
final Player player = sender.getPlayer();
|
||||||
player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
|
player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class Commanditemdb extends EssentialsCommand
|
||||||
if (sender.isPlayer())
|
if (sender.isPlayer())
|
||||||
{
|
{
|
||||||
itemHeld = true;
|
itemHeld = true;
|
||||||
itemStack = ((Player)sender).getItemInHand();
|
itemStack = sender.getPlayer().getItemInHand();
|
||||||
}
|
}
|
||||||
if (itemStack == null)
|
if (itemStack == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class Commandkickall extends EssentialsCommand
|
||||||
|
|
||||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
if (sender.isPlayer() && onlinePlayer.getName().equalsIgnoreCase(((Player)sender).getName()))
|
if (sender.isPlayer() && onlinePlayer.getName().equalsIgnoreCase(sender.getPlayer().getName()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Commandkill extends EssentialsLoopCommand
|
||||||
{
|
{
|
||||||
throw new PlayerExemptException(_("killExempt", matchPlayer.getDisplayName()));
|
throw new PlayerExemptException(_("killExempt", matchPlayer.getDisplayName()));
|
||||||
}
|
}
|
||||||
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
|
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender.isPlayer() && sender.getPlayer().getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
|
||||||
server.getPluginManager().callEvent(ede);
|
server.getPluginManager().callEvent(ede);
|
||||||
if (ede.isCancelled() && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force"))
|
if (ede.isCancelled() && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class Commandkillall extends EssentialsCommand
|
||||||
World world;
|
World world;
|
||||||
if (sender.isPlayer())
|
if (sender.isPlayer())
|
||||||
{
|
{
|
||||||
world = ((Player)sender).getWorld();
|
world = sender.getPlayer().getWorld();
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -98,7 +98,7 @@ public class Commandkillall extends EssentialsCommand
|
||||||
{
|
{
|
||||||
if (sender.isPlayer())
|
if (sender.isPlayer())
|
||||||
{
|
{
|
||||||
if (radius >= 0 && ((Player)sender).getLocation().distanceSquared(entity.getLocation()) > radius)
|
if (radius >= 0 && sender.getPlayer().getLocation().distanceSquared(entity.getLocation()) > radius)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class Commandlightning extends EssentialsLoopCommand
|
||||||
User user = null;
|
User user = null;
|
||||||
if (sender.isPlayer())
|
if (sender.isPlayer())
|
||||||
{
|
{
|
||||||
user = ess.getUser(((Player)sender));
|
user = ess.getUser(sender.getPlayer());
|
||||||
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others")))
|
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others")))
|
||||||
{
|
{
|
||||||
user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation());
|
user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation());
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class Commandmute extends EssentialsCommand
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.mute.exempt") && sender instanceof Player)
|
if (user.isAuthorized("essentials.mute.exempt") && sender.isPlayer())
|
||||||
{
|
{
|
||||||
throw new Exception(_("muteExempt"));
|
throw new Exception(_("muteExempt"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,9 +64,9 @@ public class Commandr extends EssentialsCommand
|
||||||
replyTo.setReplyTo(target);
|
replyTo.setReplyTo(target);
|
||||||
if (target != sender)
|
if (target != sender)
|
||||||
{
|
{
|
||||||
if (target instanceof Player)
|
if (target.isPlayer())
|
||||||
{
|
{
|
||||||
ess.getUser((Player)target).setReplyTo(sender);
|
ess.getUser(target.isPlayer()).setReplyTo(sender);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class Commandremove extends EssentialsCommand
|
||||||
{
|
{
|
||||||
if (radius > 0)
|
if (radius > 0)
|
||||||
{
|
{
|
||||||
if (((Player)sender).getLocation().distanceSquared(e.getLocation()) > radius)
|
if (sender.getPlayer().getLocation().distanceSquared(e.getLocation()) > radius)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class Commandsudo extends EssentialsCommand
|
||||||
final User user = getPlayer(server, sender, args, 0);
|
final User user = getPlayer(server, sender, args, 0);
|
||||||
if(args[1].toLowerCase(Locale.ENGLISH).startsWith("c:"))
|
if(args[1].toLowerCase(Locale.ENGLISH).startsWith("c:"))
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.sudo.exempt") && sender instanceof Player)
|
if (user.isAuthorized("essentials.sudo.exempt") && sender.isPlayer())
|
||||||
{
|
{
|
||||||
throw new Exception(_("sudoExempt"));
|
throw new Exception(_("sudoExempt"));
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class Commandsudo extends EssentialsCommand
|
||||||
System.arraycopy(args, 2, arguments, 0, args.length - 2);
|
System.arraycopy(args, 2, arguments, 0, args.length - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.isAuthorized("essentials.sudo.exempt") && sender instanceof Player)
|
if (user.isAuthorized("essentials.sudo.exempt") && sender.isPlayer())
|
||||||
{
|
{
|
||||||
throw new Exception(_("sudoExempt"));
|
throw new Exception(_("sudoExempt"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class Commandtempban extends EssentialsCommand
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.tempban.exempt") && sender instanceof Player)
|
if (user.isAuthorized("essentials.tempban.exempt") && sender.isPlayer())
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("tempbanExempt"));
|
sender.sendMessage(_("tempbanExempt"));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue