Class CutsceneAttachment

java.lang.Object
de.luckymcdev.foundryengine.common.cutscene.model.CutsceneAttachment
Direct Known Subclasses:
CommandAttachment, EffectAttachment

public abstract class CutsceneAttachment extends Object
Base class for all cutscene attachments. Attachments are timeline-based objects that can be attached to a cutscene at a specific normalized time position (0..1).

This system makes it easy to add new attachment types in the future by simply extending this class and implementing the required methods.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected float
    Normalized time (0..1) along the cutscene playback where this attachment triggers.
    protected String
    A human-readable name/type identifier for this attachment.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CutsceneAttachment(float at, String type)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a copy of this attachment.
    float
     
    abstract String
    Returns a display name for this attachment (for UI).
    abstract float
    Returns the total normalized duration of this attachment (0..1), or 0 if it's instantaneous.
     
    void
    setAt(float at)
     
    net.minecraft.nbt.CompoundTag
    Serializes this attachment to NBT for saving.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • at

      protected float at
      Normalized time (0..1) along the cutscene playback where this attachment triggers.
    • type

      protected String type
      A human-readable name/type identifier for this attachment. Used for serialization and UI display.
  • Constructor Details

    • CutsceneAttachment

      protected CutsceneAttachment(float at, String type)
  • Method Details

    • getAt

      public float getAt()
    • setAt

      public void setAt(float at)
    • getType

      public String getType()
    • toNbt

      public net.minecraft.nbt.CompoundTag toNbt()
      Serializes this attachment to NBT for saving. Subclasses should override this to add their specific data.
    • copy

      public abstract CutsceneAttachment copy()
      Creates a copy of this attachment. Subclasses must implement this properly.
    • getDisplayName

      public abstract String getDisplayName()
      Returns a display name for this attachment (for UI).
    • getDuration

      public abstract float getDuration()
      Returns the total normalized duration of this attachment (0..1), or 0 if it's instantaneous.