From 8eebda863f12e21fa16e922cfa196e2a86121c89 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 24 Feb 2014 12:54:54 +0100 Subject: [PATCH] Ensure TeleportCause.PLUGIN is used for teleporting. --- .../neatmonster/nocheatplus/checks/moving/MovingListener.java | 4 ++-- .../fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index fc7d102d..29453087 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -888,7 +888,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo // public void run() { // if (!data.hasSetBackWorldChanged(setBack)) { // && data.isSetBack(setBack)) { // player.sendMessage("SETBACK FROM MC DERP."); -// player.teleport(setBack); +// player.teleport(setBack, TeleportCause.PLUGIN); // } // } // }); @@ -1390,7 +1390,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo final Location newTo = enforceLocation(player, player.getLocation(useLoc), data); if (newTo != null) { data.setTeleported(newTo); - player.teleport(newTo); + player.teleport(newTo, TeleportCause.PLUGIN); } } if (!rem.isEmpty()) { diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index fcc59785..375672c4 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -8,6 +8,7 @@ import java.util.Set; import org.bukkit.Location; import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import fr.neatmonster.nocheatplus.actions.ParameterName; import fr.neatmonster.nocheatplus.checks.Check; @@ -1313,7 +1314,7 @@ public class SurvivalFly extends Check { if (data.hasSetBack()) { final Location newTo = data.getSetBack(loc); data.prepareSetBack(newTo); - player.teleport(newTo); + player.teleport(newTo, TeleportCause.PLUGIN); } else{ // Solve by extra actions ? Special case (probably never happens)?