Interface EnvironmentController

All Known Implementing Classes:
EnvironmentControllerImpl

public interface EnvironmentController
Implements computations for various passive environmental effects, such as passive freezing/warming from biomes, and passive warming from heat sources (torches, campfires, etc).

The default implementation is provided by EnvironmentManager.getController(), and what is used by Frostiful, however if you wish you may re-implement this class for your own mod.

  • 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
  • Method Details

    • getLocalTemperatureChange

      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.
      Parameters:
      world - The world
      pos - The position in that world
      Returns:
      The passive temperature change at pos in world.
    • getOnFireWarmthRate

      int getOnFireWarmthRate(net.minecraft.entity.LivingEntity entity)
      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
      Parameters:
      entity - The entity to tick warmth from being on fire
      Returns:
      Returns the temperature change that should be applied
    • getPowderSnowFreezeRate

      int getPowderSnowFreezeRate(net.minecraft.entity.LivingEntity entity)
      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
      Parameters:
      entity - The entity to tick warmth from being in powder snow
      Returns:
      Returns the temperature change that should be applied
    • getSoakChange

      int getSoakChange(net.minecraft.entity.LivingEntity entity)
      Gets the wetness increase for a Soakable player this tick
      Parameters:
      entity - The player to compute increase for
      Returns:
      Returns the soaking change for the player.
    • getHeatAtLocation

      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. '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.
      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

      int getHeatFromBlockState(net.minecraft.block.BlockState state)
      Calculates the heat produced by a block state.
      Parameters:
      state - The block state heat source
      Returns:
      The warmth that the state produces around it
    • isHeatSource

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

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