fix: lobby ownership, duplicate locations, hook hologram, TP hooked players back

This commit is contained in:
loki5512344 2026-06-14 16:40:07 +02:00
parent 183df22d13
commit 2706d6d123
7 changed files with 75 additions and 9 deletions

View file

@ -27,13 +27,34 @@ public class GameplayHookHandler {
this.hookRecovery = hookRecovery;
}
private int hookTpTick;
/**
* Called every tick - checks hook stage progression.
* Called every tick - checks hook stage progression and teleports hooked players back.
*/
public void tick() {
// HookManager handles its own ticking via startTicking()
// We just need to check stage transitions here
checkHookStages();
hookTpTick++;
if (hookTpTick >= 20) {
hookTpTick = 0;
tpHookedBack();
}
}
/**
* Teleport hooked survivors back to their hook if they've moved too far.
*/
private void tpHookedBack() {
for (Hook hook : hookManager.getAllHooks()) {
if (!hook.isOccupied()) continue;
Survivor hooked = hook.getHookedSurvivor();
if (hooked == null) continue;
Player p = hooked.getPlayer();
if (p == null || !p.isOnline()) continue;
if (p.getLocation().distanceSquared(hook.getLocation()) > 1.0) {
p.teleport(hook.getLocation().clone().add(0.5, 0, 0.5));
}
}
}
/**