mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-28 22:47:32 +02:00
[BLEEDING] Allow to override the set-back via MovingData.setTeleported.
This way, you can calculate a more interesting set-back location from within a hook during violation handling. All you need to do to adjust the set-back location is to call MovingData.setTeleported(newSetBack) and NoCheatPlus should recognize this as the location to set back to. Please do: * Test if the check in question would set back at all (IViolationData.wilCancel() returns true). Please in such a case do not: * Don't call setTeleported if IViolationData.willCancel() returns false :). * Cancel violation processing. * Teleport the player. * Do something complicated with MovingData otherwise :).
This commit is contained in:
parent
8fc9b1df91
commit
34e3548ec5
@ -861,7 +861,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
data.blockChangeRef.updateFinal(pTo);
|
||||
}
|
||||
|
||||
if (newTo == null) {
|
||||
if (newTo == null && !data.hasTeleported()) {
|
||||
// Allowed move.
|
||||
// Bounce effects.
|
||||
if (verticalBounce != BounceType.NO_BOUNCE) {
|
||||
@ -882,6 +882,9 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if (data.hasTeleported()) {
|
||||
newTo = data.getTeleported();
|
||||
}
|
||||
if (data.debug) { // TODO: Remove, if not relevant (doesn't look like it was :p).
|
||||
if (verticalBounce != BounceType.NO_BOUNCE) {
|
||||
debug(player, "Bounce effect not processed: " + verticalBounce);
|
||||
|
Loading…
Reference in New Issue
Block a user