Class Multiblocks

java.lang.Object
fr.robie.machineengine.api.multiblock.Multiblocks

public final class Multiblocks extends Object
Finding multiblocks in the world, and the formed ones (D33). Detection only reads blocks, through a blockAt function (MachineWorld.blockAt(BlockPosition) for a machine), so it runs on the thread that owns them; every block must be loaded and owned.
  • Method Details

    • containing

      @Nullable public static @Nullable MultiblockStructure containing(@NotNull @NotNull WorldPosition position)
      The formed structure position belongs to, or null.
    • form

      public static void form(@NotNull @NotNull MultiblockStructure structure)
      Records a formed structure; one overlapping it (rebuilt bigger, smaller or turned) is replaced.
    • unform

      public static void unform(@NotNull @NotNull MultiblockStructure structure)
    • clear

      public static void clear()
      Forgets every structure (tests).
    • detect

      @Nullable public static @Nullable MultiblockStructure detect(@NotNull @NotNull MachineContext context, @NotNull @NotNull WorldPosition start, @NotNull @NotNull MultiblockType type)
      detect(Key, Function, BlockPosition, MultiblockType) with the machine's own world view.
    • detect

      @Nullable public static @Nullable MultiblockStructure detect(@NotNull @NotNull net.kyori.adventure.key.Key world, @NotNull @NotNull Function<BlockPosition, net.kyori.adventure.key.Key> blockAt, @NotNull @NotNull BlockPosition start, @NotNull @NotNull MultiblockType type)
      The structure of type that the block at start is part of, or null if there is no complete one.
      Parameters:
      blockAt - the block id at a position, null when not loaded or not owned