Merge pull request #2080 from mrh0/mc1.16/dev

Added tag for improved integration in DeployerApplicationRecipe
This commit is contained in:
simibubi 2021-08-05 17:58:42 +02:00 committed by GitHub
commit a6f893da7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) public static final ItemEntry<SandPaperItem> SAND_PAPER = REGISTRATE.item("sand_paper", SandPaperItem::new)
.transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new)) .transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new))
.tag(AllTags.AllItemTags.SANDPAPER.tag)
.register(); .register();
public static final ItemEntry<SandPaperItem> RED_SAND_PAPER = REGISTRATE.item("red_sand_paper", SandPaperItem::new) public static final ItemEntry<SandPaperItem> RED_SAND_PAPER = REGISTRATE.item("red_sand_paper", SandPaperItem::new)
.transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new)) .transform(CreateRegistrate.customRenderedItem(() -> SandPaperModel::new))
.onRegister(s -> TooltipHelper.referTo(s, SAND_PAPER)) .onRegister(s -> TooltipHelper.referTo(s, SAND_PAPER))
.tag(AllTags.AllItemTags.SANDPAPER.tag)
.register(); .register();
public static final ItemEntry<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new) public static final ItemEntry<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new)

View file

@ -84,7 +84,8 @@ public class AllTags {
INGOTS(FORGE), INGOTS(FORGE),
NUGGETS(FORGE), NUGGETS(FORGE),
PLATES(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.ItemStack;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.IItemProvider; import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; 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() .map(r -> new ProcessingRecipeBuilder<>(DeployerApplicationRecipe::new, Create.asResource(r.getId()
.getPath() + "_using_deployer")).require(r.getIngredients() .getPath() + "_using_deployer")).require(r.getIngredients()
.get(0)) .get(0))
.require(Ingredient.of(AllItems.SAND_PAPER.get(), AllItems.RED_SAND_PAPER.get())) .require(ItemTags.createOptional(Create.asResource("sandpaper")))
.output(r.getResultItem()) .output(r.getResultItem())
.build()) .build())
.collect(Collectors.toList()); .collect(Collectors.toList());