From 5145ae1714674713f742ac2779f7a3382896c7b5 Mon Sep 17 00:00:00 2001 From: Driftay Date: Sat, 4 Jan 2020 13:23:55 -0500 Subject: [PATCH] Allowed players to continue using Essentials fly is Factions Fly is Disabled --- src/main/java/com/massivecraft/factions/cmd/CmdDisband.java | 6 +++--- .../factions/listeners/FactionsPlayerListener.java | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java index f32ce555..ed38ff88 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java @@ -82,19 +82,19 @@ public class CmdDisband extends FCommand { String amountString = context.sender instanceof ConsoleCommandSender ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(follower); if (follower.getFaction() == faction) { follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString); - if (!follower.canFlyAtLocation()) { + if (!follower.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) { follower.setFFlying(false, false); } } else { follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower)); } } - context.fPlayer.setFFlying(false, false); + if(FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) context.fPlayer.setFFlying(false, false); } else { context.player.sendMessage(String.valueOf(TL.COMMAND_DISBAND_PLAYER)); } faction.disband(context.player, PlayerDisbandReason.COMMAND); - if (!context.fPlayer.canFlyAtLocation()) { + if (!context.fPlayer.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) { context.fPlayer.setFFlying(false, false); } } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index ef15f805..06718769 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -552,7 +552,6 @@ public class FactionsPlayerListener implements Listener { public String parseAllPlaceholders(String string, Faction faction, Player player) { string = TagUtil.parsePlaceholders(player, string); - string = string.replace("{Faction}", faction.getTag()) .replace("{online}", faction.getOnlinePlayers().size() + "") .replace("{offline}", faction.getFPlayers().size() - faction.getOnlinePlayers().size() + "") @@ -563,13 +562,13 @@ public class FactionsPlayerListener implements Listener { } public void checkCanFly(FPlayer me) { + if (!FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) return; if (me.isFlying() && (!me.canFlyAtLocation() || me.checkIfNearbyEnemies())) { me.setFFlying(false, false); me.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(me.getLastStoodAt()).getTag()); return; } - if (me.isFlying() || !FactionsPlugin.instance.getConfig().getBoolean("ffly.AutoEnable")) - return; + if (me.isFlying() || !FactionsPlugin.instance.getConfig().getBoolean("ffly.AutoEnable")) return; me.setFFlying(true, false); CmdFly.flyMap.put(me.getName(), true); if (CmdFly.particleTask == null)