Package net.thewinnt.cutscenes
Class CutsceneType
java.lang.Object
net.thewinnt.cutscenes.CutsceneType
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 Summary
FieldsModifier and TypeFieldDescriptionfinal ActionTogglesfinal booleanfinal booleanfinal booleanfinal List<CutsceneEffect<?>> final Transitionfinal booleanfinal booleanfinal intfinal @Nullable Pathfinal @Nullable Pathfinal Transition -
Constructor Summary
ConstructorsConstructorDescriptionCutsceneType(PathLike path, Path rotationProvider, int length) Constructs a simple cutscene type with default parameters for most settings.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. -
Method Summary
Modifier and TypeMethodDescriptionstatic CutsceneTypefromJSON(com.google.gson.JsonObject json) Reads a cutscene type from JSON.static CutsceneTypefromNetwork(net.minecraft.network.FriendlyByteBuf buf) Reads a cutscene type from network.@Nullable net.minecraft.world.phys.Vec3getPathPoint(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.@Nullable net.minecraft.world.phys.Vec3getRotationAt(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.voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf) Serializes this cutscene type to network, to fully reconstruct it later on the client side.
-
Field Details
-
length
public final int length -
path
-
rotationProvider
-
startTransition
-
endTransition
-
blockMovement
public final boolean blockMovement -
blockCameraRotation
public final boolean blockCameraRotation -
actionToggles
-
hideHand
public final boolean hideHand -
hideBlockOutline
public final boolean hideBlockOutline -
disableF5
public final boolean disableF5 -
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
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 runcutsceneStart- the cutscene's starting position- Returns:
- a point for the given progress, or
nullif 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 runcutsceneStart- the cutscene's starting position- Returns:
- a point for the given progress, or
nullif 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
Reads a cutscene type from network. -
fromJSON
Reads a cutscene type from JSON.
-