Limit backwards teleport check

This commit is contained in:
D-Cysteine committed 2024-04-14 13:01:17 -06:00
1 parent f1978a6a15
commit 58e8bf712c
1 file changed
+3 -1
@@ -365,12 +365,14 @@ public class TravelController {
}
double distanceIncrement = -2;
int maxIter = Math.min(8, (int) teleDistance / 2);
// Special case: if the targeted block is too close, we'll try to teleport through it.
if (teleDistance < 4) {
distanceIncrement = 0.5;
maxIter = 32;
}
for (int i = 0; i < 32; i++) {
for (int i = 0; i < maxIter; i++) {
teleDistance += distanceIncrement;
sample.set(look);