Record Class TimelessLevelEntry

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

public record TimelessLevelEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int weight, int levelRange, int ticks, int maxUses) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<TimelessLevelEntry>
     
    static final TimelessLevelEntry
     
    static final TimelessLevelEntry
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimelessLevelEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int weight, int levelRange, int ticks, int maxUses)
    Creates an instance of a TimelessLevelEntry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    getRandomLevel(net.minecraft.server.level.ServerLevel sl, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted, int level)
     
    final int
    Returns a hash code value for this object.
    net.minecraft.resources.ResourceLocation
    id()
    Returns the value of the id record component.
    int
    Returns the value of the levelRange record component.
    int
    Returns the value of the maxUses record component.
    int
    Returns the value of the preferredLevel record component.
    int
    Returns the value of the ticks record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the weight record component.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • TimelessLevelEntry

      public TimelessLevelEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int weight, int levelRange, int ticks, int maxUses)
      Creates an instance of a TimelessLevelEntry record class.
      Parameters:
      id - the value for the id record component
      preferredLevel - the value for the preferredLevel record component
      weight - the value for the weight record component
      levelRange - the value for the levelRange record component
      ticks - the value for the ticks record component
      maxUses - the value for the maxUses record component
  • Method Details

    • getRandomLevel

      @Nullable public static TimelessLevelEntry getRandomLevel(net.minecraft.server.level.ServerLevel sl, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted, int level)
    • 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.
    • id

      public net.minecraft.resources.ResourceLocation id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • preferredLevel

      public int preferredLevel()
      Returns the value of the preferredLevel record component.
      Returns:
      the value of the preferredLevel record component
    • weight

      public int weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • levelRange

      public int levelRange()
      Returns the value of the levelRange record component.
      Returns:
      the value of the levelRange record component
    • ticks

      public int ticks()
      Returns the value of the ticks record component.
      Returns:
      the value of the ticks record component
    • maxUses

      public int maxUses()
      Returns the value of the maxUses record component.
      Returns:
      the value of the maxUses record component