Package com.wdiscute.echoes.upgrades
Record Class BlacksmithTrade
java.lang.Object
java.lang.Record
com.wdiscute.echoes.upgrades.BlacksmithTrade
public record BlacksmithTrade(List<BlacksmithTrade.Entry> entries, int weight, boolean hasUpgrades)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlacksmithTrade> static final BlacksmithTrade -
Constructor Summary
ConstructorsConstructorDescriptionBlacksmithTrade(List<BlacksmithTrade.Entry> entries, int weight, boolean hasUpgrades) Creates an instance of aBlacksmithTraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.getBase()List<com.wdiscute.utils.MaybeStack> static com.wdiscute.utils.Utils.Duo<BlacksmithTrade, net.minecraft.resources.ResourceLocation> getRandomTrade(net.minecraft.server.level.ServerLevel sl) static com.wdiscute.utils.Utils.Duo<BlacksmithTrade.Entry, net.minecraft.resources.ResourceLocation> getRandomTradeForDisplay(net.minecraft.server.level.ServerLevel sl) final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasUpgradesrecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Field Details
-
EMPTY
-
CODEC
-
-
Constructor Details
-
BlacksmithTrade
Creates an instance of aBlacksmithTraderecord class.- Parameters:
entries- the value for theentriesrecord componentweight- the value for theweightrecord componenthasUpgrades- the value for thehasUpgradesrecord component
-
-
Method Details
-
getBase
-
getDisplayCost
-
getRandomTradeForDisplay
public static com.wdiscute.utils.Utils.Duo<BlacksmithTrade.Entry,net.minecraft.resources.ResourceLocation> getRandomTradeForDisplay(net.minecraft.server.level.ServerLevel sl) -
getRandomTrade
public static com.wdiscute.utils.Utils.Duo<BlacksmithTrade,net.minecraft.resources.ResourceLocation> getRandomTrade(net.minecraft.server.level.ServerLevel sl) -
getNext
-
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 '=='. -
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
hasUpgrades
public boolean hasUpgrades()Returns the value of thehasUpgradesrecord component.- Returns:
- the value of the
hasUpgradesrecord component
-