java.lang.Object
org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponent<V,T>
Direct Known Subclasses:
BooleanDataComponent, IntDataComponent, ObjectDataComponent

public abstract class DataComponent<V,T extends DataComponentType<V>> extends Object
  • Field Details

  • Constructor Details

    • DataComponent

      public DataComponent(@NonNull T type)
  • Method Details

    • getValue

      public abstract V getValue()
      May be null depending on type
    • write

      public void write(ItemCodecHelper helper, io.netty.buffer.ByteBuf out)
      Overridden for primitive classes. This write method still checks for these primitives in the event they are manually created using ObjectDataComponent.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getType

      @NonNull public T getType()