Record Class ComponentUpdatePacket

java.lang.Object
java.lang.Record
me.andreasmelone.glowingeyes.neoforge.common.packets.ComponentUpdatePacket
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public record ComponentUpdatePacket(UUID playerUUID, IGlowingEyes capability) extends Record implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComponentUpdatePacket(UUID playerUUID, IGlowingEyes capability)
    Creates an instance of a ComponentUpdatePacket record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the capability record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
    handle(net.neoforged.neoforge.network.handling.PlayPayloadContext context)
     
    final int
    Returns a hash code value for this object.
    @NotNull net.minecraft.resources.ResourceLocation
    id()
     
    Returns the value of the playerUUID record component.
    read(net.minecraft.network.FriendlyByteBuf buffer)
     
    final String
    Returns a string representation of this record class.
    void
    write(net.minecraft.network.FriendlyByteBuf buffer)
     

    Methods inherited from class java.lang.Object

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

    • ID

      public static final net.minecraft.resources.ResourceLocation ID
  • Constructor Details

    • ComponentUpdatePacket

      public ComponentUpdatePacket(UUID playerUUID, IGlowingEyes capability)
      Creates an instance of a ComponentUpdatePacket record class.
      Parameters:
      playerUUID - the value for the playerUUID record component
      capability - the value for the capability record component
  • Method Details

    • read

      public static ComponentUpdatePacket read(net.minecraft.network.FriendlyByteBuf buffer)
    • write

      public void write(net.minecraft.network.FriendlyByteBuf buffer)
      Specified by:
      write in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
    • id

      @NotNull public @NotNull net.minecraft.resources.ResourceLocation id()
      Specified by:
      id in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
    • handle

      public void handle(net.neoforged.neoforge.network.handling.PlayPayloadContext context)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • playerUUID

      public UUID playerUUID()
      Returns the value of the playerUUID record component.
      Returns:
      the value of the playerUUID record component
    • capability

      public IGlowingEyes capability()
      Returns the value of the capability record component.
      Returns:
      the value of the capability record component