Ensure TeleportCause.PLUGIN is used for teleporting.

This commit is contained in:
asofold 2014-02-24 12:54:54 +01:00
parent 65b3c4440d
commit 8eebda863f
2 changed files with 4 additions and 3 deletions

View File

@ -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()) {

View File

@ -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)?