Record Class TradeListPacket.Trade
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket.Trade
- All Implemented Interfaces:
NetworkBuffer.Writer
- Enclosing class:
TradeListPacket
public static record TradeListPacket.Trade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
extends Record
implements NetworkBuffer.Writer
-
Constructor Summary
ConstructorDescriptionTrade
(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand) Creates an instance of aTrade
record class.Trade
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionint
demand()
Returns the value of thedemand
record component.final boolean
Indicates whether some other object is "equal to" this one.int
exp()
Returns the value of theexp
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinputItem1
record component.Returns the value of theinputItem2
record component.int
Returns the value of themaxTradeUsesNumber
record component.float
Returns the value of thepriceMultiplier
record component.result()
Returns the value of theresult
record component.int
Returns the value of thespecialPrice
record component.final String
toString()
Returns a string representation of this record class.boolean
Returns the value of thetradeDisabled
record component.int
Returns the value of thetradeUsesNumber
record component.void
write
(@NotNull NetworkBuffer writer)
-
Constructor Details
-
Trade
-
Trade
public Trade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand) Creates an instance of aTrade
record class.- Parameters:
inputItem1
- the value for theinputItem1
record componentresult
- the value for theresult
record componentinputItem2
- the value for theinputItem2
record componenttradeDisabled
- the value for thetradeDisabled
record componenttradeUsesNumber
- the value for thetradeUsesNumber
record componentmaxTradeUsesNumber
- the value for themaxTradeUsesNumber
record componentexp
- the value for theexp
record componentspecialPrice
- the value for thespecialPrice
record componentpriceMultiplier
- the value for thepriceMultiplier
record componentdemand
- the value for thedemand
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
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 '=='. -
inputItem1
Returns the value of theinputItem1
record component.- Returns:
- the value of the
inputItem1
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-
inputItem2
Returns the value of theinputItem2
record component.- Returns:
- the value of the
inputItem2
record component
-
tradeDisabled
public boolean tradeDisabled()Returns the value of thetradeDisabled
record component.- Returns:
- the value of the
tradeDisabled
record component
-
tradeUsesNumber
public int tradeUsesNumber()Returns the value of thetradeUsesNumber
record component.- Returns:
- the value of the
tradeUsesNumber
record component
-
maxTradeUsesNumber
public int maxTradeUsesNumber()Returns the value of themaxTradeUsesNumber
record component.- Returns:
- the value of the
maxTradeUsesNumber
record component
-
exp
public int exp()Returns the value of theexp
record component.- Returns:
- the value of the
exp
record component
-
specialPrice
public int specialPrice()Returns the value of thespecialPrice
record component.- Returns:
- the value of the
specialPrice
record component
-
priceMultiplier
public float priceMultiplier()Returns the value of thepriceMultiplier
record component.- Returns:
- the value of the
priceMultiplier
record component
-
demand
public int demand()Returns the value of thedemand
record component.- Returns:
- the value of the
demand
record component
-