Record Class MapDataPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.MapDataPacket
- All Implemented Interfaces:
NetworkBuffer.Writer
,SendablePacket
,ServerPacket
public record MapDataPacket(int mapId, byte scale, boolean locked, boolean trackingPosition, @NotNull List<MapDataPacket.Icon> icons, MapDataPacket.ColorContent colorContent)
extends Record
implements ServerPacket
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
-
Constructor Summary
ConstructorDescriptionMapDataPacket
(int mapId, byte scale, boolean locked, boolean trackingPosition, @NotNull List<MapDataPacket.Icon> icons, MapDataPacket.ColorContent colorContent) Creates an instance of aMapDataPacket
record class.MapDataPacket
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolorContent
record component.final boolean
Indicates whether some other object is "equal to" this one.int
getId()
Gets the id of this packet.final int
hashCode()
Returns a hash code value for this object.@NotNull List<MapDataPacket.Icon>
icons()
Returns the value of theicons
record component.boolean
locked()
Returns the value of thelocked
record component.int
mapId()
Returns the value of themapId
record component.byte
scale()
Returns the value of thescale
record component.final String
toString()
Returns a string representation of this record class.boolean
Returns the value of thetrackingPosition
record component.void
write
(@NotNull NetworkBuffer writer)
-
Constructor Details
-
MapDataPacket
public MapDataPacket(int mapId, byte scale, boolean locked, boolean trackingPosition, @NotNull @NotNull List<MapDataPacket.Icon> icons, @Nullable MapDataPacket.ColorContent colorContent) Creates an instance of aMapDataPacket
record class.- Parameters:
mapId
- the value for themapId
record componentscale
- the value for thescale
record componentlocked
- the value for thelocked
record componenttrackingPosition
- the value for thetrackingPosition
record componenticons
- the value for theicons
record componentcolorContent
- the value for thecolorContent
record component
-
MapDataPacket
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
getId
public int getId()Description copied from interface:ServerPacket
Gets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getId
in 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 '=='. -
mapId
public int mapId()Returns the value of themapId
record component.- Returns:
- the value of the
mapId
record component
-
scale
public byte scale()Returns the value of thescale
record component.- Returns:
- the value of the
scale
record component
-
locked
public boolean locked()Returns the value of thelocked
record component.- Returns:
- the value of the
locked
record component
-
trackingPosition
public boolean trackingPosition()Returns the value of thetrackingPosition
record component.- Returns:
- the value of the
trackingPosition
record component
-
icons
Returns the value of theicons
record component.- Returns:
- the value of the
icons
record component
-
colorContent
Returns the value of thecolorContent
record component.- Returns:
- the value of the
colorContent
record component
-