Record Class StarterOption
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.config.starter.StarterOption
public record StarterOption(String labelOn, String labelOff, int width, int x, int y, PokemonSpecification spec)
extends Record
-
Constructor Summary
ConstructorDescriptionStarterOption
(com.google.gson.JsonObject json, com.google.gson.JsonDeserializationContext ctx) StarterOption
(String labelOn, String labelOff, int width, int x, int y, PokemonSpecification spec) Creates an instance of aStarterOption
record class.StarterOption
(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.label
(boolean on) labelOff()
Returns the value of thelabelOff
record component.labelOn()
Returns the value of thelabelOn
record component.spec()
Returns the value of thespec
record component.void
toBuffer
(net.minecraft.network.FriendlyByteBuf buf) com.google.gson.JsonObject
toJson
(com.google.gson.JsonSerializationContext ctx) final String
toString()
Returns a string representation of this record class.int
width()
Returns the value of thewidth
record component.int
x()
Returns the value of thex
record component.int
y()
Returns the value of they
record component.
-
Constructor Details
-
StarterOption
public StarterOption(com.google.gson.JsonObject json, com.google.gson.JsonDeserializationContext ctx) -
StarterOption
public StarterOption(net.minecraft.network.FriendlyByteBuf buf) -
StarterOption
public StarterOption(String labelOn, String labelOff, int width, int x, int y, PokemonSpecification spec) Creates an instance of aStarterOption
record class.- Parameters:
labelOn
- the value for thelabelOn
record componentlabelOff
- the value for thelabelOff
record componentwidth
- the value for thewidth
record componentx
- the value for thex
record componenty
- the value for they
record componentspec
- the value for thespec
record component
-
-
Method Details
-
toJson
public com.google.gson.JsonObject toJson(com.google.gson.JsonSerializationContext ctx) -
toBuffer
public void toBuffer(net.minecraft.network.FriendlyByteBuf buf) -
label
-
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 '=='. -
labelOn
Returns the value of thelabelOn
record component.- Returns:
- the value of the
labelOn
record component
-
labelOff
Returns the value of thelabelOff
record component.- Returns:
- the value of the
labelOff
record component
-
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
x
public int x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public int y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
spec
Returns the value of thespec
record component.- Returns:
- the value of the
spec
record component
-