Got rid of respawn and worldchanged workarounds in favour of more

generic ways to handle that.
This commit is contained in:
Evenprime 2011-06-19 12:17:20 +02:00
parent 7598cecdc9
commit ed14d23f25
4 changed files with 6 additions and 16 deletions

View File

@ -406,8 +406,6 @@ public class NoCheat extends JavaPlugin implements CommandSender {
}
@Override
public void sendMessage(String message) {
// we don't receive messages

View File

@ -384,7 +384,7 @@ public class MovingCheck extends Check {
private boolean shouldBeIgnored(final Player player, final MovingData data, final Location from, final Location to) {
// First the simple yes/no checks
if(data.respawned || data.insideVehicle || player.isInsideVehicle() || data.worldChanged) {
if(/*data.respawned ||*/ data.insideVehicle || player.isInsideVehicle()) {
return true;
}
@ -454,8 +454,6 @@ public class MovingCheck extends Check {
MovingData data = MovingData.get(event.getPlayer());
if(data.respawned) data.respawned = false;
// We can enforce a teleport, if that flag is explicitly set
if(event.isCancelled() && enforceTeleport && event.getTo().equals(data.teleportTo)) {
event.setCancelled(false);
@ -465,8 +463,6 @@ public class MovingCheck extends Check {
data.lastLocation = event.getTo();
data.jumpPhase = 0;
data.setBackPoint = event.getTo();
data.worldChanged = !event.getFrom().getWorld().getName().equals(event.getTo().getWorld().getName());
}
}
@ -476,8 +472,7 @@ public class MovingCheck extends Check {
*/
public void respawned(PlayerRespawnEvent event) {
MovingData data = MovingData.get(event.getPlayer());
data.respawned = true;
data.lastLocation = event.getRespawnLocation(); // We expect the player to be there next
}
/**

View File

@ -29,8 +29,6 @@ public class MovingData {
public double sneakingLastDistance = 0.0D;
public double swimmingLastDistance = 0.0D;
public boolean worldChanged = false;
public boolean respawned = false;
public boolean insideVehicle = false;
// WORKAROUND for changed PLAYER_MOVE logic

View File

@ -20,6 +20,5 @@ public class MovingEntityListener extends EntityListener {
if(event.getEntity() instanceof Player) {
check.updateVelocity(event.getEntity().getVelocity(), MovingData.get((Player)event.getEntity()));
}
}
}