Record Class Weather
java.lang.Object
java.lang.Record
net.minestom.server.instance.Weather
- Record Components:
rainLevel- a percentage between 0 and 1 used to change how heavy the rain is higher values darken the sky and increase rain opacitythunderLevel- a percentage between 0 and 1 used to change how heavy the thunder is higher values further darken the sky
Represents the possible weather properties of an instance
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWeather(float rainLevel, float thunderLevel) Creates an instance of aWeatherrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanfloatReturns the value of therainLevelrecord component.floatReturns the value of thethunderLevelrecord component.final StringtoString()Returns a string representation of this record class.withRainLevel(float rainLevel) withRainLevel(it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator) withThunderLevel(float thunderLevel) withThunderLevel(it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator)
-
Field Details
-
CLEAR
-
RAIN
-
THUNDER
-
-
Constructor Details
-
Weather
public Weather(float rainLevel, float thunderLevel) Creates an instance of aWeatherrecord class.- Parameters:
rainLevel- the value for therainLevelrecord componentthunderLevel- the value for thethunderLevelrecord component
-
-
Method Details
-
withRainLevel
-
isRaining
public boolean isRaining()- Returns:
- true if
rainLevelis > 0
-
withRainLevel
-
withThunderLevel
-
withThunderLevel
-
createIsRainingPacket
-
createRainLevelPacket
-
createThunderLevelPacket
-
createWeatherPackets
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
rainLevel
-
thunderLevel
public float thunderLevel()Returns the value of thethunderLevelrecord component.- Returns:
- the value of the
thunderLevelrecord component
-