Package hiiragi283.core.common.data.tank
Class HTSimpleTankInteraction
-
- All Implemented Interfaces:
-
hiiragi283.core.api.data.tank.HTTankInteraction,hiiragi283.core.api.data.tank.HTTankInteraction.Emptying,hiiragi283.core.api.data.tank.HTTankInteraction.Filling,hiiragi283.core.api.data.tank.HTTankInteraction.Serializable
public final class HTSimpleTankInteraction implements HTTankInteraction.Serializable, HTTankInteraction.Emptying, HTTankInteraction.Filling
-
-
Field Summary
Fields Modifier and Type Field Description public final static MapCodec<HTSimpleTankInteraction>CODECprivate final HTItemHolderLike<Item>emptyContainerprivate final HTItemHolderLike<Item>filledContainerprivate final HTFluidHolderLike<Fluid>fluidprivate final Integeramountprivate final Optional<TagKey<Fluid>>fluidTag
-
Constructor Summary
Constructors Constructor Description HTSimpleTankInteraction(HTItemHolderLike<Item> emptyContainer, HTItemHolderLike<Item> filledContainer, HTFluidHolderLike<Fluid> fluid, Integer amount, Optional<TagKey<Fluid>> fluidTag)
-
Method Summary
Modifier and Type Method Description final HTItemHolderLike<Item>getEmptyContainer()final HTItemHolderLike<Item>getFilledContainer()final HTFluidHolderLike<Fluid>getFluid()IntegergetAmount()final Optional<TagKey<Fluid>>getFluidTag()Pair<ItemStack, FluidStack>emptyContainer(HTItemResourceType container)指定した容器から液体を取り出します。 MapCodec<HTSimpleTankInteraction>type()BooleancanEmptyContainer(HTItemResourceType container)指定した容器から液体を搬出できるか判定します。 BooleancanFillContainer(HTItemResourceType container, HTFluidResourceType fluidStack)指定した容器に液体を搬入できるか判定します。 ItemStackfillContainer(HTItemResourceType container, HTFluidResourceType fluidStack)指定した容器に液体を搬入します。 -
-
Constructor Detail
-
HTSimpleTankInteraction
HTSimpleTankInteraction(HTItemHolderLike<Item> emptyContainer, HTItemHolderLike<Item> filledContainer, HTFluidHolderLike<Fluid> fluid, Integer amount, Optional<TagKey<Fluid>> fluidTag)
-
-
Method Detail
-
getEmptyContainer
final HTItemHolderLike<Item> getEmptyContainer()
-
getFilledContainer
final HTItemHolderLike<Item> getFilledContainer()
-
getFluid
final HTFluidHolderLike<Fluid> getFluid()
-
getFluidTag
final Optional<TagKey<Fluid>> getFluidTag()
-
emptyContainer
Pair<ItemStack, FluidStack> emptyContainer(HTItemResourceType container)
指定した容器から液体を取り出します。
- Returns:
空の容器と保持していた液体
-
type
MapCodec<HTSimpleTankInteraction> type()
-
canEmptyContainer
Boolean canEmptyContainer(HTItemResourceType container)
指定した容器から液体を搬出できるか判定します。
- Returns:
搬出できる場合は
true
-
canFillContainer
Boolean canFillContainer(HTItemResourceType container, HTFluidResourceType fluidStack)
- Returns:
搬入できる場合は
true
-
fillContainer
ItemStack fillContainer(HTItemResourceType container, HTFluidResourceType fluidStack)
- Returns:
液体入りの容器
-
-
-
-