Package net.thewinnt.cutscenes.effect
Class CutsceneEffect<T>
java.lang.Object
net.thewinnt.cutscenes.effect.CutsceneEffect<T>
- Type Parameters:
T- The class for this effect's configuration
- Direct Known Subclasses:
AbstractOverlayEffect
A CutsceneEffect does all the visuals not related to the camera during a cutscene. It can be an overlay,
or an operation in the world, or something else entirely.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCutsceneEffect(double startTime, double endTime, T config) Constructs a newCutsceneEffect. -
Method Summary
Modifier and TypeMethodDescriptionstatic CutsceneEffect<?> fromJSON(com.google.gson.JsonObject json) static CutsceneEffect<?> fromNetwork(net.minecraft.network.FriendlyByteBuf buf) abstract CutsceneEffectSerializer<T> abstract voidonEnd(net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called after the last tick of the effectabstract voidonFrame(double time, net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called every frame that the cutscene is renderedabstract voidonStart(net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called before the first tick of the effectfinal voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
startTime
public final double startTime -
endTime
public final double endTime -
config
-
-
Constructor Details
-
CutsceneEffect
Constructs a newCutsceneEffect.- Parameters:
startTime- the starting time, in ticks since the cutscene startedendTime- the ending time, in ticks since the cutscene startedconfig- a config object that a superclass uses to display the effect
-
-
Method Details
-
onStart
public abstract void onStart(net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called before the first tick of the effect- Parameters:
cutscene- the cutscene type that this effect is used from
-
onFrame
public abstract void onFrame(double time, net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called every frame that the cutscene is rendered- Parameters:
time- the time in ticks since the effect started, in range [0; endTime - startTime]level- the client level that the effect is running incutscene- the cutscene type that this effect is used from
-
onEnd
public abstract void onEnd(net.minecraft.client.multiplayer.ClientLevel level, CutsceneType cutscene) Called after the last tick of the effect- Parameters:
cutscene- the cutscene type that this effect is used from
-
getSerializer
-
toNetwork
public final void toNetwork(net.minecraft.network.FriendlyByteBuf buf) -
fromNetwork
-
fromJSON
-