Record Class ChanceSpec
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.config.starter.ChanceSpec
-
Constructor Summary
ConstructorsConstructorDescriptionChanceSpec(com.google.gson.Gson gson, com.google.gson.JsonObject object) ChanceSpec(PokemonSpecification spec, double chance) Creates an instance of aChanceSpecrecord class.ChanceSpec(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptiondoublechance()Returns the value of thechancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.spec()Returns the value of thespecrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(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 aChanceSpecrecord class.- Parameters:
spec- the value for thespecrecord componentchance- the value for thechancerecord 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 thespecrecord component.- Returns:
- the value of the
specrecord component
-
chance
public double chance()Returns the value of thechancerecord component.- Returns:
- the value of the
chancerecord component
-