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 int 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
    • blockCameraRotation

      public final boolean blockCameraRotation
    • 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

    • CutsceneType

      public CutsceneType(PathLike path, Path rotationProvider, int length, Transition start, Transition end, boolean blockMovement, boolean blockCameraRotation, ActionToggles toggles, boolean hideHand, boolean hideBlockOutline, List<CutsceneEffect<?>> effects)
      Constructs a cutscene type with all parameters specified.
    • CutsceneType

      public CutsceneType(PathLike path, Path rotationProvider, int length)
      Constructs a simple cutscene type with default parameters for most settings.
  • 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. By the way, the values on the F3 screen are [y / x] too.
    • 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.