Fix fly specific settings for other players (eg. /fly evonuts on)

This commit is contained in:
evonuts 2012-11-10 22:17:39 +13:00
parent 6a8a2dd28b
commit b11a1a7cf2

View file

@ -30,16 +30,21 @@ public class Commandfly extends EssentialsCommand
{ {
if (args.length == 1) if (args.length == 1)
{ {
if (args[0].contains("on") || args[0].contains("ena") || args[0].equalsIgnoreCase("1")) if (args[0].equalsIgnoreCase("on") || args[0].startsWith("ena") || args[0].equalsIgnoreCase("1"))
{ {
user.setAllowFlight(true); user.setAllowFlight(true);
} }
else if (args[0].contains("off") || args[0].contains("dis") || args[0].equalsIgnoreCase("0")) else if (args[0].equalsIgnoreCase("off") || args[0].startsWith("dis") || args[0].equalsIgnoreCase("0"))
{ {
user.setAllowFlight(false); user.setAllowFlight(false);
} }
else if (user.isAuthorized("essentials.fly.others"))
{
flyOtherPlayers(server, user, args);
return;
} }
else if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.fly.others")) }
else if (args.length == 2 && user.isAuthorized("essentials.fly.others"))
{ {
flyOtherPlayers(server, user, args); flyOtherPlayers(server, user, args);
return; return;