Adjustments with set-backs.

This commit is contained in:
asofold 2013-01-05 19:20:05 +01:00
parent 15d2346dea
commit c262337940
4 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ public class MovingData extends ACheckData {
public void onSetBack(final Location setBack) {
// Reset positions
resetPositions(teleported);
// NOTE: Do mind that the reference is used diredctly for set-backs, should stay consistent, though.
// NOTE: Do mind that the reference is used directly for set-backs, should stay consistent, though.
this.setBack = this.morePacketsSetback = this.morePacketsVehicleSetback = teleported;
clearAccounting(); // Might be more safe to do this.
// Keep no-fall data.

View File

@ -622,6 +622,7 @@ public class MovingListener extends CheckListener{
data.clearFlyData();
data.clearMorePacketsData();
data.setBack = event.getRespawnLocation();
// TODO: consider data.resetPositions(data.setBack);
}
/**
@ -849,6 +850,7 @@ public class MovingListener extends CheckListener{
final Player player = event.getPlayer();
final MovingData data = MovingData.getData(player);
// TODO: on existing set back: detect world changes and loss of world on join (+ set up some paradigm).
data.clearMorePacketsData();
if (data.setBack == null){
data.setBack = player.getLocation();
}

View File

@ -61,7 +61,7 @@ public class Passable extends Check {
}
// Prefer the set-back location from the data.
if (data.setBack != null && BlockProperties.isPassable(from.getBlockCache(), data.setBack)) loc = data.setBack;
if (data.setBack != null && BlockProperties.isPassable(from.getBlockCache(), data.setBack)) loc = data.setBack.clone();
// TODO: set data.set-back ? or something: still some aji here.

View File

@ -624,12 +624,10 @@ public class SurvivalFly extends Check {
} else data.sfCobwebVL += vDistanceAboveLimit * 100D;
if (data.sfCobwebVL < 550) { // Totally random !
// Silently set back.
if (data.setBack == null) data.setBack = player.getLocation();
if (data.setBack == null) data.setSetBack(player.getLocation());
data.sfJumpPhase = 0;
data.setBack.setYaw(to.getYaw());
data.setBack.setPitch(to.getPitch());
data.sfLastYDist = Double.MAX_VALUE;
return data.setBack.clone();
return data.getSetBack(to);
} else return null;
}