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
ConstructorsConstructorDescriptionTrade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand) Creates an instance of aTraderecord class.Trade(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionintdemand()Returns the value of thedemandrecord component.final booleanIndicates whether some other object is "equal to" this one.intexp()Returns the value of theexprecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinputItem1record component.Returns the value of theinputItem2record component.intReturns the value of themaxTradeUsesNumberrecord component.floatReturns the value of thepriceMultiplierrecord component.result()Returns the value of theresultrecord component.intReturns the value of thespecialPricerecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetradeDisabledrecord component.intReturns the value of thetradeUsesNumberrecord component.voidwrite(@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 aTraderecord class.- Parameters:
inputItem1- the value for theinputItem1record componentresult- the value for theresultrecord componentinputItem2- the value for theinputItem2record componenttradeDisabled- the value for thetradeDisabledrecord componenttradeUsesNumber- the value for thetradeUsesNumberrecord componentmaxTradeUsesNumber- the value for themaxTradeUsesNumberrecord componentexp- the value for theexprecord componentspecialPrice- the value for thespecialPricerecord componentpriceMultiplier- the value for thepriceMultiplierrecord componentdemand- the value for thedemandrecord component
-
-
Method Details
-
write
- Specified by:
writein 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 theinputItem1record component.- Returns:
- the value of the
inputItem1record component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
inputItem2
Returns the value of theinputItem2record component.- Returns:
- the value of the
inputItem2record component
-
tradeDisabled
public boolean tradeDisabled()Returns the value of thetradeDisabledrecord component.- Returns:
- the value of the
tradeDisabledrecord component
-
tradeUsesNumber
public int tradeUsesNumber()Returns the value of thetradeUsesNumberrecord component.- Returns:
- the value of the
tradeUsesNumberrecord component
-
maxTradeUsesNumber
public int maxTradeUsesNumber()Returns the value of themaxTradeUsesNumberrecord component.- Returns:
- the value of the
maxTradeUsesNumberrecord component
-
exp
public int exp()Returns the value of theexprecord component.- Returns:
- the value of the
exprecord component
-
specialPrice
public int specialPrice()Returns the value of thespecialPricerecord component.- Returns:
- the value of the
specialPricerecord component
-
priceMultiplier
public float priceMultiplier()Returns the value of thepriceMultiplierrecord component.- Returns:
- the value of the
priceMultiplierrecord component
-
demand
public int demand()Returns the value of thedemandrecord component.- Returns:
- the value of the
demandrecord component
-