Package hiiragi283.core.api.storage.item
Class HTItemResourceType
-
- All Implemented Interfaces:
-
hiiragi283.core.api.resource.HTIdLike,hiiragi283.core.api.resource.HTKeyLike,hiiragi283.core.api.resource.HTKeyLike.HolderDelegate,hiiragi283.core.api.storage.resource.HTResourceType,hiiragi283.core.api.storage.resource.HTResourceType.DataComponent,hiiragi283.core.api.storage.resource.HTResourceType.Registered,hiiragi283.core.api.text.HTHasText,net.minecraft.core.component.DataComponentHolder,net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension,net.neoforged.neoforge.registries.datamaps.IWithData
@JvmRecord() public final class HTItemResourceType extends Record implements HTResourceType.DataComponent<Item>
アイテム向けのHTResourceType.DataComponentの実装クラスです。
- Since:
0.4.0
Hiiragi Tsubasa
-
-
Field Summary
Fields Modifier and Type Field Description public final static BiCodec<RegistryFriendlyByteBuf, HTItemResourceType>CODECprivate final DataComponentMapcomponents
-
Method Summary
Modifier and Type Method Description final ItemStacktoStack(Integer count)指定したcountからItemStackに変換します。 Booleanequals(Object other)IntegerhashCode()DataComponentPatchcomponentsPatch()このリソースのDataComponentPatchを返します。 Itemtype()ComponentgetText()テキストを取得します。 Holder<Item>getHolder()保持しているHolderを返します。 DataComponentMapgetComponents()final static HTItemResourceTypeofNullable(ItemLike item)指定したitemをHTItemResourceTypeに変換します。 final static HTItemResourceTypeof(ItemLike item)指定したitemをHTItemResourceTypeに変換します。 final static HTItemResourceTypeof(ItemStack stack)指定したstackをHTItemResourceTypeに変換します。 -
Methods inherited from class hiiragi283.core.api.storage.item.HTItemResourceType
getComponents -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceType.Registered
getData, isOf, isOf, isOf, isOf, isOf -
Methods inherited from class hiiragi283.core.api.resource.HTIdLike
getId, getNamespace, getPath -
Methods inherited from class hiiragi283.core.api.resource.HTKeyLike.HolderDelegate
getResourceKey -
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
-
componentsPatch
DataComponentPatch componentsPatch()
このリソースのDataComponentPatchを返します。
-
type
Item type()
-
getText
Component getText()
テキストを取得します。
-
getHolder
Holder<Item> getHolder()
保持しているHolderを返します。
-
getComponents
DataComponentMap getComponents()
-
ofNullable
final static HTItemResourceType ofNullable(ItemLike item)
指定したitemをHTItemResourceTypeに変換します。
- Returns:
ItemStack.isEmptyが
trueの場合はnull
-
of
final static HTItemResourceType of(ItemLike item)
指定したitemをHTItemResourceTypeに変換します。
-
of
final static HTItemResourceType of(ItemStack stack)
指定したstackをHTItemResourceTypeに変換します。
- Returns:
ItemStack.isEmptyが
trueの場合はnull
-
-
-
-