Skip to content

Commit e054c6f

Browse files
committed
📝 Fix temp fly on world change
1 parent ce38b89 commit e054c6f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/fr/maxlego08/essentials/listener/PlayerListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ public void onChangeWorld(PlayerChangedWorldEvent event) {
291291
var configuration = plugin.getConfiguration();
292292
var worldName = player.getWorld().getName();
293293

294-
if (configuration.getDisableFlyWorld().contains(worldName) && player.isFlying() && !hasPermission(player, Permission.ESSENTIALS_FLY_BYPASS_WORLD)) {
294+
if (configuration.getDisableFlyWorld().contains(worldName) && player.getAllowFlight() && !hasPermission(player, Permission.ESSENTIALS_FLY_BYPASS_WORLD)) {
295295

296-
player.setAllowFlight(false);
297296
player.setFlying(false);
297+
player.setAllowFlight(false);
298298
player.setMetadata("zessentials-fly", new FixedMetadataValue(this.plugin, true));
299299
message(player, Message.COMMAND_FLY_ERROR_WORLD);
300300
} else if (configuration.isEnableFlyReturn() && !configuration.getDisableFlyWorld().contains(worldName) && player.hasMetadata("zessentials-fly")) {

0 commit comments

Comments
 (0)