Package hiiragi283.lib.item.alchemy
Object HTPotionHelper
-
- All Implemented Interfaces:
public class HTPotionHelper- Since:
0.3.0
Hiiragi Tsubasa
-
-
Field Summary
Fields Modifier and Type Field Description public final static HTPotionHelperINSTANCE
-
Method Summary
Modifier and Type Method Description final static PotionContentsgetPotion(DataComponentGetter getter)指定したgetterからPotionContentsを取得します。 final static UnitsetPotion(MutableDataComponentHolder holder, PotionContents contents)final static StringgetPotionModId(DataComponentGetter getter)指定したgetterからポーションのMod IDを取得します。 final static Either<ErrorText, ItemStackTemplate>createPotion(BottledPotionContents contents)指定したcontentsからポーションのItemStackを作成します。 final static Either<ErrorText, ItemStackTemplate>createPotion(ItemLike item, Holder<Potion> potion, Integer count)指定した引数からポーションのItemStackを作成します。 final static Either<ErrorText, ItemStackTemplate>createPotion(ItemLike item, PotionContents contents, Integer count)指定した引数からポーションのItemStackを作成します。 final static <T extends TypedInstance<Item>, DataComponentGetter> BottledPotionContentsgetContentsFromItem(T instance)指定したinstanceからBottledPotionContentsを取得します。 final static <T extends TypedInstance<Fluid>, DataComponentGetter> BottledPotionContentsgetContentsFromFluid(T instance)指定したinstanceからBottledPotionContentsを取得します。 final static <T extends TypedInstance<Item>, DataComponentGetter> BottledPotionContentsgetContentsFromBottle(T instance)指定したinstanceからBottledPotionContentsを取得します。 final static DataComponentPatchcreateItemPatch(BottledPotionContents contents)final static <T extends TypedInstance<Fluid>, DataComponentGetter> DataComponentPatchcreateFluidPatch(T instance, BottledPotionContents contents)final static DataComponentPatchcreateFluidPatch(Fluid fluid, BottledPotionContents contents)-
-
Method Detail
-
getPotion
final static PotionContents getPotion(DataComponentGetter getter)
指定したgetterからPotionContentsを取得します。
- Returns:
値を保持していない場合はPotionContents.EMPTY
- Since:
0.10.0
-
setPotion
final static Unit setPotion(MutableDataComponentHolder holder, PotionContents contents)
- Since:
0.14.0
-
getPotionModId
final static String getPotionModId(DataComponentGetter getter)
指定したgetterからポーションのMod IDを取得します。
- Since:
0.11.0
-
createPotion
final static Either<ErrorText, ItemStackTemplate> createPotion(BottledPotionContents contents)
指定したcontentsからポーションのItemStackを作成します。
- Since:
0.11.0
-
createPotion
final static Either<ErrorText, ItemStackTemplate> createPotion(ItemLike item, Holder<Potion> potion, Integer count)
指定した引数からポーションのItemStackを作成します。
- Parameters:
item- アイテムの種類potion- ポーションの中身count- ItemStackの個数
-
createPotion
final static Either<ErrorText, ItemStackTemplate> createPotion(ItemLike item, PotionContents contents, Integer count)
指定した引数からポーションのItemStackを作成します。
- Parameters:
item- アイテムの種類contents- ポーションの中身count- ItemStackの個数
-
getContentsFromItem
final static <T extends TypedInstance<Item>, DataComponentGetter> BottledPotionContents getContentsFromItem(T instance)
指定したinstanceからBottledPotionContentsを取得します。
- Returns:
BottledPotionContentsを取得できない場合は
null- Since:
0.14.0
-
getContentsFromFluid
final static <T extends TypedInstance<Fluid>, DataComponentGetter> BottledPotionContents getContentsFromFluid(T instance)
指定したinstanceからBottledPotionContentsを取得します。
- Returns:
BottledPotionContentsを取得できない場合は
null- Since:
0.14.0
-
getContentsFromBottle
final static <T extends TypedInstance<Item>, DataComponentGetter> BottledPotionContents getContentsFromBottle(T instance)
指定したinstanceからBottledPotionContentsを取得します。
- Returns:
BottledPotionContentsを取得できない場合は
null- Since:
0.14.0
-
createItemPatch
final static DataComponentPatch createItemPatch(BottledPotionContents contents)
-
createFluidPatch
final static <T extends TypedInstance<Fluid>, DataComponentGetter> DataComponentPatch createFluidPatch(T instance, BottledPotionContents contents)
-
createFluidPatch
final static DataComponentPatch createFluidPatch(Fluid fluid, BottledPotionContents contents)
-
-
-
-