From 173f4597725fa0014123e8cbc9f4cde5eaacba9f Mon Sep 17 00:00:00 2001 From: Gugle Date: Fri, 22 Mar 2024 14:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/generator/recipe/CompactionRecipesGenerator.java | 4 ++-- .../data/recipe/anvil/block/BlockAnvilRecipeBuilder.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/CompactionRecipesGenerator.java b/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/CompactionRecipesGenerator.java index eb07094fe..9316c51b2 100644 --- a/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/CompactionRecipesGenerator.java +++ b/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/CompactionRecipesGenerator.java @@ -35,7 +35,7 @@ public static void compaction(Block block, @NotNull Block block1, @NotNull Block .component(block) .component(block1) .unlockedBy(MyRecipesGenerator.hasItem(block.asItem()), FabricRecipeProvider.has(block.asItem())) - .save(exporter, AnvilCraft.of("smash_block/" + BuiltInRegistries.BLOCK.getKey(block2).getPath())); + .save(exporter, AnvilCraft.of("smash_block/" + BuiltInRegistries.BLOCK.getKey(block).getPath() + "_and_" + BuiltInRegistries.BLOCK.getKey(block1).getPath() + "_2_" + BuiltInRegistries.BLOCK.getKey(block2).getPath())); } public static void compaction(TagKey block, @NotNull Block block1, @NotNull Block block2, Consumer exporter) { @@ -43,6 +43,6 @@ public static void compaction(TagKey block, @NotNull Block block1, @NotNu .component(block) .component(block1) .unlockedBy(MyRecipesGenerator.hasItem(block1.asItem()), FabricRecipeProvider.has(block1.asItem())) - .save(exporter, AnvilCraft.of("smash_block/" + BuiltInRegistries.BLOCK.getKey(block2).getPath())); + .save(exporter, AnvilCraft.of("smash_block/" + block.location().getPath() + "_and_" + BuiltInRegistries.BLOCK.getKey(block1).getPath() + "_2_" + BuiltInRegistries.BLOCK.getKey(block2).getPath())); } } diff --git a/src/main/java/dev/dubhe/anvilcraft/data/recipe/anvil/block/BlockAnvilRecipeBuilder.java b/src/main/java/dev/dubhe/anvilcraft/data/recipe/anvil/block/BlockAnvilRecipeBuilder.java index 23f832e44..36589ddcf 100644 --- a/src/main/java/dev/dubhe/anvilcraft/data/recipe/anvil/block/BlockAnvilRecipeBuilder.java +++ b/src/main/java/dev/dubhe/anvilcraft/data/recipe/anvil/block/BlockAnvilRecipeBuilder.java @@ -93,7 +93,7 @@ public BlockAnvilRecipeBuilder anvilDamage(boolean bl) { } @Override - public void save(Consumer finishedRecipeConsumer, ResourceLocation recipeId) { + public void save(@NotNull Consumer finishedRecipeConsumer, ResourceLocation recipeId) { this.ensureValid(recipeId); this.advancement.parent(ROOT_RECIPE_ADVANCEMENT).addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(recipeId)).rewards(AdvancementRewards.Builder.recipe(recipeId)).requirements(RequirementsStrategy.OR); finishedRecipeConsumer.accept(new Result(recipeId, this.components, this.results, this.dropItems, this.isAnvilDamage, null == this.group ? "" : this.group, this.advancement, recipeId.withPrefix("recipes/" + this.category.getFolderName() + "/")));