Record Class StackPotDecorations

java.lang.Object
java.lang.Record
dev.thomasglasser.sherdsapi.impl.StackPotDecorations
All Implemented Interfaces:
net.minecraft.world.item.component.TooltipProvider

public record StackPotDecorations(Optional<net.minecraft.world.item.ItemStack> back, Optional<net.minecraft.world.item.ItemStack> left, Optional<net.minecraft.world.item.ItemStack> right, Optional<net.minecraft.world.item.ItemStack> front) extends Record implements net.minecraft.world.item.component.TooltipProvider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<StackPotDecorations>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,StackPotDecorations>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StackPotDecorations(Optional<net.minecraft.world.item.ItemStack> back, Optional<net.minecraft.world.item.ItemStack> left, Optional<net.minecraft.world.item.ItemStack> right, Optional<net.minecraft.world.item.ItemStack> front)
    Creates an instance of a StackPotDecorations record class.
    StackPotDecorations(net.minecraft.world.item.ItemStack p_331754_, net.minecraft.world.item.ItemStack p_331488_, net.minecraft.world.item.ItemStack p_331845_, net.minecraft.world.item.ItemStack p_330988_)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToTooltip(net.minecraft.world.item.Item.TooltipContext tooltipContext, Consumer<net.minecraft.network.chat.Component> consumer, net.minecraft.world.item.TooltipFlag tooltipFlag, net.minecraft.core.component.DataComponentGetter dataComponentGetter)
     
    Optional<net.minecraft.world.item.ItemStack>
    Returns the value of the back record component.
    static net.minecraft.world.item.ItemStack
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    Optional<net.minecraft.world.item.ItemStack>
    Returns the value of the front record component.
    final int
    Returns a hash code value for this object.
    Optional<net.minecraft.world.item.ItemStack>
    Returns the value of the left record component.
    List<net.minecraft.world.item.ItemStack>
     
    Optional<net.minecraft.world.item.ItemStack>
    Returns the value of the right record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • CODEC

      public static final com.mojang.serialization.Codec<StackPotDecorations> CODEC
    • STREAM_CODEC

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

    • StackPotDecorations

      public StackPotDecorations(net.minecraft.world.item.ItemStack p_331754_, net.minecraft.world.item.ItemStack p_331488_, net.minecraft.world.item.ItemStack p_331845_, net.minecraft.world.item.ItemStack p_330988_)
    • StackPotDecorations

      public StackPotDecorations(Optional<net.minecraft.world.item.ItemStack> back, Optional<net.minecraft.world.item.ItemStack> left, Optional<net.minecraft.world.item.ItemStack> right, Optional<net.minecraft.world.item.ItemStack> front)
      Creates an instance of a StackPotDecorations record class.
      Parameters:
      back - the value for the back record component
      left - the value for the left record component
      right - the value for the right record component
      front - the value for the front record component
  • Method Details

    • ordered

      public List<net.minecraft.world.item.ItemStack> ordered()
    • createDecoratedPotItem

      public static net.minecraft.world.item.ItemStack createDecoratedPotItem(StackPotDecorations decorations)
    • addToTooltip

      public void addToTooltip(net.minecraft.world.item.Item.TooltipContext tooltipContext, Consumer<net.minecraft.network.chat.Component> consumer, net.minecraft.world.item.TooltipFlag tooltipFlag, net.minecraft.core.component.DataComponentGetter dataComponentGetter)
      Specified by:
      addToTooltip in interface net.minecraft.world.item.component.TooltipProvider
    • 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.
    • back

      public Optional<net.minecraft.world.item.ItemStack> back()
      Returns the value of the back record component.
      Returns:
      the value of the back record component
    • left

      public Optional<net.minecraft.world.item.ItemStack> left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component
    • right

      public Optional<net.minecraft.world.item.ItemStack> right()
      Returns the value of the right record component.
      Returns:
      the value of the right record component
    • front

      public Optional<net.minecraft.world.item.ItemStack> front()
      Returns the value of the front record component.
      Returns:
      the value of the front record component