Record Class PlayerQuests

java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.quest.PlayerQuests
Record Components:
quests - each server quest's progress, by id
obtained - the items the player has had that some quest's "obtained" asks for, by id, whatever became of them
read - the entries the server counted the player reading, by book
flags - the player's own flags, set by commands and mods

public record PlayerQuests(Map<net.minecraft.resources.Identifier, PlayerQuests.Progress> quests, List<net.minecraft.resources.Identifier> obtained, Map<net.minecraft.resources.Identifier, List<String>> read, List<String> flags) extends Record
What the server knows of a player's quests: kept with the player, sent only to them. Immutable: a change is a new record, and one equal to the last isn't sent again.
  • Field Details

    • EMPTY

      public static final PlayerQuests EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<PlayerQuests> CODEC
  • Constructor Details

    • PlayerQuests

      public PlayerQuests(Map<net.minecraft.resources.Identifier, PlayerQuests.Progress> quests, List<net.minecraft.resources.Identifier> obtained, Map<net.minecraft.resources.Identifier, List<String>> read, List<String> flags)
      Creates an instance of a PlayerQuests record class.
      Parameters:
      quests - the value for the quests record component
      obtained - the value for the obtained record component
      read - the value for the read record component
      flags - the value for the flags record component
  • Method Details

    • progress

      public PlayerQuests.Progress progress(net.minecraft.resources.Identifier quest)
    • with

      public PlayerQuests with(net.minecraft.resources.Identifier quest, PlayerQuests.Progress progress)
    • withObtained

      public PlayerQuests withObtained(Set<net.minecraft.resources.Identifier> items)
    • isRead

      public boolean isRead(net.minecraft.resources.Identifier book, String entry)
    • withRead

      public PlayerQuests withRead(net.minecraft.resources.Identifier book, String entry)
    • withFlag

      public PlayerQuests withFlag(String flag, boolean on)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • quests

      public Map<net.minecraft.resources.Identifier, PlayerQuests.Progress> quests()
      Returns the value of the quests record component.
      Returns:
      the value of the quests record component
    • obtained

      public List<net.minecraft.resources.Identifier> obtained()
      Returns the value of the obtained record component.
      Returns:
      the value of the obtained record component
    • read

      public Map<net.minecraft.resources.Identifier, List<String>> read()
      Returns the value of the read record component.
      Returns:
      the value of the read record component
    • flags

      public List<String> flags()
      Returns the value of the flags record component.
      Returns:
      the value of the flags record component