Skip to content

Commit

Permalink
修复存在的配方冲突问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Mar 22, 2024
1 parent ca91b9d commit 173f459
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ 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> block, @NotNull Block block1, @NotNull Block block2, Consumer<FinishedRecipe> exporter) {
BlockAnvilRecipeBuilder.block(RecipeCategory.MISC, Blocks.AIR.defaultBlockState(), block2.defaultBlockState())
.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()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public BlockAnvilRecipeBuilder anvilDamage(boolean bl) {
}

@Override
public void save(Consumer<FinishedRecipe> finishedRecipeConsumer, ResourceLocation recipeId) {
public void save(@NotNull Consumer<FinishedRecipe> 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() + "/")));
Expand Down

0 comments on commit 173f459

Please sign in to comment.