Class EnvironmentControllerImpl

java.lang.Object
com.github.thedeathlycow.thermoo.impl.EnvironmentControllerImpl
All Implemented Interfaces:
EnvironmentController

public class EnvironmentControllerImpl extends Object implements EnvironmentController
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getHeatAtLocation(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
    Calculates the passive warmth nearby heat sources at a location in a world.
    int
    getHeatFromBlockState(net.minecraft.block.BlockState state)
    Calculates the heat produced by a block state.
    int
    getLocalTemperatureChange(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
    Computes the local temperature change at a given position in a world.
    int
    getOnFireWarmthRate(net.minecraft.entity.LivingEntity entity)
    Computes passive warmth for LivingEntitys on fire.
    int
    getPowderSnowFreezeRate(net.minecraft.entity.LivingEntity entity)
    Computes passive freezing for LivingEntitys in powder snow.
    int
    getSoakChange(net.minecraft.entity.LivingEntity entity)
    Gets the wetness increase for a Soakable player this tick
    boolean
    isAreaHeated(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
    Check if a position in a world is heated
    boolean
    isHeatSource(net.minecraft.block.BlockState state)
    Checks if a block state is a heat source, as defined by this controller

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EnvironmentControllerImpl

      public EnvironmentControllerImpl()
  • Method Details

    • getLocalTemperatureChange

      public int getLocalTemperatureChange(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
      Description copied from interface: EnvironmentController
      Computes the local temperature change at a given position in a world.
      Specified by:
      getLocalTemperatureChange in interface EnvironmentController
      Parameters:
      world - The world
      pos - The position in that world
      Returns:
      The passive temperature change at pos in world.
    • getOnFireWarmthRate

      public int getOnFireWarmthRate(net.minecraft.entity.LivingEntity entity)
      Description copied from interface: EnvironmentController
      Computes passive warmth for LivingEntitys on fire. If the entity is not on fire, this will return 0. This change is applied by LivingEntityEnvironmentEvents.TICK_HEAT_EFFECTS
      Specified by:
      getOnFireWarmthRate in interface EnvironmentController
      Parameters:
      entity - The entity to tick warmth from being on fire
      Returns:
      Returns the temperature change that should be applied
    • getPowderSnowFreezeRate

      public int getPowderSnowFreezeRate(net.minecraft.entity.LivingEntity entity)
      Description copied from interface: EnvironmentController
      Computes passive freezing for LivingEntitys in powder snow. If the entity is not in powder snow, this will return 0. This change is applied by LivingEntityEnvironmentEvents.TICK_HEAT_EFFECTS
      Specified by:
      getPowderSnowFreezeRate in interface EnvironmentController
      Parameters:
      entity - The entity to tick warmth from being in powder snow
      Returns:
      Returns the temperature change that should be applied
    • getSoakChange

      public int getSoakChange(net.minecraft.entity.LivingEntity entity)
      Description copied from interface: EnvironmentController
      Gets the wetness increase for a Soakable player this tick
      Specified by:
      getSoakChange in interface EnvironmentController
      Parameters:
      entity - The player to compute increase for
      Returns:
      Returns the soaking change for the player.
    • getHeatAtLocation

      public int getHeatAtLocation(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
      Description copied from interface: EnvironmentController
      Calculates the passive warmth nearby heat sources at a location in a world. 'Heat sources' being things that exist in the world that produce heat around them. By default, this includes most artificial light producing sources, such as torches, campfires, lit furnaces, glowstone, and more.
      Specified by:
      getHeatAtLocation in interface EnvironmentController
      Parameters:
      world - The world the temperature aware is in
      pos - The position to check
      Returns:
      Returns the temperature change that should be applied from nearby temperature sources.
    • getHeatFromBlockState

      public int getHeatFromBlockState(net.minecraft.block.BlockState state)
      Description copied from interface: EnvironmentController
      Calculates the heat produced by a block state.
      Specified by:
      getHeatFromBlockState in interface EnvironmentController
      Parameters:
      state - The block state heat source
      Returns:
      The warmth that the state produces around it
    • isHeatSource

      public boolean isHeatSource(net.minecraft.block.BlockState state)
      Description copied from interface: EnvironmentController
      Checks if a block state is a heat source, as defined by this controller
      Specified by:
      isHeatSource in interface EnvironmentController
      Parameters:
      state - The block state to check
      Returns:
      Returns if a block state is a heat source
      See Also:
    • isAreaHeated

      public boolean isAreaHeated(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
      Description copied from interface: EnvironmentController
      Check if a position in a world is heated
      Specified by:
      isAreaHeated in interface EnvironmentController
      Parameters:
      world - The world of the position
      pos - The position to check
      Returns:
      Returns if the location in the world is heated
      See Also: