Class EnvironmentControllerDecorator
- All Implemented Interfaces:
EnvironmentController
EnvironmentController, to be extended by other mods for the purpose of adding or replacing
functionality from the default environment controller.
Every method by default delegates to the base controller
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull EnvironmentControllerDeprecated.The base controller to decorate with new functionality. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnvironmentControllerDecorator(EnvironmentController controller) Deprecated.Constructs a decorator out of a base controller -
Method Summary
Modifier and TypeMethodDescriptionintapplyAwareHeat(TemperatureAware temperatureAware, int locationHeat) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsdoublegetBaseValueForAttribute(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.world.entity.LivingEntity entity) Deprecated.Replaced withThermooAttributes.baseValueEvent(Holder)final @NotNull EnvironmentControllerDeprecated.Getter for the base controllerintgetEnvironmentTemperatureForPlayer(net.minecraft.world.entity.player.Player player, int localTemperature) Deprecated.Replaced withServerPlayerEnvironmentTickEventsintgetFloorTemperature(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.level.Level world, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsintgetHeatAtLocation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsintgetHeatFromBlockState(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsintgetLocalTemperatureChange(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced withServerPlayerEnvironmentTickEventsintgetMaxWetTicks(Soakable soakable) Deprecated.Gets the default maximum wet ticks for thesoakable.intgetSoakChange(Soakable soakable) Deprecated.Gets the wetness increase for aSoakablethis tickintgetTemperatureEffectsChange(net.minecraft.world.entity.LivingEntity entity) Deprecated.Replaced with active effects inLivingEntityTemperatureTickEventsbooleanisAreaHeated(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsbooleanisColdSource(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsbooleanisHeatSource(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsfinal StringtoString()Deprecated.Wraps the class name around the string representation of thecontrollerso that it is easy to see which mods are decorating the Thermoo environment controller
-
Field Details
-
controller
Deprecated.The base controller to decorate with new functionality. This field may never benull
-
-
Constructor Details
-
EnvironmentControllerDecorator
Deprecated.Constructs a decorator out of a base controller- Parameters:
controller- The basecontroller
-
-
Method Details
-
getDecorated
Deprecated.Getter for the base controller- Specified by:
getDecoratedin interfaceEnvironmentController- Returns:
- Returns the decorated base controller
-
getBaseValueForAttribute
@Deprecated(since="5.1") public double getBaseValueForAttribute(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.world.entity.LivingEntity entity) Deprecated.Replaced withThermooAttributes.baseValueEvent(Holder)Description copied from interface:EnvironmentControllerGets the base value for one of theThermooAttributes. If the return of this method is non-zero, then this value will be applied as an attribute modifier to theentitywhen the entity is created, with the addition operation. This method is called for each of the Thermoo attributes.- Specified by:
getBaseValueForAttributein interfaceEnvironmentController- Parameters:
attribute- The attribute to get the base value for. Strictly the attributes inThermooAttributes.entity- The entity to apply the attribute to.- Returns:
- Returns the base value for the attribute to apply to the entity.
-
getLocalTemperatureChange
@Deprecated(since="4.4") public int getLocalTemperatureChange(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced withServerPlayerEnvironmentTickEventsDescription copied from interface:EnvironmentControllerComputes the local temperature change from the environment 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.
-
getEnvironmentTemperatureForPlayer
@Deprecated(since="4.4") public int getEnvironmentTemperatureForPlayer(net.minecraft.world.entity.player.Player player, int localTemperature) Deprecated.Replaced withServerPlayerEnvironmentTickEventsDescription copied from interface:EnvironmentControllerComputes the environmental temperature change for a player, based on a local temperature computed fromEnvironmentController.getLocalTemperatureChange(Level, BlockPos).By default, this returns the value of
localTemperature, and NOT0.- Specified by:
getEnvironmentTemperatureForPlayerin interfaceEnvironmentController- Parameters:
player- The player to compute the temperature change forlocalTemperature- The base local temperature- Returns:
- Returns the passive environmental temperature change for the player this tick
-
getTemperatureEffectsChange
@Deprecated(since="4.4") public int getTemperatureEffectsChange(net.minecraft.world.entity.LivingEntity entity) Deprecated.Replaced with active effects inLivingEntityTemperatureTickEventsDescription copied from interface:EnvironmentControllerComputes temperature changes forLivingEntitys from heat effects. For example, being on fire or freezing in powder snow- Specified by:
getTemperatureEffectsChangein interfaceEnvironmentController- Parameters:
entity- The entity to tick warmth effects for- Returns:
- Returns the temperature change that should be applied
-
getFloorTemperature
@Deprecated(since="4.4") public int getFloorTemperature(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.level.Level world, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription copied from interface:EnvironmentControllerGets the amount of warmth generated by a floor block state for a given entity.Hot floor is different from
EnvironmentController.getHeatFromBlockState(BlockState), as it ONLY applies to entities stepping on the block - it does not affect the area around the block. An example implementation would be to provide warmth fromBlocks.MAGMA_BLOCK, but not provide area heat.You can also use this for blocks that are cold to step on.
- Specified by:
getFloorTemperaturein interfaceEnvironmentController- Parameters:
entity- The entity that is stepping on the givenstateworld- The world/level where the floor is locatedstate- The state of the floor. This is exactly the state at theposin theworldpos- The position of the world in the world- Returns:
- Returns the heat to apply each tick to entities standing on the block state
-
getMaxWetTicks
Deprecated.Description copied from interface:EnvironmentControllerGets the default maximum wet ticks for thesoakable.Important note - so that behaviour will remain consistent with previous versions, this will return
600by default, instead of the normal0for this type.- Specified by:
getMaxWetTicksin interfaceEnvironmentController- Parameters:
soakable- The soakable to get the max wet ticks for.- Returns:
- Returns the default maximum wet ticks for the
soakable
-
getSoakChange
Deprecated.Description copied from interface:EnvironmentControllerGets the wetness increase for aSoakablethis tick- Specified by:
getSoakChangein interfaceEnvironmentController- Parameters:
soakable- The soakable to compute increase for- Returns:
- Returns the soaking change for the player.
-
getHeatAtLocation
@Deprecated(since="4.4") public int getHeatAtLocation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription 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. For example, this could include artificial light producing sources, such as torches, campfires, lit furnaces, glowstone, and more.This can also be negative, to indicate a cold position.
- 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.
-
applyAwareHeat
@Deprecated(since="4.4") public int applyAwareHeat(TemperatureAware temperatureAware, int locationHeat) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription copied from interface:EnvironmentControllerGets the heat from nearby heat sources to apply to a Temperature Aware this tick.By default, the temperature aware will accept all heat from nearby heat sources.
- Specified by:
applyAwareHeatin interfaceEnvironmentController- Parameters:
temperatureAware- The temperature aware affected.locationHeat- The heat at the temperature aware's location, as computed byEnvironmentController.getHeatAtLocation(Level, BlockPos)- Returns:
- Returns
locationHeatby default.
-
getHeatFromBlockState
@Deprecated(since="4.4") public int getHeatFromBlockState(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription copied from interface:EnvironmentControllerCalculates the heat produced by a block state. May be negative, indicating a cold source.- Specified by:
getHeatFromBlockStatein interfaceEnvironmentController- Parameters:
state- The block state heat source- Returns:
- The warmth that the state produces around it
-
isHeatSource
@Deprecated(since="4.4") public boolean isHeatSource(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription 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:
-
isColdSource
@Deprecated(since="4.4") public boolean isColdSource(net.minecraft.world.level.block.state.BlockState state) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription copied from interface:EnvironmentControllerChecks if a block state is a cold source, as defined by this controller.- Specified by:
isColdSourcein interfaceEnvironmentController- Parameters:
state- The block state to check- Returns:
- Returns true if a block state is a cold source
- See Also:
-
isAreaHeated
@Deprecated(since="4.4") public boolean isAreaHeated(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Deprecated.Replaced with passive effects inLivingEntityTemperatureTickEventsDescription 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:
-
toString
Deprecated.Wraps the class name around the string representation of thecontrollerso that it is easy to see which mods are decorating the Thermoo environment controllerSubclasses may not override this method any further.
- Overrides:
toStringin classObject- Returns:
- Returns the class name of this class, and the string representation of the
controller
-