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 axiswidth- the outer width and depth it must have, or 0 for anyopenTop- no roof: the top layer is part of the interior, walls go round itcontroller- a block that must be in the walls exactly once, ornull
- 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 -
Constructor Summary
ConstructorsConstructorDescriptionBox(@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 aBoxrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Set<net.kyori.adventure.key.Key> blocks()Every block that can be part of the structure itself (not its interior).@NotNull net.kyori.adventure.key.Keycasing()Returns the value of thecasingrecord component.@Nullable net.kyori.adventure.key.KeyReturns the value of thecontrollerrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull Set<net.kyori.adventure.key.Key> faces()Returns the value of thefacesrecord component.final inthashCode()Returns a hash code value for this object.@NotNull Predicate<net.kyori.adventure.key.Key> interior()Returns the value of theinteriorrecord component.intmaxSize()Returns the value of themaxSizerecord component.intminSize()Returns the value of theminSizerecord component.booleanopenTop()Returns the value of theopenToprecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
MIN_SIZE
public static final int MIN_SIZE- See Also:
-
MAX_SIZE
public static final int MAX_SIZE- See Also:
-
-
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 aBoxrecord class.- Parameters:
casing- the value for thecasingrecord componentfaces- the value for thefacesrecord componentinterior- the value for theinteriorrecord componentminSize- the value for theminSizerecord componentmaxSize- the value for themaxSizerecord componentwidth- the value for thewidthrecord componentopenTop- the value for theopenToprecord componentcontroller- the value for thecontrollerrecord component
-
Box
-
-
Method Details
-
blocks
Description copied from interface:MultiblockShapeEvery block that can be part of the structure itself (not its interior).- Specified by:
blocksin interfaceMultiblockShape
-
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. -
casing
-
faces
-
interior
-
minSize
-
maxSize
-
width
-
openTop
-
controller
@Nullable public @Nullable net.kyori.adventure.key.Key controller()Returns the value of thecontrollerrecord component.- Returns:
- the value of the
controllerrecord component
-