Package com.wdiscute.echoes.upgrades
Record Class BlacksmithTrade
java.lang.Object
java.lang.Record
com.wdiscute.echoes.upgrades.BlacksmithTrade
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlacksmithTrade> static final BlacksmithTrade -
Constructor Summary
ConstructorsConstructorDescriptionBlacksmithTrade(com.wdiscute.utils.MaybeStack stack, Rarity rarity, List<com.wdiscute.utils.MaybeStack> cost, int weight) Creates an instance of aBlacksmithTraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<com.wdiscute.utils.MaybeStack> cost()Returns the value of thecostrecord component.final booleanIndicates whether some other object is "equal to" this one.static BlacksmithTradegetRandomTrade(net.minecraft.server.level.ServerLevel sl) final inthashCode()Returns a hash code value for this object.rarity()Returns the value of therarityrecord component.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
-
EMPTY
-
CODEC
-
-
Constructor Details
-
BlacksmithTrade
public BlacksmithTrade(com.wdiscute.utils.MaybeStack stack, Rarity rarity, List<com.wdiscute.utils.MaybeStack> cost, int weight) Creates an instance of aBlacksmithTraderecord class.- Parameters:
stack- the value for thestackrecord componentrarity- the value for therarityrecord componentcost- the value for thecostrecord componentweight- the value for theweightrecord component
-
-
Method Details
-
getRandomTrade
-
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
-
cost
Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-