diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java index d7b0517e4..1d62e32d3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java @@ -1,6 +1,5 @@ package mineplex.game.clans.clans.ban.commands; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java index 2286d020f..f07a24ea6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java @@ -1,6 +1,8 @@ package mineplex.game.clans.gameplay.safelog; import java.io.File; +import java.util.ArrayList; +import java.util.List; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -49,6 +51,12 @@ public class SafeLog extends MiniPlugin isSafeLog = true; } + if (_flying.contains(player.getName())) + { + _flying.remove(player.getName()); + return; + } + if (!isSafeLog) { NPCManager.getInstance().spawnLogoutNpc(player); @@ -93,6 +101,8 @@ public class SafeLog extends MiniPlugin } } } + + private List _flying = new ArrayList<>(); @EventHandler(priority = EventPriority.LOWEST) public void onPlayerQuit(PlayerQuitEvent event) @@ -101,6 +111,16 @@ public class SafeLog extends MiniPlugin onPlayerQuit(event.getPlayer()); } + + @EventHandler(priority = EventPriority.HIGHEST) + public void flyCheck(PlayerKickEvent event) + { + if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getItemMeta() != null && (C.cGold + "Wind Blade").equals(event.getPlayer().getItemInHand().getItemMeta().getDisplayName())) + if (event.getReason().contains("flying is not enabled")) + return; + + _flying.add(event.getPlayer().getName()); + } @EventHandler(priority = EventPriority.LOWEST) public void onPlayerKicked(PlayerKickEvent event) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java index f081d1450..451149aad 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java @@ -211,15 +211,22 @@ public class NPCManager extends MiniPlugin { CombatLogNPC npc = iterator.next(); + if (Bukkit.getPlayer(npc.getPlayerInfo().getPlayerName()) != null) + { + System.out.println("{NPCMANAGER} ORIGINAL PLAYER ALIVE AND DESPAWNING"); + npc.despawn(); + iterator.remove(); + } + if (!npc.isAlive()) { - System.out.println("NOT ALIVE AND REMOVING"); + System.out.println("{NPCMANAGER} NOT ALIVE AND REMOVING"); npc.remove(); iterator.remove(); } else if (npc.getAliveDuation() > COMBAT_LOG_DURATION) { - System.out.println("DESPAWNING"); + System.out.println("{NPCMANAGER} DESPAWNING"); npc.despawn(); iterator.remove(); }