From b5a95648088c07492ffe4feed54442b61c3d18e8 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sat, 26 Apr 2025 23:56:59 +0200 Subject: [PATCH] Allow next next location in JumpAndRun --- .../de/steamwar/lobby/jumpandrun/JumpAndRun.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/LobbySystem/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java b/LobbySystem/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java index 324a7901..3b8a3ab4 100644 --- a/LobbySystem/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java +++ b/LobbySystem/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java @@ -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) {