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

public abstract class CutsceneEffect<T> extends Object
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 Details

    • startTime

      public final double startTime
    • endTime

      public final double endTime
    • config

      protected final T config
  • Constructor Details

    • CutsceneEffect

      public CutsceneEffect(double startTime, double endTime, T config)
      Constructs a new CutsceneEffect.
      Parameters:
      startTime - the starting time, in ticks since the cutscene started
      endTime - the ending time, in ticks since the cutscene started
      config - 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 in
      cutscene - 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

      public abstract CutsceneEffectSerializer<T> getSerializer()
    • toNetwork

      public final void toNetwork(net.minecraft.network.FriendlyByteBuf buf)
    • fromNetwork

      public static CutsceneEffect<?> fromNetwork(net.minecraft.network.FriendlyByteBuf buf)
    • fromJSON

      public static CutsceneEffect<?> fromJSON(com.google.gson.JsonObject json)