Interface ICraftingMachine
public interface ICraftingMachine
Provides crafting services to adjacent pattern providers for automatic crafting. Can be provided via capability on
your block entity.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.Describe how this machine is displayed and grouped in the pattern access terminal.static @Nullable ICraftingMachine
of
(@Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.core.Direction side) static @Nullable ICraftingMachine
of
(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, 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.
-
Method Details
-
of
@Nullable static @Nullable ICraftingMachine of(@Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.core.Direction side) -
of
@Nullable static @Nullable ICraftingMachine of(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) -
getCraftingMachineInfo
PatternContainerGroup getCraftingMachineInfo()Describe how this machine is displayed and grouped in the pattern access terminal. -
pushPattern
boolean pushPattern(IPatternDetails patternDetails, KeyCounter[] inputs, net.minecraft.core.Direction ejectionDirection) inserts a crafting plan, and the necessary items into the crafting machine.- Parameters:
inputs
- The crafting ingredients. The array layout corresponds toIPatternDetails.getInputs()
ofpatternDetails
.- 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.
-