Class GhostMultiblockShape.Builder

java.lang.Object
com.portingdeadmods.portingdeadlibs.api.ghost.GhostMultiblockShape.Builder
Enclosing class:
GhostMultiblockShape

public static class GhostMultiblockShape.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • layer

      public GhostMultiblockShape.Builder layer(String... aisle)
      The multiblock definition itself.

      A layer call defines a single multiblock layer by continuous string params of the same length

      Eg. layer( "AAAAA", "AAAAA", "AACAA", )
    • controllerChar

      public GhostMultiblockShape.Builder controllerChar(char c)
      Define the character for the controller position
      At most there can be only one controller
      Parameters:
      c - Character used in the Layer
    • exposeHandlers

      public GhostMultiblockShape.Builder exposeHandlers(char c, net.minecraft.resources.ResourceLocation... handlers)
      It's recommended to only expose AT MOST 1 handler per type
      Parameters:
      c - Character used in the Layer
      handlers - Resource Location of the handler as defined in ContainerBlockEntity.handlers
    • withMenu

      public GhostMultiblockShape.Builder withMenu(char c, @Nullable @Nullable GhostPartMenuFactory factory)
      Lets you open custom menus per block instead of a centralised controller BE menu
      Parameters:
      c - Character used in the Layer
      factory - Lambda following GhostPartMenuFactory
    • onPlaceOffset

      public GhostMultiblockShape.Builder onPlaceOffset(int x, int y, int z)
      Taking the controller as an anchor, add an offset for placing following the idea that North is forward.

      It is generally recommended to offset the multiblock in such way that placing it is centered and all of the blocks are in the back of the place position.
      Parameters:
      x - offset
      y - offset
      z - offset
    • build

      public GhostMultiblockShape build()