Record Class CutscenePayload

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.internal.cutscene.CutscenePayload
Record Components:
id - the cutscene to play (the name the client reports back when it ends), or empty to stop
cutscene - the cutscene itself, when the client isn't expected to have it registered
origin - where its positions are measured from, in place of its own anchor
yaw - with an origin: the turn of its space around the vertical
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public record CutscenePayload(Optional<net.minecraft.resources.Identifier> id, Optional<Cutscene> cutscene, Optional<net.minecraft.world.phys.Vec3> origin, float yaw) extends Record implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
The server telling a client to play a cutscene, or to stop the one playing.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B,T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, CutscenePayload>
     
    static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CutscenePayload>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CutscenePayload(Optional<net.minecraft.resources.Identifier> id, Optional<Cutscene> cutscene, Optional<net.minecraft.world.phys.Vec3> origin, float yaw)
    Creates an instance of a CutscenePayload record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the cutscene record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Optional<net.minecraft.resources.Identifier>
    id()
    Returns the value of the id record component.
    Optional<net.minecraft.world.phys.Vec3>
    Returns the value of the origin record component.
     
    final String
    Returns a string representation of this record class.
    net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
     
    float
    yaw()
    Returns the value of the yaw record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TYPE

      public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CutscenePayload> TYPE
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, CutscenePayload> STREAM_CODEC
  • Constructor Details

    • CutscenePayload

      public CutscenePayload(Optional<net.minecraft.resources.Identifier> id, Optional<Cutscene> cutscene, Optional<net.minecraft.world.phys.Vec3> origin, float yaw)
      Creates an instance of a CutscenePayload record class.
      Parameters:
      id - the value for the id record component
      cutscene - the value for the cutscene record component
      origin - the value for the origin record component
      yaw - the value for the yaw record component
  • Method Details

    • stop

      public static CutscenePayload stop()
    • type

      public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()
      Specified by:
      type in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public Optional<net.minecraft.resources.Identifier> id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • cutscene

      public Optional<Cutscene> cutscene()
      Returns the value of the cutscene record component.
      Returns:
      the value of the cutscene record component
    • origin

      public Optional<net.minecraft.world.phys.Vec3> origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • yaw

      public float yaw()
      Returns the value of the yaw record component.
      Returns:
      the value of the yaw record component