mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-31 07:40:16 +01:00
Adjustments with set-backs.
This commit is contained in:
parent
15d2346dea
commit
c262337940
@ -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.
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user