mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-02 11:11:58 +01:00
Cleanup
This commit is contained in:
parent
be31b1695d
commit
64e089e15b
@ -45,7 +45,7 @@ public class Commandban extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user.isAuthorized("essentials.ban.exempt") && sender instanceof Player)
|
||||
if (user.isAuthorized("essentials.ban.exempt") && sender.isPlayer())
|
||||
{
|
||||
throw new Exception(_("banExempt"));
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public class Commandessentials extends EssentialsCommand
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
sender.getSender().sendMessage(playerMoo);
|
||||
final Player player = (Player)sender;
|
||||
final Player player = sender.getPlayer();
|
||||
player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class Commanditemdb extends EssentialsCommand
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
itemHeld = true;
|
||||
itemStack = ((Player)sender).getItemInHand();
|
||||
itemStack = sender.getPlayer().getItemInHand();
|
||||
}
|
||||
if (itemStack == null)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ public class Commandkickall extends EssentialsCommand
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
if (sender.isPlayer() && onlinePlayer.getName().equalsIgnoreCase(((Player)sender).getName()))
|
||||
if (sender.isPlayer() && onlinePlayer.getName().equalsIgnoreCase(sender.getPlayer().getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class Commandkill extends EssentialsLoopCommand
|
||||
{
|
||||
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);
|
||||
if (ede.isCancelled() && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force"))
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
World world;
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
world = ((Player)sender).getWorld();
|
||||
world = sender.getPlayer().getWorld();
|
||||
if (args.length == 1)
|
||||
{
|
||||
try
|
||||
@ -98,7 +98,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
{
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
if (radius >= 0 && ((Player)sender).getLocation().distanceSquared(entity.getLocation()) > radius)
|
||||
if (radius >= 0 && sender.getPlayer().getLocation().distanceSquared(entity.getLocation()) > radius)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class Commandlightning extends EssentialsLoopCommand
|
||||
User user = null;
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
user = ess.getUser(((Player)sender));
|
||||
user = ess.getUser(sender.getPlayer());
|
||||
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others")))
|
||||
{
|
||||
user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation());
|
||||
|
@ -43,7 +43,7 @@ public class Commandmute extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user.isAuthorized("essentials.mute.exempt") && sender instanceof Player)
|
||||
if (user.isAuthorized("essentials.mute.exempt") && sender.isPlayer())
|
||||
{
|
||||
throw new Exception(_("muteExempt"));
|
||||
}
|
||||
|
@ -64,9 +64,9 @@ public class Commandr extends EssentialsCommand
|
||||
replyTo.setReplyTo(target);
|
||||
if (target != sender)
|
||||
{
|
||||
if (target instanceof Player)
|
||||
if (target.isPlayer())
|
||||
{
|
||||
ess.getUser((Player)target).setReplyTo(sender);
|
||||
ess.getUser(target.isPlayer()).setReplyTo(sender);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ public class Commandremove extends EssentialsCommand
|
||||
{
|
||||
if (radius > 0)
|
||||
{
|
||||
if (((Player)sender).getLocation().distanceSquared(e.getLocation()) > radius)
|
||||
if (sender.getPlayer().getLocation().distanceSquared(e.getLocation()) > radius)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Commandsudo extends EssentialsCommand
|
||||
final User user = getPlayer(server, sender, args, 0);
|
||||
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"));
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class Commandsudo extends EssentialsCommand
|
||||
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"));
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class Commandtempban extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user.isAuthorized("essentials.tempban.exempt") && sender instanceof Player)
|
||||
if (user.isAuthorized("essentials.tempban.exempt") && sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage(_("tempbanExempt"));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user