public interface IClimateState
IClimateState is used to store and handle temperature and humidity.
The values are oriented on the values of Biome.getDefaultTemperature() and Biome.getRainfall().
If any of the two values would be Float.NAN after an operation IClimateStateHelper.absent() will be returned
instead of the state.
IClimateStateHelper at ClimateManager.stateHelper provides some helper methods to create and handle
climate states.
| Modifier and Type | Method and Description |
|---|---|
default IClimateState |
add(ClimateType type,
float value)
Adds the given value to the value of this state.
|
IClimateState |
add(IClimateState state)
Adds the given state to this state.
|
IClimateState |
addHumidity(float humidity)
Adds the given value to the humidity value of this state.
|
IClimateState |
addTemperature(float temperature)
Adds the given value to the temperature value of this state.
|
IClimateState |
copy() |
IClimateState |
copy(boolean mutable) |
default float |
getClimate(ClimateType type) |
float |
getHumidity() |
default EnumHumidity |
getHumidityEnum() |
float |
getTemperature() |
default EnumTemperature |
getTemperatureEnum() |
boolean |
isClamped() |
boolean |
isMutable() |
boolean |
isPresent() |
IClimateState |
map(java.util.function.Function<java.lang.Float,java.lang.Float> mapper)
Applies the mapper
Function.apply(Object) on the two climate values of this state. |
IClimateState |
multiply(double factor)
Multiplies the values of this state with the given factor.
|
default IClimateState |
setClimate(ClimateType type,
float value)
Adds climate value of this state.
|
IClimateState |
setClimate(float temperature,
float humidity)
Sets the humidity and temperature value to the given values.
|
IClimateState |
setHumidity(float humidity)
Sets the humidity value of this state.
|
IClimateState |
setTemperature(float temperature)
Sets the temperature value of this state.
|
default IClimateState |
subtract(ClimateType type,
float value)
Subtracts the given value from the value of this state.
|
IClimateState |
subtract(IClimateState state)
Subtracts the given state from this state.
|
default IClimateState |
subtractHumidity(float value)
Subtracts the given value from the humidity value of this state.
|
default IClimateState |
subtractTemperature(float value)
Subtracts the given value from the temperature value of this state.
|
IClimateState |
toImmutable() |
IClimateState |
toMutable() |
float getTemperature()
default EnumTemperature getTemperatureEnum()
float getHumidity()
default EnumHumidity getHumidityEnum()
default float getClimate(ClimateType type)
IClimateState addTemperature(float temperature)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState addHumidity(float humidity)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState add(IClimateState state)
isMutable() this state or if it isn't a immutable copy of the state with the new values.default IClimateState add(ClimateType type, float value)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState setTemperature(float temperature)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState setHumidity(float humidity)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState setClimate(float temperature, float humidity)
isMutable() this state or if it isn't a immutable copy of the state with the new values.default IClimateState setClimate(ClimateType type, float value)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState multiply(double factor)
isMutable() this state or if it isn't a immutable copy of the state with the new values.default IClimateState subtractTemperature(float value)
isMutable() this state or if it isn't a immutable copy of the state with the new values.default IClimateState subtractHumidity(float value)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState subtract(IClimateState state)
isMutable() this state or if it isn't a immutable copy of the state with the new values.default IClimateState subtract(ClimateType type, float value)
isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState map(java.util.function.Function<java.lang.Float,java.lang.Float> mapper)
Function.apply(Object) on the two climate values of this state.isMutable() this state or if it isn't a immutable copy of the state with the new values.IClimateState copy(boolean mutable)
mutable - If the copy of this state should be mutable or immutable.IClimateState copy()
isMutable() of this state is true or returns the immutable state.IClimateState toMutable()
IClimateState toImmutable()
boolean isPresent()
boolean isMutable()
boolean isClamped()
IClimateStateHelper.clamp(IClimateState)