Interface IHeatExchangerAdapter

All Superinterfaces:
IHeatExchangerLogic, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
All Known Implementing Classes:
IHeatExchangerAdapter.Simple, Mek2PNCHeatProvider.Mek2PNCHeatAdapter

public interface IHeatExchangerAdapter extends IHeatExchangerLogic
A special extension of IHeatExchangerLogic intended for implementing adapter objects for other mods' heat systems. An implementation of this can be attached to other mods' tile entities to make them appear like PNC heat exchanging blocks, while internally adapting the PNC heat API to the block's actual heat API.
  • Method Details

    • tick

      default void tick()
      Description copied from interface: IHeatExchangerLogic
      Call this to tick this logic, and make the heat disperse itself. In general this should be called each tick by the owning block entity's tick() method, on the server side only.
      Specified by:
      tick in interface IHeatExchangerLogic
    • initializeAsHull

      default void initializeAsHull(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, BiPredicate<net.minecraft.world.level.LevelAccessor,net.minecraft.core.BlockPos> blockFilter, net.minecraft.core.Direction... validSides)
      Description copied from interface: IHeatExchangerLogic
      Discovers all heat exchanging neighbor block entities (i.e. block entities who provide the IHeatExchangerLogic capability on that side) and adds them as connected heat exchangers. It also accounts for neighbouring blocks with special heat properties, like Magma or Lava, and other special cases like Heat Frames (which are entities).

      This should be called by the owning block entity on first tick (IForgeBlockEntity.onLoad() is suitable) and when neighboring blocks update (BlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, BlockPos, boolean).

      You don't need to call this method if this heat exchanger is not connected to the outside world (e.g. the internal connecting heat exchanger within a Vortex Tube).

      Specified by:
      initializeAsHull in interface IHeatExchangerLogic
      Parameters:
      world - the world
      pos - the blockpos of the owning block entity
      blockFilter - a whitelist check; can be used to exclude certain blocks, e.g. air or fluids. In most cases, IHeatExchangerLogic.ALL_BLOCKS can be passed here.
      validSides - an array of sides to check for heat exchanging neighbours
    • initializeAmbientTemperature

      default void initializeAmbientTemperature(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Description copied from interface: IHeatExchangerLogic
      Initialize this heat exchanger's ambient temperature based on the given world & position. You don't need to call this method if your heat exchanger is a hull exchanger (i.e. provides an IHeatExchangerLogic object via capability lookup), as such heat exchangers are automatically initialized by IHeatExchangerLogic.initializeAsHull(Level, BlockPos, BiPredicate, Direction...).
      Specified by:
      initializeAmbientTemperature in interface IHeatExchangerLogic
      Parameters:
      world - the world
      pos - the position
    • setTemperature

      default void setTemperature(double temperature)
      Description copied from interface: IHeatExchangerLogic
      Set the temperature of this heat exchanger. By default, heat exchangers start with a temperature equal to the ambient temperature (in the case of non-hull exchangers which have not been initialized, the default temperature is 300K, the Forge-defined temperature of water).
      Specified by:
      setTemperature in interface IHeatExchangerLogic
      Parameters:
      temperature - in degrees Kelvin
    • getTemperatureAsInt

      default int getTemperatureAsInt()
      Description copied from interface: IHeatExchangerLogic
      Get the heat exchanger's current temperature to the nearest integer. This is sync'd to clients rather than the precise floating-point temperature to avoid excessive network chatter.
      Specified by:
      getTemperatureAsInt in interface IHeatExchangerLogic
      Returns:
      the temperature to the nearest integer
    • setThermalResistance

      default void setThermalResistance(double thermalResistance)
      Description copied from interface: IHeatExchangerLogic
      The higher the thermal resistance, the slower the heat disperses. The effective resistance is the sum of this resistance plus the neighbour's resistance; if both exchangers have a resistance of 1, heat will equalize in a single tick under normal circumstances.
      Specified by:
      setThermalResistance in interface IHeatExchangerLogic
      Parameters:
      thermalResistance - the thermal resistance; higher resistance means slower heat transfer
    • setThermalCapacity

      default void setThermalCapacity(double capacity)
      Description copied from interface: IHeatExchangerLogic
      Set this heat exchanger's thermal capacity.

      The higher the capacity, the more heat can be 'stored'. E.g. an object with a heat capacity of double the heat capacity of another object will require twice as much heat gain or loss to adjust the temperature by the same amount.

      Specified by:
      setThermalCapacity in interface IHeatExchangerLogic
      Parameters:
      capacity - the thermal capacity