From bd30015bbd7c6756ac799660443348210886fae7 Mon Sep 17 00:00:00 2001 From: Guillaume Mercier <10gui-gui10@live.ca> Date: Wed, 21 Jan 2026 13:53:47 -0500 Subject: [PATCH] add stack handlers for item -> item+meta --- .../api/ItemStackReplacementManager.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java b/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java index c07b68b..403b8af 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java +++ b/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java @@ -127,6 +127,32 @@ public class ItemStackReplacementManager { addItemReplacement(originalId, OreDictionary.WILDCARD_VALUE, item, newMeta, skipBlockRemap); } + // item -> stack + + /** + * Adds a mapping to remap stacks of a given item to another item with a given damage/meta value. This also adds a + * matching block replacement if this item happens to be an ItemBlock. + * + * @param originalId The id of the item to remap. + * @param stack The item to remap to. + */ + @SuppressWarnings("unused") + public static void addItemReplacement(@Nonnull String originalId, @Nonnull ItemStack stack) { + addItemReplacement(originalId, OreDictionary.WILDCARD_VALUE, stack.getItem(), Items.feather.getDamage(stack), false); + } + + /** + * Adds a mapping to remap stacks of a given item to another item with a given damage/meta value. + * + * @param originalId The id of the item to remap. + * @param stack A stack of the item to replace to. + * @param skipBlockRemap Set to true to skip auto-adding a block remapper if the item happens to be an ItemBlock. + */ + @SuppressWarnings("unused") + public static void addItemReplacement(@Nonnull String originalId, @Nonnull ItemStack stack, boolean skipBlockRemap) { + addItemReplacement(originalId, OreDictionary.WILDCARD_VALUE, stack.getItem(), Items.feather.getDamage(stack), skipBlockRemap); + } + // item+meta -> stack /**