Package com.wdiscute.echoes.timeless
Record Class TimelessLootEntry
java.lang.Object
java.lang.Record
com.wdiscute.echoes.timeless.TimelessLootEntry
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimelessLootEntry(com.wdiscute.utils.MaybeStack stack, Rarity rarity, int weight) TimelessLootEntry(com.wdiscute.utils.MaybeStack stack, Rarity rarity, int preferredLevel, int weight) TimelessLootEntry(com.wdiscute.utils.MaybeStack stack, Rarity rarity, int preferredLevel, int weight, int levelRange) Creates an instance of aTimelessLootEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static TimelessLootEntrygetRandomLoot(net.minecraft.util.RandomSource randomSource, int level, boolean isChest) final inthashCode()Returns a hash code value for this object.intReturns the value of thelevelRangerecord component.intReturns the value of thepreferredLevelrecord component.rarity()Returns the value of therarityrecord component.static List<net.minecraft.world.item.ItemStack> resolveStacks(net.minecraft.util.RandomSource randomSource, int level, float rolls, boolean isChest) com.wdiscute.utils.MaybeStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
TimelessLootEntry
public TimelessLootEntry(com.wdiscute.utils.MaybeStack stack, Rarity rarity, int preferredLevel, int weight) -
TimelessLootEntry
-
TimelessLootEntry
public TimelessLootEntry(com.wdiscute.utils.MaybeStack stack, Rarity rarity, int preferredLevel, int weight, int levelRange) Creates an instance of aTimelessLootEntryrecord class.- Parameters:
stack- the value for thestackrecord componentrarity- the value for therarityrecord componentpreferredLevel- the value for thepreferredLevelrecord componentweight- the value for theweightrecord componentlevelRange- the value for thelevelRangerecord component
-
-
Method Details
-
resolveStacks
public static List<net.minecraft.world.item.ItemStack> resolveStacks(net.minecraft.util.RandomSource randomSource, int level, float rolls, boolean isChest) -
getRandomLoot
@Nullable public static TimelessLootEntry getRandomLoot(net.minecraft.util.RandomSource randomSource, int level, boolean isChest) -
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 '=='. -
stack
public com.wdiscute.utils.MaybeStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
rarity
Returns the value of therarityrecord component.- Returns:
- the value of the
rarityrecord 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
-