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.
This commit is contained in:
MRH0 2021-08-04 02:20:40 +02:00
parent 468435e1a0
commit e8a6500434
4 changed files with 13 additions and 2 deletions

View file

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"create:sand_paper",
"create:red_sand_paper"
]
}

View file

@ -228,11 +228,13 @@ public class AllItems {
public static final ItemEntry<SandPaperItem> SAND_PAPER = REGISTRATE.item("sand_paper", SandPaperItem::new)
.transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new))
.tag(AllTags.AllItemTags.SANDPAPER.tag)
.register();
public static final ItemEntry<SandPaperItem> 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<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new)

View file

@ -84,7 +84,8 @@ public class AllTags {
INGOTS(FORGE),
NUGGETS(FORGE),
PLATES(FORGE),
COBBLESTONE(FORGE)
COBBLESTONE(FORGE),
SANDPAPER(MOD)
;

View file

@ -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<RecipeWrapper> 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());