Record Class TradeListPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket
- All Implemented Interfaces:
NetworkBuffer.Writer,SendablePacket,ServerPacket
public record TradeListPacket(int windowId, @NotNull List<TradeListPacket.Trade> trades, int villagerLevel, int experience, boolean regularVillager, boolean canRestock)
extends Record
implements ServerPacket
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTradeListPacket(int windowId, @NotNull List<TradeListPacket.Trade> trades, int villagerLevel, int experience, boolean regularVillager, boolean canRestock) Creates an instance of aTradeListPacketrecord class.TradeListPacket(@NotNull NetworkBuffer reader) -
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.intgetId(@NotNull ConnectionState state) Gets the id of this packet.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.@NotNull List<TradeListPacket.Trade> trades()Returns the value of thetradesrecord component.intReturns the value of thevillagerLevelrecord component.intwindowId()Returns the value of thewindowIdrecord component.voidwrite(@NotNull NetworkBuffer writer)
-
Constructor Details
-
TradeListPacket
public TradeListPacket(int windowId, @NotNull @NotNull 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
-
TradeListPacket
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
getId
Description copied from interface:ServerPacketGets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getIdin interfaceServerPacket- Returns:
- the id of this packet
-
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 '=='. -
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
-