Record Class ChanceSpec
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.config.starter.ChanceSpec
-
Constructor Summary
ConstructorDescriptionChanceSpec
(com.google.gson.Gson gson, com.google.gson.JsonObject object) ChanceSpec
(PokemonSpecification spec, double chance) Creates an instance of aChanceSpec
record class.ChanceSpec
(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptiondouble
chance()
Returns the value of thechance
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.spec()
Returns the value of thespec
record component.final String
toString()
Returns a string representation of this record class.void
write
(net.minecraft.network.FriendlyByteBuf buf)
-
Constructor Details
-
ChanceSpec
public ChanceSpec(net.minecraft.network.FriendlyByteBuf buf) -
ChanceSpec
public ChanceSpec(com.google.gson.Gson gson, com.google.gson.JsonObject object) -
ChanceSpec
Creates an instance of aChanceSpec
record class.- Parameters:
spec
- the value for thespec
record componentchance
- the value for thechance
record component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
spec
Returns the value of thespec
record component.- Returns:
- the value of the
spec
record component
-
chance
public double chance()Returns the value of thechance
record component.- Returns:
- the value of the
chance
record component
-