Class FluidApi
java.lang.Object
earth.terrarium.botarium.common.fluid.FluidApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends FluidContainer & Updatable>
TgetAPIFluidContainer(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.level.block.entity.BlockEntity entity, @Nullable net.minecraft.core.Direction direction) Retrieves the Botarium specific FluidContainer object from a block entity or block.static Map<net.minecraft.world.level.block.entity.BlockEntityType<?>,BotariumFluidBlock<?>> static Map<net.minecraft.world.level.block.Block,BotariumFluidBlock<?>> static BotariumFluidBlock<?>getFluidBlock(net.minecraft.world.level.block.Block block) static BotariumFluidBlock<?>getFluidBlock(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntity) static BotariumFluidItem<?>getFluidItem(net.minecraft.world.item.Item item) static Map<net.minecraft.world.item.Item,BotariumFluidItem<?>> static longmoveFluid(FluidContainer from, FluidContainer to, FluidHolder amount, boolean simulate) Moves energy from one energy container to anotherstatic longmoveFluid(ItemStackHolder from, ItemStackHolder to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to anotherstatic longmoveFluid(ItemStackHolder from, net.minecraft.world.level.block.entity.BlockEntity to, net.minecraft.core.Direction direction, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to anotherstatic longmoveFluid(net.minecraft.world.level.block.entity.BlockEntity from, net.minecraft.core.Direction direction, ItemStackHolder to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to anotherstatic longmoveFluid(net.minecraft.world.level.block.entity.BlockEntity from, net.minecraft.world.level.block.entity.BlockEntity to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to anotherstatic voidregisterFluidBlock(BotariumFluidBlock<?> getter, Supplier<net.minecraft.world.level.block.Block>... blocks) static voidregisterFluidBlock(Supplier<net.minecraft.world.level.block.Block> block, BotariumFluidBlock<?> getter) static voidregisterFluidBlockEntity(BotariumFluidBlock<?> getter, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<?>>... blocks) static voidregisterFluidBlockEntity(Supplier<net.minecraft.world.level.block.entity.BlockEntityType<?>> block, BotariumFluidBlock<?> getter) static voidregisterFluidItem(BotariumFluidItem<?> getter, Supplier<net.minecraft.world.item.Item>... items) static voidregisterFluidItem(Supplier<net.minecraft.world.item.Item> item, BotariumFluidItem<?> getter)
-
Constructor Details
-
FluidApi
public FluidApi()
-
-
Method Details
-
getBlockEntityRegistry
public static Map<net.minecraft.world.level.block.entity.BlockEntityType<?>,BotariumFluidBlock<?>> getBlockEntityRegistry() -
getBlockRegistry
-
getItemRegistry
-
getFluidBlock
-
getFluidBlock
public static BotariumFluidBlock<?> getFluidBlock(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntity) -
getFluidItem
-
getAPIFluidContainer
public static <T extends FluidContainer & Updatable> T getAPIFluidContainer(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity entity, @Nullable @Nullable net.minecraft.core.Direction direction) Retrieves the Botarium specific FluidContainer object from a block entity or block. This method is used internally by the Botarium API and should not be used by other mods.- Type Parameters:
T- the type of FluidContainer- Parameters:
level- the game levelpos- the position of the blockstate- the block stateentity- the block entity (can be null)direction- the direction (can be null)- Returns:
- the API FluidContainer object
-
registerFluidBlockEntity
public static void registerFluidBlockEntity(Supplier<net.minecraft.world.level.block.entity.BlockEntityType<?>> block, BotariumFluidBlock<?> getter) -
registerFluidBlockEntity
@SafeVarargs public static void registerFluidBlockEntity(BotariumFluidBlock<?> getter, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<?>>... blocks) -
registerFluidBlock
public static void registerFluidBlock(Supplier<net.minecraft.world.level.block.Block> block, BotariumFluidBlock<?> getter) -
registerFluidBlock
@SafeVarargs public static void registerFluidBlock(BotariumFluidBlock<?> getter, Supplier<net.minecraft.world.level.block.Block>... blocks) -
registerFluidItem
public static void registerFluidItem(Supplier<net.minecraft.world.item.Item> item, BotariumFluidItem<?> getter) -
registerFluidItem
@SafeVarargs public static void registerFluidItem(BotariumFluidItem<?> getter, Supplier<net.minecraft.world.item.Item>... items) -
moveFluid
public static long moveFluid(FluidContainer from, FluidContainer to, FluidHolder amount, boolean simulate) Moves energy from one energy container to another- Parameters:
from- The energy container to move energy fromto- The energy container to move energy toamount- The amount of energy to move- Returns:
- The amount of energy that was moved
-
moveFluid
public static long moveFluid(ItemStackHolder from, ItemStackHolder to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to another- Parameters:
from- The energy container to move energy fromto- The energy container to move energy tofluidHolder- The fluidHolder to move- Returns:
- The amount of fluid that was moved
-
moveFluid
public static long moveFluid(net.minecraft.world.level.block.entity.BlockEntity from, net.minecraft.world.level.block.entity.BlockEntity to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to another- Parameters:
from- The energy container to move energy fromto- The energy container to move energy tofluidHolder- The amount of energy to move- Returns:
- The amount of energy that was moved
-
moveFluid
public static long moveFluid(net.minecraft.world.level.block.entity.BlockEntity from, net.minecraft.core.Direction direction, ItemStackHolder to, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to another- Parameters:
from- The energy container to move energy fromto- The energy container to move energy tofluidHolder- The amount of energy to move- Returns:
- The amount of energy that was moved
-
moveFluid
public static long moveFluid(ItemStackHolder from, net.minecraft.world.level.block.entity.BlockEntity to, net.minecraft.core.Direction direction, FluidHolder fluidHolder, boolean simulate) Moves energy from one energy container to another- Parameters:
from- The energy container to move energy fromto- The energy container to move energy tofluidHolder- The amount of energy to move- Returns:
- The amount of energy that was moved
-