From e8a650043422f8d854a71298ece0cd693c48c8db Mon Sep 17 00:00:00 2001 From: MRH0 Date: Wed, 4 Aug 2021 02:20:40 +0200 Subject: [PATCH] Added tag for improved integration in DeployerApplicationRecipe + Added create:sandpaper to AllRecipeTypes and datagen. ~ Changed hardcoded list of sandpaper items to Tag. This would enable me to include the Diamond Grit Sandpaper from CC&A in the deployer recipe. Node: There might be more applications for this tag. --- .../resources/data/create/tags/items/sandpaper.json | 7 +++++++ src/main/java/com/simibubi/create/AllItems.java | 2 ++ src/main/java/com/simibubi/create/AllTags.java | 3 ++- .../components/deployer/DeployerApplicationRecipe.java | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/generated/resources/data/create/tags/items/sandpaper.json diff --git a/src/generated/resources/data/create/tags/items/sandpaper.json b/src/generated/resources/data/create/tags/items/sandpaper.json new file mode 100644 index 000000000..acab7913a --- /dev/null +++ b/src/generated/resources/data/create/tags/items/sandpaper.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "create:sand_paper", + "create:red_sand_paper" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 5103e0aa6..728ac0894 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -228,11 +228,13 @@ public class AllItems { public static final ItemEntry SAND_PAPER = REGISTRATE.item("sand_paper", SandPaperItem::new) .transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new)) + .tag(AllTags.AllItemTags.SANDPAPER.tag) .register(); public static final ItemEntry RED_SAND_PAPER = REGISTRATE.item("red_sand_paper", SandPaperItem::new) .transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new)) .onRegister(s -> TooltipHelper.referTo(s, SAND_PAPER)) + .tag(AllTags.AllItemTags.SANDPAPER.tag) .register(); public static final ItemEntry WRENCH = REGISTRATE.item("wrench", WrenchItem::new) diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index a3542f906..51269fc2c 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -84,7 +84,8 @@ public class AllTags { INGOTS(FORGE), NUGGETS(FORGE), PLATES(FORGE), - COBBLESTONE(FORGE) + COBBLESTONE(FORGE), + SANDPAPER(MOD) ; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java index c315bea50..a698ebda3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java @@ -19,6 +19,7 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; +import net.minecraft.tags.ItemTags; import net.minecraft.util.IItemProvider; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; @@ -69,7 +70,7 @@ public class DeployerApplicationRecipe extends ProcessingRecipe i .map(r -> new ProcessingRecipeBuilder<>(DeployerApplicationRecipe::new, Create.asResource(r.getId() .getPath() + "_using_deployer")).require(r.getIngredients() .get(0)) - .require(Ingredient.of(AllItems.SAND_PAPER.get(), AllItems.RED_SAND_PAPER.get())) + .require(ItemTags.createOptional(Create.asResource("sandpaper"))) .output(r.getResultItem()) .build()) .collect(Collectors.toList());