Interface MachineBlocks


public interface MachineBlocks
Changes machine and transport blocks in the world. Implemented by the block integration (CraftEngine); current() is empty headless and before MachineEngine has enabled.
  • Method Details

    • replaceBlock

      boolean replaceBlock(@NotNull @NotNull WorldPosition position, @NotNull @NotNull net.kyori.adventure.key.Key blockId, @Nullable @Nullable Direction facing)
      Replaces the machine block at position by the block blockId (another machine, e.g. the next tier), keeping what the machine holds. Owner thread only. Nothing drops: the new machine takes the contents over.
      Parameters:
      facing - the new block's facing, or null for the old one
      Returns:
      false if there is no machine there, it is busy (a process that cannot be cancelled, a transfer in flight), or the block could not be placed; nothing changed then
    • replaceBlock

      default boolean replaceBlock(@NotNull @NotNull WorldPosition position, @NotNull @NotNull net.kyori.adventure.key.Key blockId)
    • cycleTransportSide

      @Nullable @Nullable TransportSideMode cycleTransportSide(@NotNull @NotNull WorldPosition position, @NotNull @NotNull Direction side)
      Cycles how side of the transport at position connects (default, pull, push, none), e.g. with a configurator. Owner thread only.
      Returns:
      the new mode, or null if there is no transport there
    • current

      @Nullable static @Nullable MachineBlocks current()
      The running server's block integration, or null.
    • setCurrent

      @Internal static void setCurrent(@Nullable @Nullable MachineBlocks blocks)
      Set by the block integration when it starts and stops.