This commit is contained in:
KHobbits 2013-10-18 00:04:17 +01:00
parent be31b1695d
commit 64e089e15b
12 changed files with 15 additions and 15 deletions

View file

@ -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"));
} }

View file

@ -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);
} }

View file

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

View file

@ -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;
} }

View file

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

View file

@ -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;
} }

View file

@ -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());

View file

@ -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"));
} }

View file

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

View file

@ -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;
} }

View file

@ -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"));
} }

View file

@ -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;