Record Class MultiblockShape.Box

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.multiblock.MultiblockShape.Box
Record Components:
casing - the block of its edges and corners (and of its anchor)
faces - blocks allowed in its walls (the casing, valves, ports, glass...)
interior - blocks allowed inside (e.g. only air for a tank)
minSize - the smallest outer size on each axis (at least 3)
maxSize - the largest outer size on each axis
width - the outer width and depth it must have, or 0 for any
openTop - no roof: the top layer is part of the interior, walls go round it
controller - a block that must be in the walls exactly once, or null
All Implemented Interfaces:
MultiblockShape
Enclosing interface:
MultiblockShape

public static record MultiblockShape.Box(@NotNull net.kyori.adventure.key.Key casing, @NotNull Set<net.kyori.adventure.key.Key> faces, @NotNull Predicate<net.kyori.adventure.key.Key> interior, int minSize, int maxSize, int width, boolean openTop, @Nullable net.kyori.adventure.key.Key controller) extends Record implements MultiblockShape
A hollow box: frame blocks make its six walls (an open top: five), casings every edge and corner, and its interior holds what interior allows. The anchor is its lowest corner.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface MultiblockShape

    MultiblockShape.Box, MultiblockShape.Pattern
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Box(@NotNull net.kyori.adventure.key.Key casing, @NotNull Set<net.kyori.adventure.key.Key> faces, @NotNull Predicate<net.kyori.adventure.key.Key> interior)
    A box of 3 to 18 blocks a side, of any width, closed, without a controller.
    Box(@NotNull net.kyori.adventure.key.Key casing, @NotNull Set<net.kyori.adventure.key.Key> faces, @NotNull Predicate<net.kyori.adventure.key.Key> interior, int minSize, int maxSize, int width, boolean openTop, @Nullable net.kyori.adventure.key.Key controller)
    Creates an instance of a Box record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Set<net.kyori.adventure.key.Key>
    Every block that can be part of the structure itself (not its interior).
    @NotNull net.kyori.adventure.key.Key
    Returns the value of the casing record component.
    @Nullable net.kyori.adventure.key.Key
    Returns the value of the controller record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull Set<net.kyori.adventure.key.Key>
    Returns the value of the faces record component.
    final int
    Returns a hash code value for this object.
    @NotNull Predicate<net.kyori.adventure.key.Key>
    Returns the value of the interior record component.
    int
    Returns the value of the maxSize record component.
    int
    Returns the value of the minSize record component.
    boolean
    Returns the value of the openTop record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the width record component.

    Methods inherited from class Object

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

  • Constructor Details

    • Box

      public Box(@NotNull @NotNull net.kyori.adventure.key.Key casing, @NotNull @NotNull Set<net.kyori.adventure.key.Key> faces, @NotNull @NotNull Predicate<net.kyori.adventure.key.Key> interior, int minSize, int maxSize, int width, boolean openTop, @Nullable @Nullable net.kyori.adventure.key.Key controller)
      Creates an instance of a Box record class.
      Parameters:
      casing - the value for the casing record component
      faces - the value for the faces record component
      interior - the value for the interior record component
      minSize - the value for the minSize record component
      maxSize - the value for the maxSize record component
      width - the value for the width record component
      openTop - the value for the openTop record component
      controller - the value for the controller record component
    • Box

      public Box(@NotNull @NotNull net.kyori.adventure.key.Key casing, @NotNull @NotNull Set<net.kyori.adventure.key.Key> faces, @NotNull @NotNull Predicate<net.kyori.adventure.key.Key> interior)
      A box of 3 to 18 blocks a side, of any width, closed, without a controller.
  • Method Details

    • blocks

      @NotNull public @NotNull Set<net.kyori.adventure.key.Key> blocks()
      Description copied from interface: MultiblockShape
      Every block that can be part of the structure itself (not its interior).
      Specified by:
      blocks in interface MultiblockShape
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • casing

      @NotNull public @NotNull net.kyori.adventure.key.Key casing()
      Returns the value of the casing record component.
      Returns:
      the value of the casing record component
    • faces

      @NotNull public @NotNull Set<net.kyori.adventure.key.Key> faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component
    • interior

      @NotNull public @NotNull Predicate<net.kyori.adventure.key.Key> interior()
      Returns the value of the interior record component.
      Returns:
      the value of the interior record component
    • minSize

      public int minSize()
      Returns the value of the minSize record component.
      Returns:
      the value of the minSize record component
    • maxSize

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

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

      public boolean openTop()
      Returns the value of the openTop record component.
      Returns:
      the value of the openTop record component
    • controller

      @Nullable public @Nullable net.kyori.adventure.key.Key controller()
      Returns the value of the controller record component.
      Returns:
      the value of the controller record component