Allow next next location in JumpAndRun

This commit is contained in:
2025-04-26 23:56:59 +02:00
parent e72ae3cf94
commit b5a9564808
@@ -104,12 +104,18 @@ public class JumpAndRun extends BasicListener {
return;
}
Vector point = points.get(index);
if (location.getY() < point.getY()) {
return;
}
if (location.toVector().distanceSquared(point) >= 17) {
if (location.getY() < point.getY()) index = -2;
if (location.toVector().distanceSquared(point) >= 17) index = -2;
if (index > 0 && index < points.size() - 1) {
Vector nextPoint = points.get(index + 1);
if (location.getY() >= nextPoint.getY() && location.toVector().distanceSquared(nextPoint) < 17) {
index = index + 1;
}
}
if (index == -2) {
return;
}
CURRENT_POS.put(event.getPlayer(), index);
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.4F, 1);
if (index < points.size() - 1) {