From b587bf34f8e8fc0463735791389841d9a39de602 Mon Sep 17 00:00:00 2001 From: evonuts Date: Sat, 10 Nov 2012 22:17:39 +1300 Subject: [PATCH] Fix fly specific settings for other players (eg. /fly evonuts on) --- .../com/earth2me/essentials/commands/Commandfly.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index b0bd91ee5..a299770b1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -30,16 +30,21 @@ public class Commandfly extends EssentialsCommand { 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); } - 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); } + 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); return;