Class PlaybackImpl

java.lang.Object
net.ixdarklord.coolcatcanvas.internal.client.cutscene.PlaybackImpl
All Implemented Interfaces:
CutscenePlayback

public final class PlaybackImpl extends Object implements CutscenePlayback
  • Method Summary

    Modifier and Type
    Method
    Description
     
    @Nullable net.minecraft.resources.Identifier
    id()
    The id it was started by, or null for one played straight from a Cutscene.
    boolean
    Whether it is still the cutscene on screen: false once it has ended, for any reason.
    boolean
     
    Runs once it has ended, with the reason.
    void
    Holds it on its current frame, the camera staying where it is.
    The camera this frame, in the world: where the cutscene has it, or would have it while it is paused.
    void
     
    void
    seek(float time)
    Jumps to a time, in ticks.
    void
    setCameraEnabled(boolean enabled)
    Whether the editor's preview looks through the cutscene's camera, or leaves the player their own eyes.
    void
    setCutscene(Cutscene cutscene, net.minecraft.world.phys.Vec3 origin, float originYaw)
    A preview's cutscene, swapped as the editor changes it; the clock stays where it is.
    void
    setSpeed(float speed)
    How fast it runs: 1 is its own pace, 0.5 slow motion, 2 double time.
    void
    Ends it at once as if the player had skipped it, whether or not it is skippable.
    float
     
    void
    Ends it at once, as CutsceneEndReason.STOPPED.
    float
    How far in it is, in ticks.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface CutscenePlayback

    progress
  • Method Details

    • setCameraEnabled

      public void setCameraEnabled(boolean enabled)
      Whether the editor's preview looks through the cutscene's camera, or leaves the player their own eyes.
    • setCutscene

      public void setCutscene(Cutscene cutscene, net.minecraft.world.phys.Vec3 origin, float originYaw)
      A preview's cutscene, swapped as the editor changes it; the clock stays where it is.
    • cutscene

      public Cutscene cutscene()
      Specified by:
      cutscene in interface CutscenePlayback
    • id

      public @Nullable net.minecraft.resources.Identifier id()
      Description copied from interface: CutscenePlayback
      The id it was started by, or null for one played straight from a Cutscene.
      Specified by:
      id in interface CutscenePlayback
    • time

      public float time()
      Description copied from interface: CutscenePlayback
      How far in it is, in ticks.
      Specified by:
      time in interface CutscenePlayback
    • isActive

      public boolean isActive()
      Description copied from interface: CutscenePlayback
      Whether it is still the cutscene on screen: false once it has ended, for any reason.
      Specified by:
      isActive in interface CutscenePlayback
    • isPaused

      public boolean isPaused()
      Specified by:
      isPaused in interface CutscenePlayback
    • pause

      public void pause()
      Description copied from interface: CutscenePlayback
      Holds it on its current frame, the camera staying where it is.
      Specified by:
      pause in interface CutscenePlayback
    • resume

      public void resume()
      Specified by:
      resume in interface CutscenePlayback
    • seek

      public void seek(float time)
      Description copied from interface: CutscenePlayback
      Jumps to a time, in ticks. Markers jumped over don't fire.
      Specified by:
      seek in interface CutscenePlayback
    • speed

      public float speed()
      Specified by:
      speed in interface CutscenePlayback
    • setSpeed

      public void setSpeed(float speed)
      Description copied from interface: CutscenePlayback
      How fast it runs: 1 is its own pace, 0.5 slow motion, 2 double time.
      Specified by:
      setSpeed in interface CutscenePlayback
    • stop

      public void stop()
      Description copied from interface: CutscenePlayback
      Ends it at once, as CutsceneEndReason.STOPPED.
      Specified by:
      stop in interface CutscenePlayback
    • skip

      public void skip()
      Description copied from interface: CutscenePlayback
      Ends it at once as if the player had skipped it, whether or not it is skippable.
      Specified by:
      skip in interface CutscenePlayback
    • onEnd

      public CutscenePlayback onEnd(Consumer<CutsceneEndReason> listener)
      Description copied from interface: CutscenePlayback
      Runs once it has ended, with the reason. Called at once if it already has.
      Specified by:
      onEnd in interface CutscenePlayback
    • pose

      public CameraPose pose()
      Description copied from interface: CutscenePlayback
      The camera this frame, in the world: where the cutscene has it, or would have it while it is paused.
      Specified by:
      pose in interface CutscenePlayback