Package net.thewinnt.cutscenes
Class CutsceneManager
java.lang.Object
net.thewinnt.cutscenes.CutsceneManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CutsceneTypeAscends you 25 blocks up with a little twiststatic final net.minecraft.resources.ResourceLocationstatic final PathLike.SegmentSerializer<BezierCurve> A cubic or quadratic Bézier curve, depending on the points supplied.static final PathLike.SegmentSerializer<CalculatedPoint> A segment getting its coordinates from easings.static final PathLike.SegmentSerializer<CatmullRomSpline> A Catmull-Rom spline, made of 2 or more points.static final CutsceneTypeA path consisting of a Catmull-Rom spline with a lot of random pointsstatic final net.minecraft.resources.ResourceLocationstatic final PathLike.SegmentSerializer<ConstantPoint> A segment always returning a single point.static final CutsceneTypeA cool path made of continuous Bézier curves, also features rotation changesstatic final net.minecraft.resources.ResourceLocationstatic final Transition.TransitionSerializer<FadeToColorTransition> Fades the screen to a color (or several colors that may change too)static final CutsceneTypeA horizontal line going 12 blocks towards +Xstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.world.phys.Vec3Pass this as a camera rotation tostartCutscene(ResourceLocation, Vec3, Vec3, Vec3, ServerPlayer)and it will make the start camera rotation equal to the current rotation.static final PathLike.SegmentSerializer<LineSegment> A line, consisting of 2 point, interpolated between each other with some easings.static final PathLike.SegmentSerializer<LookAtPoint> A segment returning a look direction so that the player is looking at the specified point.static final CutsceneTypeA path that combines some Bézier curve configurationsstatic final net.minecraft.resources.ResourceLocationstatic final Transition.TransitionSerializer<NoopTransition> Does nothing.static final PathLike.SegmentSerializer<Path> A segment made of other segments.static final PathLike.SegmentSerializer<PathTransition> A transition between two segments - the one before and the one after this.static net.minecraft.world.phys.Vec3The start position of the previewstatic floatThe y rotation of the preview pathstatic floatThe z rotation of the preview pathstatic floatThe x rotation of the preview pathstatic final com.google.common.collect.BiMap<net.minecraft.resources.ResourceLocation, CutsceneType> The cutscene registry, where all cutscenes are stored.static final Transition.TransitionSerializer<SmoothEaseTransition> Smoothly transitions your camera from the starting point to the current point you should be at.static final PointProvider.PointSerializer<StaticPointProvider> A simple point.static final PointProvider.PointSerializer<WaypointProvider> A point that finds a waypoint entity with a specified name, and returns its position (maybe offset too).static final PointProvider.PointSerializer<WorldPointProvider> A point type that is specified in world coordinates -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.joml.Vector3fReturns the starting position of the current cutscene preview, or [0, 100, 0] if there isn't onestatic @Nullable PointProvider.PointSerializer<?> getPointType(net.minecraft.resources.ResourceLocation id) Returns the point serializer with this ID, ornullif it doesn't existstatic net.minecraft.resources.ResourceLocationReturns the ID of the specified point type, ornullif it's not registeredstatic CutsceneTypeSelf-explanatorystatic PathLike.SegmentSerializer<?> getSegmentType(net.minecraft.resources.ResourceLocation id) Returns the segment serializer with this ID, ornullif it doesn't existstatic net.minecraft.resources.ResourceLocationReturns the ID of the specified serializer, ornullif it's not registeredstatic @Nullable Transition.TransitionSerializer<?> getTransitionType(net.minecraft.resources.ResourceLocation id) Returns the transition serializer with this ID, ornullif it doesn't existstatic @Nullable net.minecraft.resources.ResourceLocationReturns the ID of the specified transition type, ornullif it's not registeredstatic CutsceneTyperegisterCutscene(net.minecraft.resources.ResourceLocation id, @NotNull CutsceneType type) Registers a cutscene typestatic voidregisterPointType(net.minecraft.resources.ResourceLocation id, PointProvider.PointSerializer<?> type) Registers a point serializerstatic voidregisterSegmentType(net.minecraft.resources.ResourceLocation id, PathLike.SegmentSerializer<?> type) Registers a segment serializerstatic voidregisterTransitionType(net.minecraft.resources.ResourceLocation id, Transition.TransitionSerializer<?> type) Registers a transition serializerstatic voidsetPreviewedCutscene(CutsceneType type, net.minecraft.world.phys.Vec3 offset, float pathYaw, float pathPitch, float pathRoll) Sets the currently previewed cutscene and tells the clientsstatic voidstartCutscene(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 playerstatic voidstopCutscene(net.minecraft.server.level.ServerPlayer player) Stops a cutscene for a player, regardless of whether they were actually watching it or not.
-
Field Details
-
REGISTRY
public static final com.google.common.collect.BiMap<net.minecraft.resources.ResourceLocation,CutsceneType> REGISTRYThe cutscene registry, where all cutscenes are stored. Only read from this, please -
previewOffset
public static net.minecraft.world.phys.Vec3 previewOffsetThe start position of the preview -
previewPathYaw
public static float previewPathYawThe x rotation of the preview path -
previewPathPitch
public static float previewPathPitchThe y rotation of the preview path -
previewPathRoll
public static float previewPathRollThe z rotation of the preview path -
ASCEND_ID
public static final net.minecraft.resources.ResourceLocation ASCEND_ID -
COOL_PATH_ID
public static final net.minecraft.resources.ResourceLocation COOL_PATH_ID -
MULTI_TYPE_ID
public static final net.minecraft.resources.ResourceLocation MULTI_TYPE_ID -
HORIZONTAL_LINE_ID
public static final net.minecraft.resources.ResourceLocation HORIZONTAL_LINE_ID -
CATMULL_ROM_TEST_ID
public static final net.minecraft.resources.ResourceLocation CATMULL_ROM_TEST_ID -
ASCEND
Ascends you 25 blocks up with a little twist -
COOL_PATH
A cool path made of continuous Bézier curves, also features rotation changes -
MULTI_TYPE
A path that combines some Bézier curve configurations -
HORIZONTAL_LINE
A horizontal line going 12 blocks towards +X -
CATMULL_ROM_TEST
A path consisting of a Catmull-Rom spline with a lot of random points -
LINE
A line, consisting of 2 point, interpolated between each other with some easings. -
BEZIER
A cubic or quadratic Bézier curve, depending on the points supplied. -
CATMULL_ROM
A Catmull-Rom spline, made of 2 or more points. -
PATH
A segment made of other segments. -
CONSTANT
A segment always returning a single point. -
LOOK_AT_POINT
A segment returning a look direction so that the player is looking at the specified point. -
PATH_TRANSITION
A transition between two segments - the one before and the one after this. -
CALCULATED_POINT
A segment getting its coordinates from easings. -
STATIC
A simple point. Can be inlined as an array of 3 points. -
WAYPOINT
A point that finds a waypoint entity with a specified name, and returns its position (maybe offset too). -
WORLD
A point type that is specified in world coordinates -
NO_OP
Does nothing. -
SMOOTH_EASE
Smoothly transitions your camera from the starting point to the current point you should be at. -
FADE
Fades the screen to a color (or several colors that may change too) -
KEEP_ROTATION
public static final net.minecraft.world.phys.Vec3 KEEP_ROTATIONPass this as a camera rotation tostartCutscene(ResourceLocation, Vec3, Vec3, Vec3, ServerPlayer)and it will make the start camera rotation equal to the current rotation.
-
-
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 commandstype- 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 datapackstype- 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 datapackstype- 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 datapackstype- The serializer to register
-
getSegmentTypeId
public static net.minecraft.resources.ResourceLocation getSegmentTypeId(PathLike.SegmentSerializer<?> type) Returns the ID of the specified serializer, ornullif it's not registered -
getSegmentType
public static PathLike.SegmentSerializer<?> getSegmentType(net.minecraft.resources.ResourceLocation id) Returns the segment serializer with this ID, ornullif it doesn't exist -
getPointTypeId
public static net.minecraft.resources.ResourceLocation getPointTypeId(PointProvider.PointSerializer<?> type) Returns the ID of the specified point type, ornullif it's not registered -
getPointType
@Nullable public static @Nullable PointProvider.PointSerializer<?> getPointType(net.minecraft.resources.ResourceLocation id) Returns the point serializer with this ID, ornullif 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, ornullif it's not registered -
getTransitionType
@Nullable public static @Nullable Transition.TransitionSerializer<?> getTransitionType(net.minecraft.resources.ResourceLocation id) Returns the transition serializer with this ID, ornullif 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
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 startstartPos- The starting position for the cutscenecamRot- 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
-
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.- Parameters:
player- The player to stop the cutscene for
-