Record Class MapItemSavedData.MapPatch
java.lang.Object
java.lang.Record
net.minecraft.world.level.saveddata.maps.MapItemSavedData.MapPatch
- Enclosing class:
MapItemSavedData
public static record MapItemSavedData.MapPatch(int startX, int startY, int width, int height, byte[] mapColors)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theheight
record component.private final byte[]
The field for themapColors
record component.private final int
The field for thestartX
record component.private final int
The field for thestartY
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, Optional<MapItemSavedData.MapPatch>> private final int
The field for thewidth
record component. -
Constructor Summary
ConstructorDescriptionMapPatch
(int startX, int startY, int width, int height, byte[] mapColors) Creates an instance of aMapPatch
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyToMap
(MapItemSavedData p_164833_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
height()
Returns the value of theheight
record component.byte[]
Returns the value of themapColors
record component.private static Optional
<MapItemSavedData.MapPatch> read
(io.netty.buffer.ByteBuf p_332582_) int
startX()
Returns the value of thestartX
record component.int
startY()
Returns the value of thestartY
record component.final String
toString()
Returns a string representation of this record class.int
width()
Returns the value of thewidth
record component.private static void
write
(io.netty.buffer.ByteBuf p_334846_, Optional<MapItemSavedData.MapPatch> p_333957_)
-
Field Details
-
startX
private final int startXThe field for thestartX
record component. -
startY
private final int startYThe field for thestartY
record component. -
width
private final int widthThe field for thewidth
record component. -
height
private final int heightThe field for theheight
record component. -
mapColors
private final byte[] mapColorsThe field for themapColors
record component. -
STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf,Optional<MapItemSavedData.MapPatch>> STREAM_CODEC
-
-
Constructor Details
-
MapPatch
public MapPatch(int startX, int startY, int width, int height, byte[] mapColors) Creates an instance of aMapPatch
record class.- Parameters:
startX
- the value for thestartX
record componentstartY
- the value for thestartY
record componentwidth
- the value for thewidth
record componentheight
- the value for theheight
record componentmapColors
- the value for themapColors
record component
-
-
Method Details
-
write
private static void write(io.netty.buffer.ByteBuf p_334846_, Optional<MapItemSavedData.MapPatch> p_333957_) -
read
-
applyToMap
-
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 '=='. -
startX
public int startX()Returns the value of thestartX
record component.- Returns:
- the value of the
startX
record component
-
startY
public int startY()Returns the value of thestartY
record component.- Returns:
- the value of the
startY
record component
-
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
public int height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
mapColors
public byte[] mapColors()Returns the value of themapColors
record component.- Returns:
- the value of the
mapColors
record component
-