Record Class TimelessData

java.lang.Object
java.lang.Record
com.wdiscute.echoes.timeless.TimelessData

public record TimelessData(long timeToExit, int currentStage, int maxStage, List<com.wdiscute.utils.MaybeStack> inventory, float souls, float maxSouls, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<TimelessData>
     
    static final TimelessData
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,TimelessData>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimelessData(long timeToExit, int currentStage, int maxStage, List<com.wdiscute.utils.MaybeStack> inventory, float souls, float maxSouls, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted)
    Creates an instance of a TimelessData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    awardSoul(net.minecraft.world.entity.player.Player player, float souls)
     
    static void
    clearSouls(net.minecraft.world.entity.player.Player player)
     
    static boolean
    consumeSouls(net.minecraft.world.entity.player.Player player, float souls)
     
    int
    Returns the value of the currentStage record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    get(net.minecraft.world.entity.player.Player player)
     
    final int
    Returns a hash code value for this object.
    static void
    increaseStageCount(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation stage)
     
    List<com.wdiscute.utils.MaybeStack>
    Returns the value of the inventory record component.
    com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation>
    Returns the value of the levelsCompleted record component.
    float
    Returns the value of the maxSouls record component.
    int
    Returns the value of the maxStage record component.
    static void
    resetProgress(net.minecraft.server.level.ServerPlayer player)
     
    static void
    setCurrentStage(net.minecraft.world.entity.player.Player player, int currentStage)
     
    static void
    setInventory(net.minecraft.world.entity.player.Player player, List<com.wdiscute.utils.MaybeStack> inventory)
     
    static void
    setMaxStage(net.minecraft.world.entity.player.Player player, int currentStage)
     
    static void
    setTimeToExit(net.minecraft.world.entity.player.Player player, long timeToExit)
     
    float
    Returns the value of the souls record component.
    long
    Returns the value of the timeToExit record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • EMPTY

      public static final TimelessData EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<TimelessData> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,TimelessData> STREAM_CODEC
  • Constructor Details

    • TimelessData

      public TimelessData(long timeToExit, int currentStage, int maxStage, List<com.wdiscute.utils.MaybeStack> inventory, float souls, float maxSouls, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted)
      Creates an instance of a TimelessData record class.
      Parameters:
      timeToExit - the value for the timeToExit record component
      currentStage - the value for the currentStage record component
      maxStage - the value for the maxStage record component
      inventory - the value for the inventory record component
      souls - the value for the souls record component
      maxSouls - the value for the maxSouls record component
      levelsCompleted - the value for the levelsCompleted record component
  • Method Details

    • get

      public static TimelessData get(net.minecraft.world.entity.player.Player player)
    • setTimeToExit

      public static void setTimeToExit(net.minecraft.world.entity.player.Player player, long timeToExit)
    • setCurrentStage

      public static void setCurrentStage(net.minecraft.world.entity.player.Player player, int currentStage)
    • setMaxStage

      public static void setMaxStage(net.minecraft.world.entity.player.Player player, int currentStage)
    • setInventory

      public static void setInventory(net.minecraft.world.entity.player.Player player, List<com.wdiscute.utils.MaybeStack> inventory)
    • resetProgress

      public static void resetProgress(net.minecraft.server.level.ServerPlayer player)
    • consumeSouls

      public static boolean consumeSouls(net.minecraft.world.entity.player.Player player, float souls)
    • clearSouls

      public static void clearSouls(net.minecraft.world.entity.player.Player player)
    • awardSoul

      public static void awardSoul(net.minecraft.world.entity.player.Player player, float souls)
    • increaseStageCount

      public static void increaseStageCount(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation stage)
    • 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.
    • timeToExit

      public long timeToExit()
      Returns the value of the timeToExit record component.
      Returns:
      the value of the timeToExit record component
    • currentStage

      public int currentStage()
      Returns the value of the currentStage record component.
      Returns:
      the value of the currentStage record component
    • maxStage

      public int maxStage()
      Returns the value of the maxStage record component.
      Returns:
      the value of the maxStage record component
    • inventory

      public List<com.wdiscute.utils.MaybeStack> inventory()
      Returns the value of the inventory record component.
      Returns:
      the value of the inventory record component
    • souls

      public float souls()
      Returns the value of the souls record component.
      Returns:
      the value of the souls record component
    • maxSouls

      public float maxSouls()
      Returns the value of the maxSouls record component.
      Returns:
      the value of the maxSouls record component
    • levelsCompleted

      public com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted()
      Returns the value of the levelsCompleted record component.
      Returns:
      the value of the levelsCompleted record component