Record Class PokemonRepresentation
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.trading.PokemonRepresentation
public record PokemonRepresentation(net.minecraft.network.chat.Component speciesName, ResourceWithFallback sprite, boolean shiny)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPokemonRepresentation(net.minecraft.network.chat.Component speciesName, ResourceWithFallback sprite, boolean shiny) Creates an instance of aPokemonRepresentationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic PokemonRepresentationdecode(net.minecraft.network.FriendlyByteBuf buffer) voidencode(net.minecraft.network.FriendlyByteBuf buffer) final booleanIndicates whether some other object is "equal to" this one.static PokemonRepresentationfrom(PokemonSpecification spec) final inthashCode()Returns a hash code value for this object.booleanshiny()Returns the value of theshinyrecord component.net.minecraft.network.chat.ComponentReturns the value of thespeciesNamerecord component.sprite()Returns the value of thespriterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PokemonRepresentation
public PokemonRepresentation(net.minecraft.network.chat.Component speciesName, ResourceWithFallback sprite, boolean shiny) Creates an instance of aPokemonRepresentationrecord class.- Parameters:
speciesName- the value for thespeciesNamerecord componentsprite- the value for thespriterecord componentshiny- the value for theshinyrecord component
-
-
Method Details
-
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) -
decode
-
from
-
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 '=='. -
speciesName
public net.minecraft.network.chat.Component speciesName()Returns the value of thespeciesNamerecord component.- Returns:
- the value of the
speciesNamerecord component
-
sprite
Returns the value of thespriterecord component.- Returns:
- the value of the
spriterecord component
-
shiny
public boolean shiny()Returns the value of theshinyrecord component.- Returns:
- the value of the
shinyrecord component
-