Remove double negatives in toggleFly()

This commit is contained in:
Driftay 2019-05-20 13:27:45 -04:00
parent 3c5d8ee050
commit 2cb2068825

View File

@ -193,21 +193,20 @@ public class CmdFly extends FCommand {
} }
if (args.size() == 0) { if (args.size() == 0) {
toggleFlight(!fme.isFlying(), me); toggleFlight(fme.isFlying(), me);
} else if (args.size() == 1) { } else if (args.size() == 1) {
toggleFlight(argAsBool(0), me); toggleFlight(argAsBool(0), me);
} }
} }
private void toggleFlight(final boolean toggle, final Player player) { private void toggleFlight(final boolean toggle, final Player player) {
if (!toggle) { if (toggle) {
fme.setFlying(false); fme.setFlying(false);
flyMap.remove(player.getName()); flyMap.remove(player.getName());
return; return;
} }
if (fme.canFlyAtLocation()) if (fme.canFlyAtLocation())
this.doWarmUp(WarmUpUtil.Warmup.FLIGHT, TL.WARMUPS_NOTIFY_FLIGHT, "Fly", () -> { this.doWarmUp(WarmUpUtil.Warmup.FLIGHT, TL.WARMUPS_NOTIFY_FLIGHT, "Fly", () -> {
fme.setFlying(true); fme.setFlying(true);
flyMap.put(player.getName(), true); flyMap.put(player.getName(), true);