Record Class ClientboundMapItemDataPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundMapItemDataPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundMapItemDataPacket(MapId mapId, byte scale, boolean locked, Optional<List<MapDecoration>> decorations, Optional<MapItemSavedData.MapPatch> colorPatch)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<MapItemSavedData.MapPatch> The field for thecolorPatchrecord component.private final Optional<List<MapDecoration>> The field for thedecorationsrecord component.private final booleanThe field for thelockedrecord component.private final MapIdThe field for themapIdrecord component.private final byteThe field for thescalerecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundMapItemDataPacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundMapItemDataPacket(MapId mapId, byte scale, boolean locked, @Nullable Collection<MapDecoration> decorations, @Nullable MapItemSavedData.MapPatch colorPatch) ClientboundMapItemDataPacket(MapId mapId, byte scale, boolean locked, Optional<List<MapDecoration>> decorations, Optional<MapItemSavedData.MapPatch> colorPatch) Creates an instance of aClientboundMapItemDataPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets new MapData from the packet to given MapData paramReturns the value of thecolorPatchrecord component.Returns the value of thedecorationsrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.booleanlocked()Returns the value of thelockedrecord component.mapId()Returns the value of themapIdrecord component.bytescale()Returns the value of thescalerecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
mapId
The field for themapIdrecord component. -
scale
private final byte scaleThe field for thescalerecord component. -
locked
private final boolean lockedThe field for thelockedrecord component. -
decorations
The field for thedecorationsrecord component. -
colorPatch
The field for thecolorPatchrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundMapItemDataPacket
public ClientboundMapItemDataPacket(MapId mapId, byte scale, boolean locked, @Nullable Collection<MapDecoration> decorations, @Nullable MapItemSavedData.MapPatch colorPatch) -
ClientboundMapItemDataPacket
public ClientboundMapItemDataPacket(MapId mapId, byte scale, boolean locked, Optional<List<MapDecoration>> decorations, Optional<MapItemSavedData.MapPatch> colorPatch) Creates an instance of aClientboundMapItemDataPacketrecord class.- Parameters:
mapId- the value for themapIdrecord componentscale- the value for thescalerecord componentlocked- the value for thelockedrecord componentdecorations- the value for thedecorationsrecord componentcolorPatch- the value for thecolorPatchrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
applyToMap
Sets new MapData from the packet to given MapData param -
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. -
mapId
Returns the value of themapIdrecord component.- Returns:
- the value of the
mapIdrecord component
-
scale
public byte scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
locked
public boolean locked()Returns the value of thelockedrecord component.- Returns:
- the value of the
lockedrecord component
-
decorations
Returns the value of thedecorationsrecord component.- Returns:
- the value of the
decorationsrecord component
-
colorPatch
Returns the value of thecolorPatchrecord component.- Returns:
- the value of the
colorPatchrecord component
-