Class CutsceneManager

java.lang.Object
net.thewinnt.cutscenes.CutsceneManager

public class CutsceneManager extends Object
  • Field Details

  • Constructor Details

    • CutsceneManager

      public CutsceneManager()
  • Method Details

    • registerCutscene

      public static CutsceneType registerCutscene(net.minecraft.resources.ResourceLocation id, @NotNull @NotNull CutsceneType type)
      Registers a cutscene type
      Parameters:
      id - The ID of the cutscene type that will be used in commands
      type - The actual cutscene type you want to register
      Returns:
      Your cutscene type for storing
    • registerSegmentType

      public static void registerSegmentType(net.minecraft.resources.ResourceLocation id, PathLike.SegmentSerializer<?> type)
      Registers a segment serializer
      Parameters:
      id - The ID of the segment type that will be used in datapacks
      type - The serializer to register
    • registerPointType

      public static void registerPointType(net.minecraft.resources.ResourceLocation id, PointProvider.PointSerializer<?> type)
      Registers a point serializer
      Parameters:
      id - The ID of the point type that will be used in datapacks
      type - The serializer to register
    • registerTransitionType

      public static void registerTransitionType(net.minecraft.resources.ResourceLocation id, Transition.TransitionSerializer<?> type)
      Registers a transition serializer
      Parameters:
      id - The ID of the transition type that will be used in datapacks
      type - The serializer to register
    • getSegmentTypeId

      public static net.minecraft.resources.ResourceLocation getSegmentTypeId(PathLike.SegmentSerializer<?> type)
      Returns the ID of the specified serializer, or null if it's not registered
    • getSegmentType

      public static PathLike.SegmentSerializer<?> getSegmentType(net.minecraft.resources.ResourceLocation id)
      Returns the segment serializer with this ID, or null if it doesn't exist
    • getPointTypeId

      public static net.minecraft.resources.ResourceLocation getPointTypeId(PointProvider.PointSerializer<?> type)
      Returns the ID of the specified point type, or null if it's not registered
    • getPointType

      @Nullable public static @Nullable PointProvider.PointSerializer<?> getPointType(net.minecraft.resources.ResourceLocation id)
      Returns the point serializer with this ID, or null if it doesn't exist
    • getTransitionTypeId

      @Nullable public static @Nullable net.minecraft.resources.ResourceLocation getTransitionTypeId(Transition.TransitionSerializer<?> type)
      Returns the ID of the specified transition type, or null if it's not registered
    • getTransitionType

      @Nullable public static @Nullable Transition.TransitionSerializer<?> getTransitionType(net.minecraft.resources.ResourceLocation id)
      Returns the transition serializer with this ID, or null if it doesn't exist
    • setPreviewedCutscene

      public static void setPreviewedCutscene(CutsceneType type, net.minecraft.world.phys.Vec3 offset, float pathYaw, float pathPitch, float pathRoll)
      Sets the currently previewed cutscene and tells the clients
    • getPreviewedCutscene

      public static CutsceneType getPreviewedCutscene()
      Self-explanatory
    • getOffset

      public static org.joml.Vector3f getOffset()
      Returns the starting position of the current cutscene preview, or [0, 100, 0] if there isn't one
    • startCutscene

      public static void startCutscene(net.minecraft.resources.ResourceLocation id, net.minecraft.world.phys.Vec3 startPos, net.minecraft.world.phys.Vec3 camRot, net.minecraft.world.phys.Vec3 pathRot, net.minecraft.server.level.ServerPlayer player)
      Starts a cutscene for a player
      Parameters:
      id - The ID of the cutscene to start
      startPos - The starting position for the cutscene
      camRot - The initial camera rotation of the player as a vector of (yaw, pitch, roll)
      pathRot - The path rotation as a vector of (yaw, pitch, roll)
      player - The player to play the cutscene to
      See Also:
    • stopCutscene

      public static void stopCutscene(net.minecraft.server.level.ServerPlayer player, EndingReason reason)
      Stops a cutscene for a player, regardless of whether they were actually watching it or not.
      Parameters:
      player - The player to stop the cutscene for
      reason - The reason why the cutscene is stopped
    • stopCutscene

      public static void stopCutscene(net.minecraft.server.level.ServerPlayer player)
      Stops a cutscene for a player, regardless of whether they were actually watching it or not. Calls stopCutscene(ServerPlayer, EndingReason) with EndingReason.INTERRUPT.
      Parameters:
      player - The player to stop the cutscene for