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 aPokedexStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddUnlockedSection(PokedexSection section) intcaught()Returns the value of thecaughtrecord component.static PokedexStatedecode(net.minecraft.network.FriendlyByteBuf buffer) static PokedexStateempty()voidencode(net.minecraft.network.FriendlyByteBuf buffer) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublelargest()Returns the value of thelargestrecord component.static PokedexStateload(net.minecraft.nbt.CompoundTag tag) net.minecraft.nbt.CompoundTagsave()intseen()Returns the value of theseenrecord component.setUnlockedSections(List<PokedexSection> unlockedSections) doublesmallest()Returns the value of thesmallestrecord component.status()Returns the value of thestatusrecord component.status(PokedexRegistrationStatus newStatus) final StringtoString()Returns a string representation of this record class.Returns the value of theunlockedSectionsrecord 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 aPokedexStaterecord class.- Parameters:
status- the value for thestatusrecord componentunlockedSections- the value for theunlockedSectionsrecord componentseen- the value for theseenrecord componentcaught- the value for thecaughtrecord componentlargest- the value for thelargestrecord componentsmallest- the value for thesmallestrecord 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 thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
unlockedSections
Returns the value of theunlockedSectionsrecord component.- Returns:
- the value of the
unlockedSectionsrecord component
-
seen
public int seen()Returns the value of theseenrecord component.- Returns:
- the value of the
seenrecord component
-
caught
public int caught()Returns the value of thecaughtrecord component.- Returns:
- the value of the
caughtrecord component
-
largest
public double largest()Returns the value of thelargestrecord component.- Returns:
- the value of the
largestrecord component
-
smallest
public double smallest()Returns the value of thesmallestrecord component.- Returns:
- the value of the
smallestrecord component
-