From 038edb23125894af16bd310597b5f4b9a141181a Mon Sep 17 00:00:00 2001 From: sanguine <152292988+sanguine6660@users.noreply.github.com> Date: Tue, 19 Dec 2023 12:24:35 +0100 Subject: [PATCH] UPDATE checks in fly listener --- .../izanagicraft/guard/events/listener/PlayerFlyListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldguard-plugin-bukkit/src/main/java/com/izanagicraft/guard/events/listener/PlayerFlyListener.java b/worldguard-plugin-bukkit/src/main/java/com/izanagicraft/guard/events/listener/PlayerFlyListener.java index 5317133..9709eb9 100644 --- a/worldguard-plugin-bukkit/src/main/java/com/izanagicraft/guard/events/listener/PlayerFlyListener.java +++ b/worldguard-plugin-bukkit/src/main/java/com/izanagicraft/guard/events/listener/PlayerFlyListener.java @@ -105,7 +105,7 @@ public PlayerFlyListener(IzanagiWorldGuardPlugin plugin) { boolean flyMode = (online.getGameMode().equals(GameMode.SPECTATOR) || online.getGameMode().equals(GameMode.CREATIVE)); - if (!flyMode && online.getAllowFlight() && !allowFly) { + if (!flyMode && online.getAllowFlight() != allowFly && !allowFly) { Bukkit.getScheduler().runTask(getPlugin(), () -> { online.setAllowFlight(false); MessageUtils.sendPrefixedMessage(online, "&cYou're not allowed to fly anymore. In (10 seconds) you'll fall to the ground."); @@ -126,7 +126,7 @@ public PlayerFlyListener(IzanagiWorldGuardPlugin plugin) { }); } - if (!flyMode && !online.getAllowFlight() && allowFly) { + if (!flyMode && online.getAllowFlight() != allowFly && allowFly) { Bukkit.getScheduler().runTask(getPlugin(), () -> { online.setAllowFlight(true); online.sendActionBar(MessageUtils.getComponentSerializer().deserialize(