From 8ff8c78a44ce27acf91e8af7c70e8139bfb88f5c Mon Sep 17 00:00:00 2001 From: Driftay Date: Mon, 27 Jan 2020 00:47:48 -0500 Subject: [PATCH] Fixed Mouse Movement for Wild Teleportation & Properly initialized tntfill aliases --- .../massivecraft/factions/cmd/tnt/CmdTntFill.java | 2 +- .../factions/listeners/FactionsPlayerListener.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/tnt/CmdTntFill.java b/src/main/java/com/massivecraft/factions/cmd/tnt/CmdTntFill.java index b49e00b0..de3bb5f3 100644 --- a/src/main/java/com/massivecraft/factions/cmd/tnt/CmdTntFill.java +++ b/src/main/java/com/massivecraft/factions/cmd/tnt/CmdTntFill.java @@ -26,7 +26,7 @@ public class CmdTntFill extends FCommand { public CmdTntFill() { super(); - this.aliases.add("tntfill"); + this.aliases.addAll(Aliases.tnt_tntfill); this.requiredArgs.add("radius"); this.requiredArgs.add("amount"); diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 660326e3..e96a3f21 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -920,6 +920,8 @@ public class FactionsPlayerListener implements Listener { } } + + @EventHandler public void onLogoutMove(PlayerMoveEvent e) { LogoutHandler handler = LogoutHandler.getByName(e.getPlayer().getName()); @@ -927,6 +929,12 @@ public class FactionsPlayerListener implements Listener { handler.cancelLogout(e.getPlayer()); e.getPlayer().sendMessage(String.valueOf(TL.COMMAND_LOGOUT_MOVED)); } + + if (e.getTo().getBlockX() == e.getFrom().getBlockX() && + e.getTo().getBlockY() == e.getFrom().getBlockY() && + e.getTo().getBlockZ() == e.getFrom().getBlockZ()) + return; + if (CmdWild.waitingTeleport.containsKey(e.getPlayer())) { CmdWild.waitingTeleport.remove(e.getPlayer()); FPlayers.getInstance().getByPlayer(e.getPlayer()).msg(TL.COMMAND_WILD_INTERUPTED); @@ -1062,13 +1070,13 @@ public class FactionsPlayerListener implements Listener { } FPlayer fp = FPlayers.getInstance().getByPlayer(e.getPlayer()); - if(fp == null) return; + if (fp == null) return; if (fp.getChatMode() != ChatMode.FACTION) { return; } Faction f = fp.getFaction(); - if(f == null) return; + if (f == null) return; if (f.isSystemFaction()) { return; } @@ -1087,7 +1095,7 @@ public class FactionsPlayerListener implements Listener { } } else { for (Member m : t.getMembers()) { - if (m.getEffectiveName().contains(target) | m.getUser().getName().contains(target)){ + if (m.getEffectiveName().contains(target) | m.getUser().getName().contains(target)) { targets.add("@" + m.getUser().getName() + "#" + m.getUser().getDiscriminator()); } }