mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Need to call updateFinal within MovingListener.
Necessary with multiple checks updating the BlockChangeReference/span.
This commit is contained in:
parent
5939e1e206
commit
371afd91d0
|
@ -782,6 +782,16 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||
}
|
||||
}
|
||||
|
||||
// Update BlockChangeTracker
|
||||
/*
|
||||
* TODO: Set an activation flag earlier on, based on query for
|
||||
* regions/chunks before running checks (and pass the activation flag to
|
||||
* those).
|
||||
*/
|
||||
if (cc.trackBlockMove && data.blockChangeRef.firstSpanEntry != null) {
|
||||
data.blockChangeRef.updateFinal(pTo);
|
||||
}
|
||||
|
||||
if (newTo == null) {
|
||||
// Allowed move.
|
||||
// Bounce effects.
|
||||
|
|
|
@ -227,6 +227,7 @@ public class Passable extends Check {
|
|||
else if (rayTracing.getStepsDone() >= rayTracing.getMaxSteps()) {
|
||||
debug(player, "Raytracing max steps exceeded (" + tag + "): "+ rayTracing.getCollidingAxis());
|
||||
}
|
||||
// TODO: Detect having used past block changes and log or set a tag.
|
||||
}
|
||||
|
||||
private Location checkLegacy(final Player player, final PlayerLocation from, final PlayerLocation to,
|
||||
|
|
|
@ -656,7 +656,6 @@ public class SurvivalFly extends Check {
|
|||
|| yDistance <= 1.015 && to.getY() - to.getBlockY() < 0.015)) {
|
||||
// TODO: Other conditions? [some will be in passable later].
|
||||
if (from.matchBlockChange(blockChangeTracker, data.blockChangeRef, Direction.Y_POS, Math.min(yDistance, 1.0))) {
|
||||
data.blockChangeRef.updateFinal(to); // TODO: -> MovingListener (!).
|
||||
tags.add("blkmv_y_pos");
|
||||
final double maxDistYPos = yDistance; //1.0 - (from.getY() - from.getBlockY()); // TODO: Margin ?
|
||||
return new double[]{maxDistYPos, 0.0};
|
||||
|
@ -666,7 +665,6 @@ public class SurvivalFly extends Check {
|
|||
else if (yDistance < 0.0 && yDistance >= -1.0) {
|
||||
// TODO: Other conditions? [some will be in passable later].
|
||||
if (from.matchBlockChange(blockChangeTracker, data.blockChangeRef, Direction.Y_NEG, -yDistance)) {
|
||||
data.blockChangeRef.updateFinal(to); // TODO: -> MovingListener (!).
|
||||
tags.add("blkmv_y_neg");
|
||||
final double maxDistYNeg = yDistance; // from.getY() - from.getBlockY(); // TODO: Margin ?
|
||||
return new double[]{maxDistYNeg, 0.0};
|
||||
|
|
|
@ -281,6 +281,13 @@ public class BlockChangeTracker {
|
|||
if (firstSpanEntry == null) {
|
||||
return;
|
||||
}
|
||||
// TODO: Consider a span margin, for which we set last used to first span.
|
||||
/*
|
||||
* TODO: What with latest entries, that stay valid until half round
|
||||
* trip time? Should perhaps keep validity also if entries are the
|
||||
* latest ones, needs updating in span already - can/should do
|
||||
* without bounds?
|
||||
*/
|
||||
if (lastSpanEntry != null && (lastUsedEntry == null || lastSpanEntry.id > lastUsedEntry.id)) {
|
||||
lastUsedEntry = lastSpanEntry;
|
||||
if (to != null && to.isBlockIntersecting(lastSpanEntry.x, lastSpanEntry.y, lastSpanEntry.z)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user