Repository navigation
MixinPLayerEntity
-
observers-
Type:
List<PlayerTemperatureObserver> - Description: List of observers registered to monitor player temperature changes.
-
Type:
-
temperature_state-
Type:
PlayerTemperatureState -
Description: Current state of the player's temperature (
NORMAL,OVERHEATING,FREEZING).
-
Type:
-
current_temperature-
Type:
BigDecimal -
Description: Current temperature of the player, stored as a
BigDecimalfor precision.
-
Type:
-
temperatureManager-
Type:
TemperatureManager -
Description: Instance of
TemperatureManagerresponsible for managing player temperature.
-
Type:
-
stanley_lib$getPlayerTemperature()- Description: Retrieves the current temperature of the player.
-
Returns:
double- Current player temperature. -
Interface:
IStanleyPlayerEntity
-
stanley_lib$setPlayerTemperature(double temperature)- Description: Sets the player's temperature to a specified value.
-
Parameters:
-
temperature(double) - New temperature value to set.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$increasePlayerTemperature(double amount)- Description: Increases the player's temperature by a specified amount.
-
Parameters:
-
amount(double) - Amount by which to increase the temperature.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$decreasePlayerTemperature(double amount)- Description: Decreases the player's temperature by a specified amount.
-
Parameters:
-
amount(double) - Amount by which to decrease the temperature.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$isPlayerOverheating()- Description: Checks if the player is in an overheating state.
-
Returns:
boolean-trueif the player is overheating, otherwisefalse. -
Interface:
IStanleyPlayerEntity
-
stanley_lib$isPlayerFreezing()- Description: Checks if the player is in a freezing state.
-
Returns:
boolean-trueif the player is freezing, otherwisefalse. -
Interface:
IStanleyPlayerEntity
-
stanley_lib$resetPlayerTemperature()- Description: Resets the player's temperature to the default value.
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$killByFreezing()- Description: Kills the player due to freezing.
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$killByOverheating()- Description: Kills the player due to overheating.
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$getBlockUnderPlayer()- Description: Retrieves the block directly under the player.
-
Returns:
Block- Block under the player. -
Interface:
IPlayerEntity
-
stanley_lib$hurtByFreezing(int amount)- Description: Inflicts damage on the player due to freezing.
-
Parameters:
-
amount(int) - Amount of damage to inflict.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$hurtByOverheating(int amount)- Description: Inflicts damage on the player due to overheating.
-
Parameters:
-
amount(int) - Amount of damage to inflict.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$registerObserver(PlayerTemperatureObserver observer)-
Description: Registers a
PlayerTemperatureObserverto monitor temperature changes. -
Parameters:
-
observer(PlayerTemperatureObserver) - Observer to register.
-
-
Interface:
ISubject
-
Description: Registers a
-
stanley_lib$removeObserver(PlayerTemperatureObserver observer)-
Description: Removes a registered
PlayerTemperatureObserverfrom monitoring. -
Parameters:
-
observer(PlayerTemperatureObserver) - Observer to remove.
-
-
Interface:
ISubject
-
Description: Removes a registered
-
stanley_lib$notifyObservers()- Description: Notifies all registered observers about a change in temperature.
-
Interface:
ISubject
-
stanley_lib$setTemperatureState(PlayerTemperatureState state)- Description: Sets the player's current temperature state.
-
Parameters:
-
state(PlayerTemperatureState) - New temperature state to set.
-
-
Interface:
IStanleyPlayerEntity
-
stanley_lib$getState()- Description: Retrieves the current state of the player's temperature.
-
Returns:
PlayerTemperatureState- Current temperature state. -
Interface:
ISubject
-
stanley_lib$updateTemperature()- Description: Updates the player's temperature based on environmental factors and conditions.
-
Interface:
IStanleyPlayerEntity
-
hasLeatherArmor(EntityPlayer player)- Description: Checks if the specified player has any pieces of leather armor equipped.
-
Parameters:
-
player(EntityPlayer) - Player entity to check.
-
-
Returns:
boolean[]- Array indicating which armor slots have leather armor equipped. -
Interface:
IPlayerEntity
-
afterConstructor(World world, CallbackInfo ci)- Description: Post-constructor hook that may register default observers for temperature monitoring.
-
afterUpdate(CallbackInfo ci)- Description: Post-update hook that triggers temperature management if configured.
-
afterPlayerHurt(Entity attacker, int damage, DamageType type, CallbackInfoReturnable<Boolean> cir)- Description: Post-damage hook that adjusts player temperature if hit by specific entities (e.g., snowballs, snowmen).
- The mixin class integrates temperature management functionalities into
EntityPlayer, allowing dynamic adjustment and monitoring of the player's temperature state.