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

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the height record component.
    private final byte[]
    The field for the mapColors record component.
    private final int
    The field for the startX record component.
    private final int
    The field for the startY record component.
    static final StreamCodec<io.netty.buffer.ByteBuf,Optional<MapItemSavedData.MapPatch>>
     
    private final int
    The field for the width record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapPatch(int startX, int startY, int width, int height, byte[] mapColors)
    Creates an instance of a MapPatch record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the height record component.
    byte[]
    Returns the value of the mapColors record component.
    read(io.netty.buffer.ByteBuf p_332582_)
     
    int
    Returns the value of the startX record component.
    int
    Returns the value of the startY record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the width record component.
    private static void
    write(io.netty.buffer.ByteBuf p_334846_, Optional<MapItemSavedData.MapPatch> p_333957_)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • startX

      private final int startX
      The field for the startX record component.
    • startY

      private final int startY
      The field for the startY record component.
    • width

      private final int width
      The field for the width record component.
    • height

      private final int height
      The field for the height record component.
    • mapColors

      private final byte[] mapColors
      The field for the mapColors 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 a MapPatch record class.
      Parameters:
      startX - the value for the startX record component
      startY - the value for the startY record component
      width - the value for the width record component
      height - the value for the height record component
      mapColors - the value for the mapColors record component
  • Method Details

    • write

      private static void write(io.netty.buffer.ByteBuf p_334846_, Optional<MapItemSavedData.MapPatch> p_333957_)
    • read

      private static Optional<MapItemSavedData.MapPatch> read(io.netty.buffer.ByteBuf p_332582_)
    • applyToMap

      public void applyToMap(MapItemSavedData p_164833_)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • startX

      public int startX()
      Returns the value of the startX record component.
      Returns:
      the value of the startX record component
    • startY

      public int startY()
      Returns the value of the startY record component.
      Returns:
      the value of the startY record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • mapColors

      public byte[] mapColors()
      Returns the value of the mapColors record component.
      Returns:
      the value of the mapColors record component