diff --git a/dough-items/src/main/java/io/github/bakedlibs/dough/items/ItemStackEditor.java b/dough-items/src/main/java/io/github/bakedlibs/dough/items/ItemStackEditor.java index d86268ef..32a0bfdb 100644 --- a/dough-items/src/main/java/io/github/bakedlibs/dough/items/ItemStackEditor.java +++ b/dough-items/src/main/java/io/github/bakedlibs/dough/items/ItemStackEditor.java @@ -92,6 +92,14 @@ public ItemStackEditor andMetaConsumer(Consumer consumer) { return withMetaConsumer(this.metaTransform.andThen(consumer)); } + public ItemStackEditor andMetaConsumer(Class clazz, Consumer consumer) { + return andMetaConsumer(meta -> { + if (clazz.isInstance(meta)) { + consumer.accept(clazz.cast(meta)); + } + }); + } + public ItemStackEditor withMetaConsumer(@Nullable Consumer consumer) { return new ItemStackEditor(this.itemStack, consumer, this.stackTransform); }