Record Class SingleStackContainer
java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.io.SingleStackContainer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SingleStackContainer> static final List<SingleStackContainer> -
Constructor Summary
ConstructorsConstructorDescriptionSingleStackContainer(Optional<net.minecraft.world.item.ItemStackTemplate> stackDoNotUse) Creates an instance of aSingleStackContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackcreate()static SingleStackContainerempty()final booleanIndicates whether some other object is "equal to" this one.static SingleStackContainerfrom(net.minecraft.core.Holder<net.minecraft.world.item.Item> itemHolder) static SingleStackContainerfrom(net.minecraft.world.item.Item item) static SingleStackContainerfrom(net.minecraft.world.item.ItemStack itemStack) static SingleStackContainerfrom(net.minecraft.world.item.ItemStackTemplate template) static List<SingleStackContainer> fromItemStackList(List<net.minecraft.world.item.ItemStack> list) final inthashCode()Returns a hash code value for this object.booleanisEmpty()Optional<net.minecraft.world.item.ItemStackTemplate> Returns the value of thestackDoNotUserecord component.static List<net.minecraft.world.item.ItemStack> final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
EMPTY_LIST
-
-
Constructor Details
-
SingleStackContainer
Creates an instance of aSingleStackContainerrecord class.- Parameters:
stackDoNotUse- the value for thestackDoNotUserecord component
-
-
Method Details
-
from
-
from
-
from
public static SingleStackContainer from(net.minecraft.core.Holder<net.minecraft.world.item.Item> itemHolder) -
from
-
toItemStackList
public static List<net.minecraft.world.item.ItemStack> toItemStackList(List<SingleStackContainer> list) -
fromItemStackList
public static List<SingleStackContainer> fromItemStackList(List<net.minecraft.world.item.ItemStack> list) -
create
public net.minecraft.world.item.ItemStack create() -
empty
-
isEmpty
public boolean isEmpty() -
toString
-
hashCode
-
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). -
stackDoNotUse
Returns the value of thestackDoNotUserecord component.- Returns:
- the value of the
stackDoNotUserecord component
-