Package com.wdiscute.echoes.timeless
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TimelessLevelEntry> static final TimelessLevelEntrystatic final TimelessLevelEntry -
Constructor Summary
ConstructorsConstructorDescriptionTimelessLevelEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int weight, int levelRange, int ticks, int maxUses) Creates an instance of aTimelessLevelEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static TimelessLevelEntrygetRandomLevel(net.minecraft.server.level.ServerLevel sl, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted, int level) final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()Returns the value of theidrecord component.intReturns the value of thelevelRangerecord component.intmaxUses()Returns the value of themaxUsesrecord component.intReturns the value of thepreferredLevelrecord component.intticks()Returns the value of theticksrecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Field Details
-
HUB
-
TUTORIAL
-
CODEC
-
-
Constructor Details
-
TimelessLevelEntry
public TimelessLevelEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int weight, int levelRange, int ticks, int maxUses) Creates an instance of aTimelessLevelEntryrecord class.- Parameters:
id- the value for theidrecord componentpreferredLevel- the value for thepreferredLevelrecord componentweight- the value for theweightrecord componentlevelRange- the value for thelevelRangerecord componentticks- the value for theticksrecord componentmaxUses- the value for themaxUsesrecord 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
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 '=='. -
id
public net.minecraft.resources.ResourceLocation id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
preferredLevel
public int preferredLevel()Returns the value of thepreferredLevelrecord component.- Returns:
- the value of the
preferredLevelrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
levelRange
public int levelRange()Returns the value of thelevelRangerecord component.- Returns:
- the value of the
levelRangerecord component
-
ticks
public int ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-
maxUses
public int maxUses()Returns the value of themaxUsesrecord component.- Returns:
- the value of the
maxUsesrecord component
-