Class FluidApi

java.lang.Object
earth.terrarium.botarium.common.fluid.FluidApi

public class FluidApi extends Object
  • Constructor Details

    • FluidApi

      public FluidApi()
  • Method Details

    • getBlockEntityRegistry

      public static Map<net.minecraft.world.level.block.entity.BlockEntityType<?>,BotariumFluidBlock<?>> getBlockEntityRegistry()
    • getBlockRegistry

      public static Map<net.minecraft.world.level.block.Block,BotariumFluidBlock<?>> getBlockRegistry()
    • getItemRegistry

      public static Map<net.minecraft.world.item.Item,BotariumFluidItem<?>> getItemRegistry()
    • getFluidBlock

      public static BotariumFluidBlock<?> getFluidBlock(net.minecraft.world.level.block.Block block)
    • getFluidBlock

      public static BotariumFluidBlock<?> getFluidBlock(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntity)
    • getFluidItem

      public static BotariumFluidItem<?> getFluidItem(net.minecraft.world.item.Item item)
    • 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 level
      pos - the position of the block
      state - the block state
      entity - 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 from
      to - The energy container to move energy to
      amount - 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 from
      to - The energy container to move energy to
      fluidHolder - 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 from
      to - The energy container to move energy to
      fluidHolder - The amount of energy to move
      Returns:
      The amount of energy that was moved
    • moveFluid

      public static long moveFluid(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos fromPos, @Nullable @Nullable net.minecraft.core.Direction fromDirection, net.minecraft.core.BlockPos toPos, @Nullable @Nullable net.minecraft.core.Direction toDirection, FluidHolder fluidHolder, boolean simulate)
    • 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 from
      to - The energy container to move energy to
      fluidHolder - 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 from
      to - The energy container to move energy to
      fluidHolder - The amount of energy to move
      Returns:
      The amount of energy that was moved