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 Details

    • PokedexState

      public PokedexState(PokedexRegistrationStatus status, List<PokedexSection> unlockedSections, int seen, int caught, double largest, double smallest)
      Creates an instance of a PokedexState record class.
      Parameters:
      status - the value for the status record component
      unlockedSections - the value for the unlockedSections record component
      seen - the value for the seen record component
      caught - the value for the caught record component
      largest - the value for the largest record component
      smallest - the value for the smallest record component
  • Method Details

    • increaseSeen

      public PokedexState increaseSeen()
    • increaseCaught

      public PokedexState increaseCaught()
    • status

      public PokedexState status(PokedexRegistrationStatus newStatus)
    • 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

      public PokedexState setUnlockedSections(List<PokedexSection> unlockedSections)
    • addUnlockedSection

      public PokedexState addUnlockedSection(PokedexSection section)
    • save

      public net.minecraft.nbt.CompoundTag save()
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
    • load

      public static PokedexState load(net.minecraft.nbt.CompoundTag tag)
    • decode

      public static PokedexState decode(net.minecraft.network.FriendlyByteBuf buffer)
    • empty

      public static PokedexState empty()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • status

      public PokedexRegistrationStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • unlockedSections

      public List<PokedexSection> unlockedSections()
      Returns the value of the unlockedSections record component.
      Returns:
      the value of the unlockedSections record component
    • seen

      public int seen()
      Returns the value of the seen record component.
      Returns:
      the value of the seen record component
    • caught

      public int caught()
      Returns the value of the caught record component.
      Returns:
      the value of the caught record component
    • largest

      public double largest()
      Returns the value of the largest record component.
      Returns:
      the value of the largest record component
    • smallest

      public double smallest()
      Returns the value of the smallest record component.
      Returns:
      the value of the smallest record component