Record Class Schematic

java.lang.Object
java.lang.Record
dev.flavored.bamboo.Schematic
Record Components:
width - The width of the schematic.
height - The height of the schematic.
length - The length of the schematic.
offset - The offset of the schematic.
blocks - The block data of the schematic.

public record Schematic(short width, short height, short length, net.minestom.server.coordinate.Point offset, List<net.minestom.server.instance.block.Block> blocks) extends Record
Represents a schematic.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A builder for Schematic.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Schematic(short width, short height, short length, net.minestom.server.coordinate.Point offset, List<net.minestom.server.instance.block.Block> blocks)
    Creates an instance of a Schematic record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<net.minestom.server.instance.block.Block>
    Returns the value of the blocks record component.
    Creates a new Schematic.Builder for Schematic.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    short
    Returns the value of the height record component.
    short
    Returns the value of the length record component.
    net.minestom.server.coordinate.Point
    Returns the value of the offset record component.
    void
    paste(net.minestom.server.instance.Instance instance, net.minestom.server.coordinate.Point position)
    Paste the schematic at the specified position in a given Instance.
    final String
    Returns a string representation of this record class.
    short
    Returns the value of the width record component.

    Methods inherited from class java.lang.Object

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

    • Schematic

      public Schematic(short width, short height, short length, net.minestom.server.coordinate.Point offset, List<net.minestom.server.instance.block.Block> blocks)
      Creates an instance of a Schematic record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
      length - the value for the length record component
      offset - the value for the offset record component
      blocks - the value for the blocks record component
  • Method Details

    • builder

      public static Schematic.Builder builder()
      Creates a new Schematic.Builder for Schematic.
      Returns:
      A new schematic builder.
    • paste

      public void paste(net.minestom.server.instance.Instance instance, net.minestom.server.coordinate.Point position)
      Paste the schematic at the specified position in a given Instance.
      Parameters:
      instance - The instance where the schematic will be pasted.
      position - The position where the schematic will be pasted.
    • 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.
    • width

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

      public short height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • length

      public short length()
      Returns the value of the length record component.
      Returns:
      the value of the length record component
    • offset

      public net.minestom.server.coordinate.Point offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • blocks

      public List<net.minestom.server.instance.block.Block> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component