24package com.dreamfirestudios.dreamcore.DreamCam;
26import org.bukkit.Bukkit;
27import org.bukkit.Location;
28import org.bukkit.scheduler.BukkitRunnable;
30import java.util.ArrayList;
42 private final List<Location> combinedLocations =
new ArrayList<>();
51 this.camPath = camPath;
53 for (var camSet : camPath.
getCamSets()) combinedLocations.addAll(camSet.points());
62 if (index >= combinedLocations.size()) {
67 var nextLocation = combinedLocations.get(index);
69 if (!camSet.points().contains(nextLocation))
continue;
70 var lastPoint = camSet.points().get(camSet.points().size() - 1);
71 nextLocation = camSet.setRotation(nextLocation, lastPoint);
75 var player = Bukkit.getPlayer(playerUUID);
76 if (player !=
null) player.teleport(nextLocation);
Fired each tick when a path point is reached and applied to players.
Bukkit runnable that steps through a DreamCamPath point-by-point, teleporting players and dispatching...
DreamCamPathRunnable(DreamCamPath camPath)
Constructs a runnable for a given path and flattens all segment points.
void run()
Teleports all players to the next location, adjusts rotation per segment rule, and fires CamPathPoint...
Represents a cinematic camera path composed of multiple camera sets (segments).
List< DreamCamSet > getCamSets()
Gets all camera sets in this path.
List< UUID > getPlayers()
Gets the players currently on this path (by UUID).
void endCamPath(boolean hasFinished)
Stops the path and restores all player states.