Package hiiragi283.core.api.item
Class ItemStackTemplate
-
- All Implemented Interfaces:
-
hiiragi283.core.api.registry.StackTemplate,hiiragi283.core.api.registry.TypedInstance,net.minecraft.core.component.DataComponentHolder,net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension
@JvmRecord() public final class ItemStackTemplate extends Record implements StackTemplate<Item>
-
-
Field Summary
Fields Modifier and Type Field Description public final static MapCodec<ItemStackTemplate>MAP_CODECpublic final static Codec<ItemStackTemplate>CODECpublic final static StreamCodec<RegistryFriendlyByteBuf, ItemStackTemplate>STREAM_CODECprivate final Holder<Item>itemprivate final Integercountprivate final DataComponentPatchcomponentsprivate final DataComponentMapcomponents
-
Constructor Summary
Constructors Constructor Description ItemStackTemplate(Holder<Item> item, Integer count, DataComponentPatch components)ItemStackTemplate(ItemLike item, Integer count, DataComponentPatch components)
-
Method Summary
Modifier and Type Method Description final Holder<Item>getItem()final IntegergetCount()final DataComponentPatchgetComponents()final ItemStackcreate()final ItemStackapply(DataComponentPatch additionalPatch)final ItemStackapply(Integer count, DataComponentPatch additionalPatch)Holder<Item>typeHolder()DataComponentMapgetComponents()final static HTTextResult<ItemStackTemplate>fromStack(ItemStack stack)-
Methods inherited from class hiiragi283.core.api.item.ItemStackTemplate
getComponents -
Methods inherited from class hiiragi283.core.api.registry.TypedInstance
isOf, isOf, isOf, tags -
Methods inherited from class net.minecraft.core.component.DataComponentHolder
get, getOrDefault, has -
Methods inherited from class net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension
addToTooltip, addToTooltip, get, getOrDefault, has -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getItem
final Holder<Item> getItem()
-
getComponents
final DataComponentPatch getComponents()
-
create
final ItemStack create()
-
apply
final ItemStack apply(DataComponentPatch additionalPatch)
-
typeHolder
Holder<Item> typeHolder()
-
getComponents
DataComponentMap getComponents()
-
fromStack
final static HTTextResult<ItemStackTemplate> fromStack(ItemStack stack)
-
-
-
-