Record Class MultiblockStructure
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.multiblock.MultiblockStructure
- Record Components:
min- the lowest corner of its bounding box (walls included)max- the highest corner of its bounding boxmembers- the blocks that make it, for aMultiblockShape.Pattern;nullfor a box, which is made of its whole bounding boxrotation- quarter turns clockwise (seen from above) a pattern was matched with; 0 for a boxcounts- for a box, what its interior holds, by block id; for a pattern, its blocks, by block idanchor- the block holding its storages: a box's lowest corner, a pattern's anchor character
public record MultiblockStructure(@NotNull MultiblockType type, @NotNull net.kyori.adventure.key.Key world, @NotNull BlockPosition min, @NotNull BlockPosition max, @NotNull BlockPosition anchorPosition, @Nullable Set<BlockPosition> members, int rotation, @NotNull Map<net.kyori.adventure.key.Key, Integer> counts)
extends Record
A formed multiblock (D33).
-
Constructor Summary
ConstructorsConstructorDescriptionMultiblockStructure(@NotNull MultiblockType type, @NotNull net.kyori.adventure.key.Key world, @NotNull BlockPosition min, @NotNull BlockPosition max, @NotNull BlockPosition anchorPosition, @Nullable Set<BlockPosition> members, int rotation, @NotNull Map<net.kyori.adventure.key.Key, Integer> counts) Creates an instance of aMultiblockStructurerecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull WorldPositionanchor()@NotNull BlockPositionReturns the value of theanchorPositionrecord component.booleancontains(@NotNull WorldPosition position) Whetherpositionis part of the structure (for a box: anywhere in it, interior included).intcount(@NotNull net.kyori.adventure.key.Key block) How manyblockit counts (counts).counts()Returns the value of thecountsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Outer height in blocks.@NotNull BlockPositionmax()Returns the value of themaxrecord component.@Nullable Set<BlockPosition> members()Returns the value of themembersrecord component.@NotNull BlockPositionmin()Returns the value of theminrecord component.booleanoverlaps(@NotNull MultiblockStructure other) Whether it shares a block withother.introtation()Returns the value of therotationrecord component.final StringtoString()Returns a string representation of this record class.@NotNull MultiblockTypetype()Returns the value of thetyperecord component.intvolume()A box's interior volume in blocks; for a pattern, its number of blocks.@NotNull net.kyori.adventure.key.Keyworld()Returns the value of theworldrecord component.
-
Constructor Details
-
MultiblockStructure
public MultiblockStructure(@NotNull @NotNull MultiblockType type, @NotNull @NotNull net.kyori.adventure.key.Key world, @NotNull @NotNull BlockPosition min, @NotNull @NotNull BlockPosition max, @NotNull @NotNull BlockPosition anchorPosition, @Nullable @Nullable Set<BlockPosition> members, int rotation, @NotNull @NotNull Map<net.kyori.adventure.key.Key, Integer> counts) Creates an instance of aMultiblockStructurerecord class.- Parameters:
type- the value for thetyperecord componentworld- the value for theworldrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentanchorPosition- the value for theanchorPositionrecord componentmembers- the value for themembersrecord componentrotation- the value for therotationrecord componentcounts- the value for thecountsrecord component
-
-
Method Details
-
anchor
-
contains
Whetherpositionis part of the structure (for a box: anywhere in it, interior included). -
overlaps
Whether it shares a block withother. -
volume
public int volume()A box's interior volume in blocks; for a pattern, its number of blocks. -
height
public int height()Outer height in blocks. -
count
public int count(@NotNull @NotNull net.kyori.adventure.key.Key block) How manyblockit counts (counts). -
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. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
world
@NotNull public @NotNull net.kyori.adventure.key.Key world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-
min
-
max
-
anchorPosition
Returns the value of theanchorPositionrecord component.- Returns:
- the value of the
anchorPositionrecord component
-
members
-
rotation
-
counts
-