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 TypeMethodDescriptionintgetHeatAtLocation(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) Calculates the passive warmth nearby heat sources at a location in a world.intgetHeatFromBlockState(net.minecraft.block.BlockState state) Calculates the heat produced by a block state.intgetLocalTemperatureChange(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) Computes the local temperature change at a given position in a world.intgetOnFireWarmthRate(net.minecraft.entity.LivingEntity entity) Computes passive warmth forLivingEntitys on fire.intgetPowderSnowFreezeRate(net.minecraft.entity.LivingEntity entity) Computes passive freezing forLivingEntitys in powder snow.intgetSoakChange(net.minecraft.entity.LivingEntity entity) Gets the wetness increase for aSoakableplayer this tickbooleanisAreaHeated(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) Check if a position in a world is heatedbooleanisHeatSource(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 worldpos- The position in that world- Returns:
- The passive temperature change at
posinworld.
-
getOnFireWarmthRate
int getOnFireWarmthRate(net.minecraft.entity.LivingEntity entity) Computes passive warmth forLivingEntitys on fire. If the entity is not on fire, this will return 0. This change is applied byLivingEntityEnvironmentEvents.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 forLivingEntitys in powder snow. If the entity is not in powder snow, this will return 0. This change is applied byLivingEntityEnvironmentEvents.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 aSoakableplayer 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 inpos- 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 positionpos- The position to check- Returns:
- Returns if the location in the world is heated
- See Also:
-