Package net.minestom.server.instance
Record Class Weather
java.lang.Object
java.lang.Record
net.minestom.server.instance.Weather
- Record Components:
isRaining- true if the instance is raining, otherwise falserainLevel- 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
-
Constructor Summary
ConstructorsConstructorDescriptionWeather(boolean isRaining, float rainLevel, float thunderLevel) Creates an instance of aWeatherrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<SendablePacket>final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisRainingrecord component.floatReturns the value of therainLevelrecord component.floatReturns the value of thethunderLevelrecord component.final StringtoString()Returns a string representation of this record class.@NotNull WeatherwithRain(boolean isRaining) @NotNull WeatherwithRainLevel(float rainLevel) @NotNull WeatherwithRainLevel(@NotNull it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator) @NotNull WeatherwithThunderLevel(float thunderLevel) @NotNull WeatherwithThunderLevel(@NotNull it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator)
-
Constructor Details
-
Weather
public Weather(boolean isRaining, float rainLevel, float thunderLevel) Creates an instance of aWeatherrecord class.- Parameters:
isRaining- the value for theisRainingrecord componentrainLevel- the value for therainLevelrecord componentthunderLevel- the value for thethunderLevelrecord component
-
-
Method Details
-
withRain
-
withRainLevel
-
withRainLevel
@Contract(pure=true) @NotNull public @NotNull Weather withRainLevel(@NotNull @NotNull it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator) -
withThunderLevel
-
withThunderLevel
@Contract(pure=true) @NotNull public @NotNull Weather withThunderLevel(@NotNull @NotNull it.unimi.dsi.fastutil.floats.FloatUnaryOperator operator) -
createIsRainingPacket
-
createRainLevelPacket
-
createThunderLevelPacket
-
createWeatherPackets
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
isRaining
public boolean isRaining()Returns the value of theisRainingrecord component.- Returns:
- the value of the
isRainingrecord component
-
rainLevel
public float rainLevel()Returns the value of therainLevelrecord component.- Returns:
- the value of the
rainLevelrecord component
-
thunderLevel
public float thunderLevel()Returns the value of thethunderLevelrecord component.- Returns:
- the value of the
thunderLevelrecord component
-