Class EnvironmentControllerImpl
java.lang.Object
com.github.thedeathlycow.thermoo.impl.EnvironmentControllerImpl
- All Implemented Interfaces:
EnvironmentController
-
Constructor Summary
Constructors -
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
-
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:EnvironmentControllerComputes the local temperature change at a given position in a world.- Specified by:
getLocalTemperatureChangein interfaceEnvironmentController- Parameters:
world- The worldpos- The position in that world- Returns:
- The passive temperature change at
posinworld.
-
getOnFireWarmthRate
public int getOnFireWarmthRate(net.minecraft.entity.LivingEntity entity) Description copied from interface:EnvironmentControllerComputes passive warmth forLivingEntitys on fire. If the entity is not on fire, this will return 0. This change is applied byLivingEntityEnvironmentEvents.TICK_HEAT_EFFECTS- Specified by:
getOnFireWarmthRatein interfaceEnvironmentController- 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:EnvironmentControllerComputes 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- Specified by:
getPowderSnowFreezeRatein interfaceEnvironmentController- 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:EnvironmentControllerGets the wetness increase for aSoakableplayer this tick- Specified by:
getSoakChangein interfaceEnvironmentController- 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:EnvironmentControllerCalculates 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:
getHeatAtLocationin interfaceEnvironmentController- 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
public int getHeatFromBlockState(net.minecraft.block.BlockState state) Description copied from interface:EnvironmentControllerCalculates the heat produced by a block state.- Specified by:
getHeatFromBlockStatein interfaceEnvironmentController- 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:EnvironmentControllerChecks if a block state is a heat source, as defined by this controller- Specified by:
isHeatSourcein interfaceEnvironmentController- 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:EnvironmentControllerCheck if a position in a world is heated- Specified by:
isAreaHeatedin interfaceEnvironmentController- Parameters:
world- The world of the positionpos- The position to check- Returns:
- Returns if the location in the world is heated
- See Also:
-