Record Class PokedexState
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.pokedex.status.PokedexState
public record PokedexState(PokedexRegistrationStatus status, List<PokedexSection> unlockedSections, int seen, int caught, double largest, double smallest)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPokedexState
(PokedexRegistrationStatus status, List<PokedexSection> unlockedSections, int seen, int caught, double largest, double smallest) Creates an instance of aPokedexState
record class. -
Method Summary
Modifier and TypeMethodDescriptionaddUnlockedSection
(PokedexSection section) int
caught()
Returns the value of thecaught
record component.static PokedexState
decode
(net.minecraft.network.FriendlyByteBuf buffer) static PokedexState
empty()
void
encode
(net.minecraft.network.FriendlyByteBuf buffer) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.double
largest()
Returns the value of thelargest
record component.static PokedexState
load
(net.minecraft.nbt.CompoundTag tag) net.minecraft.nbt.CompoundTag
save()
int
seen()
Returns the value of theseen
record component.setUnlockedSections
(List<PokedexSection> unlockedSections) double
smallest()
Returns the value of thesmallest
record component.status()
Returns the value of thestatus
record component.status
(PokedexRegistrationStatus newStatus) final String
toString()
Returns a string representation of this record class.Returns the value of theunlockedSections
record component.updateLargest
(net.minecraft.resources.ResourceKey<Pokedex> pokedexType, net.minecraft.world.entity.player.Player player, Pokemon pokemon, double newLargest) updateSmallest
(net.minecraft.resources.ResourceKey<Pokedex> pokedexType, net.minecraft.world.entity.player.Player player, Pokemon pokemon, double newSmallest)
-
Constructor Details
-
PokedexState
public PokedexState(PokedexRegistrationStatus status, List<PokedexSection> unlockedSections, int seen, int caught, double largest, double smallest) Creates an instance of aPokedexState
record class.- Parameters:
status
- the value for thestatus
record componentunlockedSections
- the value for theunlockedSections
record componentseen
- the value for theseen
record componentcaught
- the value for thecaught
record componentlargest
- the value for thelargest
record componentsmallest
- the value for thesmallest
record component
-
-
Method Details
-
increaseSeen
-
increaseCaught
-
status
-
updateLargest
public PokedexState updateLargest(net.minecraft.resources.ResourceKey<Pokedex> pokedexType, net.minecraft.world.entity.player.Player player, Pokemon pokemon, double newLargest) -
updateSmallest
public PokedexState updateSmallest(net.minecraft.resources.ResourceKey<Pokedex> pokedexType, net.minecraft.world.entity.player.Player player, Pokemon pokemon, double newSmallest) -
setUnlockedSections
-
addUnlockedSection
-
save
public net.minecraft.nbt.CompoundTag save() -
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) -
load
-
decode
-
empty
-
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 '=='. -
status
Returns the value of thestatus
record component.- Returns:
- the value of the
status
record component
-
unlockedSections
Returns the value of theunlockedSections
record component.- Returns:
- the value of the
unlockedSections
record component
-
seen
public int seen()Returns the value of theseen
record component.- Returns:
- the value of the
seen
record component
-
caught
public int caught()Returns the value of thecaught
record component.- Returns:
- the value of the
caught
record component
-
largest
public double largest()Returns the value of thelargest
record component.- Returns:
- the value of the
largest
record component
-
smallest
public double smallest()Returns the value of thesmallest
record component.- Returns:
- the value of the
smallest
record component
-