Class FluidMixerBlockEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
All Implemented Interfaces:
IGUIButtonSensitive, ILuaMethodProvider, IMinWorkingPressure, IRedstoneControl<FluidMixerBlockEntity>, ISerializableTanks, IDescSynced, IUpgradeHolder, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class FluidMixerBlockEntity extends AbstractAirHandlingBlockEntity implements IMinWorkingPressure, IRedstoneControl<FluidMixerBlockEntity>, net.minecraft.world.MenuProvider, ISerializableTanks
  • Field Details

    • craftingProgress

      public int craftingProgress
    • maxProgress

      public int maxProgress
    • didWork

      public boolean didWork
  • Constructor Details

    • FluidMixerBlockEntity

      public FluidMixerBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • tickCommonPre

      public void tickCommonPre()
      Description copied from class: AbstractTickingBlockEntity
      Called on both server and client, before anything else
      Overrides:
      tickCommonPre in class AbstractAirHandlingBlockEntity
    • tickClient

      public void tickClient()
      Overrides:
      tickClient in class AbstractTickingBlockEntity
    • tickServer

      public void tickServer()
      Overrides:
      tickServer in class AbstractTickingBlockEntity
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveAdditional in class AbstractAirHandlingBlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class AbstractAirHandlingBlockEntity
    • getCurrentRecipeIdSynced

      public String getCurrentRecipeIdSynced()
      Description copied from class: AbstractPneumaticCraftBlockEntity
      For machines which use recipes, get the synced recipe ID client-side for informational purposes
      Overrides:
      getCurrentRecipeIdSynced in class AbstractPneumaticCraftBlockEntity
      Returns:
      the recipe id (in string form), or the empty string if no current recipe or not applicable
    • hasOutputSpace

      public boolean hasOutputSpace()
    • getPrimaryInventory

      public net.minecraftforge.items.IItemHandler getPrimaryInventory()
      Specified by:
      getPrimaryInventory in class AbstractPneumaticCraftBlockEntity
    • getInventoryCap

      @Nonnull protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap(net.minecraft.core.Direction side)
      Overrides:
      getInventoryCap in class AbstractPneumaticCraftBlockEntity
    • getFluidCap

      @NotNull public @NotNull net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> getFluidCap(net.minecraft.core.Direction side)
      Overrides:
      getFluidCap in class AbstractPneumaticCraftBlockEntity
    • canConnectPneumatic

      public boolean canConnectPneumatic(net.minecraft.core.Direction side)
      Description copied from class: AbstractAirHandlingBlockEntity
      Checks if the given side of this BE can be pneumatically connected to.
      Overrides:
      canConnectPneumatic in class AbstractAirHandlingBlockEntity
      Parameters:
      side - the side to check
      Returns:
      true if connected, false otherwise
    • clearCachedFluids

      public static void clearCachedFluids()
    • cacheRecipeFluids

      public static void cacheRecipeFluids(List<FluidMixerRecipe> values)
    • isFluidAccepted

      public static boolean isFluidAccepted(net.minecraft.world.level.material.Fluid fluid)
      Is this fluid in any of the fluid mixer's recipe ingredients?
      Parameters:
      fluid - the fluid to test
      Returns:
      true if the fluid is accepted by the mixer at all, false otherwise
    • isFluidMatch

      public static boolean isFluidMatch(net.minecraft.world.level.material.Fluid fluid1, net.minecraft.world.level.material.Fluid fluid2)
      Are the two fluids compatible in the fluid mixer?
      Parameters:
      fluid1 - the first fluid
      fluid2 - the second fluid
      Returns:
      true if the fluids can be combine in the mixer, false otherwise
    • getMinWorkingPressure

      public float getMinWorkingPressure()
      Description copied from interface: IMinWorkingPressure
      Get the minimum pressure at which this machine can operate. Used for GUI display purposes (drawing the yellow region of the pressure gauge, but can also be checked elsewhere.
      Specified by:
      getMinWorkingPressure in interface IMinWorkingPressure
      Returns:
      the minimum pressure at which this machine can operate
    • createMenu

      @Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • handleGUIButtonPress

      public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player)
      Specified by:
      handleGUIButtonPress in interface IGUIButtonSensitive
      Overrides:
      handleGUIButtonPress in class AbstractPneumaticCraftBlockEntity
    • getRedstoneController

      public RedstoneController<FluidMixerBlockEntity> getRedstoneController()
      Description copied from interface: IRedstoneControl
      Get the redstone controller object for this BE
      Specified by:
      getRedstoneController in interface IRedstoneControl<FluidMixerBlockEntity>
      Returns:
      the redstone controller
    • getSerializableTanks

      @Nonnull public Map<String,PNCFluidTank> getSerializableTanks()
      Description copied from interface: ISerializableTanks
      Get a mapping of all tanks; this maps a tag name, which is used as the serialization key, to a fluid tank.
      Specified by:
      getSerializableTanks in interface ISerializableTanks
      Returns:
      a map of tag names to tanks
    • getInputTank1

      public net.minecraftforge.fluids.IFluidTank getInputTank1()
    • getInputTank2

      public net.minecraftforge.fluids.IFluidTank getInputTank2()
    • getOutputTank

      public net.minecraftforge.fluids.IFluidTank getOutputTank()
    • getCraftingPercentage

      public float getCraftingPercentage()
    • autoExportFluid

      default void autoExportFluid(AbstractPneumaticCraftBlockEntity te)
    • tryEjectLiquid

      default int tryEjectLiquid(AbstractPneumaticCraftBlockEntity te, net.minecraftforge.fluids.capability.IFluidHandler handler, net.minecraft.core.Direction dir, int amount)