Record Class TradeListPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket
- All Implemented Interfaces:
SendablePacket, ServerPacket, ServerPacket.Play
public record TradeListPacket(int windowId, List<TradeListPacket.Trade> trades, int villagerLevel, int experience, boolean regularVillager, boolean canRestock)
extends Record
implements ServerPacket.Play
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordNested classes/interfaces inherited from interface ServerPacket
ServerPacket.ComponentHolding, ServerPacket.Configuration, ServerPacket.Login, ServerPacket.Play, ServerPacket.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final NetworkBuffer.Type<TradeListPacket> -
Constructor Summary
ConstructorsConstructorDescriptionTradeListPacket(int windowId, List<TradeListPacket.Trade> trades, int villagerLevel, int experience, boolean regularVillager, boolean canRestock) Creates an instance of aTradeListPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanRestockrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theexperiencerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theregularVillagerrecord component.final StringtoString()Returns a string representation of this record class.trades()Returns the value of thetradesrecord component.intReturns the value of thevillagerLevelrecord component.intwindowId()Returns the value of thewindowIdrecord component.
-
Field Details
-
MAX_TRADES
public static final int MAX_TRADES- See Also:
-
SERIALIZER
-
-
Constructor Details
-
TradeListPacket
public TradeListPacket(int windowId, List<TradeListPacket.Trade> trades, int villagerLevel, int experience, boolean regularVillager, boolean canRestock) Creates an instance of aTradeListPacketrecord class.- Parameters:
windowId- the value for thewindowIdrecord componenttrades- the value for thetradesrecord componentvillagerLevel- the value for thevillagerLevelrecord componentexperience- the value for theexperiencerecord componentregularVillager- the value for theregularVillagerrecord componentcanRestock- the value for thecanRestockrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
windowId
public int windowId()Returns the value of thewindowIdrecord component.- Returns:
- the value of the
windowIdrecord component
-
trades
Returns the value of thetradesrecord component.- Returns:
- the value of the
tradesrecord component
-
villagerLevel
public int villagerLevel()Returns the value of thevillagerLevelrecord component.- Returns:
- the value of the
villagerLevelrecord component
-
experience
public int experience()Returns the value of theexperiencerecord component.- Returns:
- the value of the
experiencerecord component
-
regularVillager
public boolean regularVillager()Returns the value of theregularVillagerrecord component.- Returns:
- the value of the
regularVillagerrecord component
-
canRestock
public boolean canRestock()Returns the value of thecanRestockrecord component.- Returns:
- the value of the
canRestockrecord component
-