Class CutsceneType

java.lang.Object
net.thewinnt.cutscenes.CutsceneType

public class CutsceneType extends Object
A cutscene type consists of a camera path, rotation, transitions and some parameters. A cutscene has a fixed length, and it can choose to let the player move their body and/or camera and hide their hand and block outlines. When a cutscene is run, it's given a starting position and a starting camera rotation. The cutscene's path can be rotated by some amount.
  • Field Details

    • length

      public final CutsceneLength length
    • path

      @Nullable public final @Nullable Path path
    • rotationProvider

      @Nullable public final @Nullable Path rotationProvider
    • startTransition

      public final Transition startTransition
    • endTransition

      public final Transition endTransition
    • blockMovement

      public final boolean blockMovement
    • rotationHandler

      public final RotationHandler rotationHandler
    • actionToggles

      public final ActionToggles actionToggles
    • hideHand

      public final boolean hideHand
    • hideBlockOutline

      public final boolean hideBlockOutline
    • disableF5

      public final boolean disableF5
    • effects

      public final List<CutsceneEffect<?>> effects
  • Constructor Details

  • Method Details

    • getPathPoint

      @Nullable public @Nullable net.minecraft.world.phys.Vec3 getPathPoint(double point, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Returns a point for this cutscene's camera path at the specified progress value, if there is a path.
      Parameters:
      point - the progress of this cutscene, in range [0, 1].
      level - the level where the cutscene is run
      cutsceneStart - the cutscene's starting position
      Returns:
      a point for the given progress, or null if there's no path
    • getRotationAt

      @Nullable public @Nullable net.minecraft.world.phys.Vec3 getRotationAt(double point, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Returns a point for this cutscene's camera rotation at the specified progress value, if there is any rotation.
      Parameters:
      point - the progress of this cutscene, in range [0, 1].
      level - the level where the cutscene is run
      cutsceneStart - the cutscene's starting position
      Returns:
      a point for the given progress, or null if there's no path. The returned point's coordinates are [yaw, pitch, roll], matching Minecraft's [y, x, z] coordinates respectively.
    • getTransformedRotation

      public net.minecraft.world.phys.Vec3 getTransformedRotation(double point, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart, net.minecraft.world.phys.Vec3 initCamRot, net.minecraft.world.phys.Vec3 startRot, net.minecraft.world.phys.Vec3 playerRot, double dt)
      Returns a point for this cutscene's camera rotation at given progress value, transformed by the rotation handler.
      Parameters:
      point - the progress value, in range [0, 1]
      level - the world where the cutscene is run
      cutsceneStart - the cutscene's starting position
      initCamRot - the player's camera rotation before the cutscene began
      startRot - the starting rotation of the cutscene
      playerRot - the player's current rotation
      dt - the time since last call, in seconds
      Returns:
      a point for the given progress, in format [yaw, pitch, roll] (aka minecraft [y, x, z]).
    • toNetwork

      public void toNetwork(net.minecraft.network.FriendlyByteBuf buf)
      Serializes this cutscene type to network, to fully reconstruct it later on the client side.
    • fromNetwork

      public static CutsceneType fromNetwork(net.minecraft.network.FriendlyByteBuf buf)
      Reads a cutscene type from network.
    • fromJSON

      public static CutsceneType fromJSON(com.google.gson.JsonObject json)
      Reads a cutscene type from JSON.