Package net.thewinnt.cutscenes.rotation
Interface RotationHandler
- All Known Implementing Classes:
AddToCutsceneRotation,CutsceneRotation,EaseBackRotation,PlayerRotation
public interface RotationHandler
Defines how to handle the player's rotation.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.Vec3apply(net.minecraft.world.phys.Vec3 initCamRot, net.minecraft.world.phys.Vec3 startRot, net.minecraft.world.phys.Vec3 playerRot, net.minecraft.world.phys.Vec3 cutsceneRot, double dt) Applies the rotation transform.static RotationHandlerfromJson(com.google.gson.JsonElement json) static RotationHandlerfromNetwork(net.minecraft.network.FriendlyByteBuf buf) Returns a serializer suitable for this rotation handlerstatic <T extends RotationHandler>
voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf, T handler)
-
Field Details
-
UNKNOWN
static final net.minecraft.resources.ResourceLocation UNKNOWN
-
-
Method Details
-
apply
net.minecraft.world.phys.Vec3 apply(net.minecraft.world.phys.Vec3 initCamRot, net.minecraft.world.phys.Vec3 startRot, net.minecraft.world.phys.Vec3 playerRot, net.minecraft.world.phys.Vec3 cutsceneRot, double dt) Applies the rotation transform. There is at most one rotation handler ticked at any point in time, so you can freely store data in your instances.- Parameters:
initCamRot- the initial player rotation, right before the cutscene startedstartRot- the start rotation of the cutscene, aka the third argument inCutsceneManager#startCutsceneplayerRot- the current player rotation (as if the cutscene never began)cutsceneRot- the rotation value output by the cutscene, relative to zerodt- the time difference since last call of this method, in seconds. Always less than or equal to zero on the first call to this during a cutscene.- Returns:
- the camera rotation that the player will ultimately see
-
serializer
RotationSerializer<?> serializer()Returns a serializer suitable for this rotation handler- Returns:
- a serializer that can be used with this rotation handler
-
toNetwork
static <T extends RotationHandler> void toNetwork(net.minecraft.network.FriendlyByteBuf buf, T handler) -
fromNetwork
-
fromJson
-