diff --git a/common/src/main/java/dev/architectury/hooks/item/tool/AxeItemHooks.java b/common/src/main/java/dev/architectury/hooks/item/tool/AxeItemHooks.java index 2ef21544..117ec67c 100644 --- a/common/src/main/java/dev/architectury/hooks/item/tool/AxeItemHooks.java +++ b/common/src/main/java/dev/architectury/hooks/item/tool/AxeItemHooks.java @@ -10,7 +10,20 @@ import java.util.HashMap; public final class AxeItemHooks { private AxeItemHooks() { } - + + /** + * Adds a new stripping (interact with axe) recipe to the game.

+ * + * Note that both the input block and the result block must have the + * {@link net.minecraft.world.level.block.state.properties.BlockStateProperties#AXIS AXIS} property, + * and that the value of this property will be copied from the input block to the result block when the recipe + * is performed. + * + * @param input input block + * @param result result block + * @throws IllegalArgumentException if the input or result blocks do not have the + * {@link net.minecraft.world.level.block.state.properties.BlockStateProperties#AXIS AXIS} property. + */ public static void addStrippingRecipe(Block input, Block result) { if (!input.defaultBlockState().hasProperty(RotatedPillarBlock.AXIS)) throw new IllegalArgumentException("Input block is missing required 'AXIS' property!"); diff --git a/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java b/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java index c29e2cd4..d226cebe 100644 --- a/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java +++ b/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java @@ -13,11 +13,26 @@ import java.util.function.Predicate; public final class HoeItemHooks { private HoeItemHooks() { } - - public static void addTillingRecipe(Block src, Predicate predicate, Consumer action) { + + /** + * Adds a new tilling (interact with hoe) recipe to the game.

+ * + * Tilling uses a predicate/consumer pair system: + *

+ * + * @param input input block + * @param predicate context predicate + * @param action action to run + */ + public static void addTillingRecipe(Block input, Predicate predicate, Consumer action) { if (HoeItem.TILLABLES instanceof ImmutableMap) { HoeItem.TILLABLES = new HashMap<>(HoeItem.TILLABLES); } - HoeItem.TILLABLES.put(src, new Pair<>(predicate, action)); + HoeItem.TILLABLES.put(input, new Pair<>(predicate, action)); } } diff --git a/common/src/main/java/dev/architectury/hooks/item/tool/ShovelItemHooks.java b/common/src/main/java/dev/architectury/hooks/item/tool/ShovelItemHooks.java index b13b069a..f08d2493 100644 --- a/common/src/main/java/dev/architectury/hooks/item/tool/ShovelItemHooks.java +++ b/common/src/main/java/dev/architectury/hooks/item/tool/ShovelItemHooks.java @@ -10,7 +10,20 @@ import java.util.HashMap; public final class ShovelItemHooks { private ShovelItemHooks() { } - + + /** + * Adds a new flattening (interact with shovel) recipe to the game.

+ * + * Notes: + *

+ * + * @param input input block + * @param result result block state + */ public static void addFlatteningRecipe(Block input, BlockState result) { if (ShovelItem.FLATTENABLES instanceof ImmutableMap) { ShovelItem.FLATTENABLES = new HashMap<>(ShovelItem.FLATTENABLES);