Class ServerCutsceneEvents

java.lang.Object
net.ixdarklord.coolcatcanvas.api.event.v2.common.ServerCutsceneEvents

public final class ServerCutsceneEvents extends Object
Cutscenes the server started with CutsceneControl, as their players watch them. All fire on the server thread. Cutscenes a client plays on its own are not reported.
ServerCutsceneEvents.KEYFRAME.register((player, cutscene, index) -> {
    if (cutscene.equals(MyMod.id("boss_arena")) && index == 2) boss.roar();
});
ServerCutsceneEvents.ENDED.register((player, cutscene, reason) -> arena.begin(player));
KEYFRAME, MARKER and ENDED are what the player's client reports: they arrive a little after the fact, and a modified client can claim any of them at any time, for the cutscene it was sent. Don't hand out anything of value on their word alone. STARTED and TICK are the server's own.
  • Field Details

    • STARTED

      public static final EventInvoker<ServerCutsceneEvents.Started> STARTED
      After a player was sent a cutscene to play.
    • TICK

      public static final EventInvoker<ServerCutsceneEvents.Tick> TICK
      Every server tick a player is watching a cutscene, from the tick after it was sent until it ends. The count is the server's own: the player's clock can differ (lag, a paused or slowed playback), so use KEYFRAME or MARKER for anything that must land on a moment of the scene.
    • KEYFRAME

      public static final EventInvoker<ServerCutsceneEvents.Keyframe> KEYFRAME
      As a player's camera reaches one of the cutscene's keyframes, the first included.
    • MARKER

      public static final EventInvoker<ServerCutsceneEvents.Marker> MARKER
      As a player's cutscene passes one of its markers.
    • ENDED

      public static final EventInvoker<ServerCutsceneEvents.Ended> ENDED
      After a player's cutscene ended: seen through, skipped, stopped, replaced by another, or cut short by them leaving. The place to hand the world back: teleport them, start the fight, lift what kept them safe.