Interface ICraftingMachine


public interface ICraftingMachine
Provides crafting services to adjacent pattern providers for automatic crafting. Can be provided via capability on your block entity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup<ICraftingMachine,net.minecraft.core.Direction>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail, you can try inserting into the inventory instead.
    default Optional<net.minecraft.network.chat.Component>
     
    of(net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.core.Direction side)
     
    boolean
    pushPattern(IPatternDetails patternDetails, KeyCounter[] inputs, net.minecraft.core.Direction ejectionDirection)
    inserts a crafting plan, and the necessary items into the crafting machine.
  • Field Details

    • SIDED

      static final net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup<ICraftingMachine,net.minecraft.core.Direction> SIDED
  • Method Details

    • of

      @Nullable static ICraftingMachine of(@Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.core.Direction side)
    • getDisplayName

      default Optional<net.minecraft.network.chat.Component> getDisplayName()
      Returns:
      An optional name for this crafting machine, which can be shown in the pattern provider terminal for adjacent pattern providers that point to this crafting machine.
    • pushPattern

      boolean pushPattern(IPatternDetails patternDetails, KeyCounter[] inputs, net.minecraft.core.Direction ejectionDirection)
      inserts a crafting plan, and the necessary items into the crafting machine.
      Returns:
      if it was accepted, all or nothing.
    • acceptsPlans

      boolean acceptsPlans()
      check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail, you can try inserting into the inventory instead.
      Returns:
      true, if pushPattern can complete, if its false push will always be false.