Record Class Growth
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.pokemon.growth.Growth
- Record Components:
range
- The size range of this growthsprite
- The sprite to use for this size in the UI
Represents a range of sizes that a Pokemon can be.
This is used to represent the size in the Pokedex and other UIs.
The range of sizes is represented by a number of standard deviations from the mean size of the Pokemon, with the mean and standard deviation being determined by the Pokemon's species JSON.
All Growths from the registry are synced to the client from the server on login using the
This is used to represent the size in the Pokedex and other UIs.
The range of sizes is represented by a number of standard deviations from the mean size of the Pokemon, with the mean and standard deviation being determined by the Pokemon's species JSON.
All Growths from the registry are synced to the client from the server on login using the
CODEC
so that the client can display the correct size in the UI.
range- Since:
- 01/10/2024
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGrowth
(GrowthComparator range, ResourceWithFallback sprite) Creates an instance of aGrowth
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.net.minecraft.network.chat.Component
getName()
Gets the name of this size.final int
hashCode()
Returns a hash code value for this object.boolean
Checks if the given Pokemon is in range of this size.double
Gets a random size for the given Pokemon.range()
Returns the value of therange
record component.sprite()
Returns the value of thesprite
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Method Details
-
getName
public net.minecraft.network.chat.Component getName()Gets the name of this size.
This is used in the Pokedex and other UIs.- Returns:
- The name of this size
-
inRange
Checks if the given Pokemon is in range of this size.- Parameters:
pokemon
- The Pokemon to check- Returns:
- If the given Pokemon is in range of this size
-
random
Gets a random size for the given Pokemon.- Parameters:
pokemon
- The Pokemon to get the size for- Returns:
- A random size for the given Pokemon
-
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 withObjects::equals(Object,Object)
. -
range
Returns the value of therange
record component.- Returns:
- the value of the
range
record component
-
sprite
Returns the value of thesprite
record component.- Returns:
- the value of the
sprite
record component
-