Package dev.thomasglasser.sherdsapi.impl
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<StackPotDecorations> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, StackPotDecorations> -
Constructor Summary
ConstructorsConstructorDescriptionStackPotDecorations(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 aStackPotDecorationsrecord 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 TypeMethodDescriptionvoidaddToTooltip(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> back()Returns the value of thebackrecord component.static net.minecraft.world.item.ItemStackcreateDecoratedPotItem(StackPotDecorations decorations) final booleanIndicates whether some other object is "equal to" this one.Optional<net.minecraft.world.item.ItemStack> front()Returns the value of thefrontrecord component.final inthashCode()Returns a hash code value for this object.Optional<net.minecraft.world.item.ItemStack> left()Returns the value of theleftrecord component.List<net.minecraft.world.item.ItemStack> ordered()Optional<net.minecraft.world.item.ItemStack> right()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
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 aStackPotDecorationsrecord class.- Parameters:
back- the value for thebackrecord componentleft- the value for theleftrecord componentright- the value for therightrecord componentfront- the value for thefrontrecord component
-
-
Method Details
-
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:
addToTooltipin interfacenet.minecraft.world.item.component.TooltipProvider
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
back
Returns the value of thebackrecord component.- Returns:
- the value of the
backrecord component
-
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
front
Returns the value of thefrontrecord component.- Returns:
- the value of the
frontrecord component
-