Fix bugs about in world recipe crafting 修复世界内配方的相关问题#3432
Open
QiuShui1012 wants to merge 2 commits intoAnvil-Dev:dev/1.21/1.6from
Open
Fix bugs about in world recipe crafting 修复世界内配方的相关问题#3432QiuShui1012 wants to merge 2 commits intoAnvil-Dev:dev/1.21/1.6from
QiuShui1012 wants to merge 2 commits intoAnvil-Dev:dev/1.21/1.6from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes in-world cauldron recipe handling (notably cement crafting, #3428) by replacing the legacy “negative consume means produce” convention with an explicit produce field on cauldron predicates/components, and migrating affected recipes/builders to the new model.
Changes:
- Add
producetoHasCauldron/HasCauldronSimple(CODEC + StreamCodec) and update predicate application logic. - Migrate recipe builders (TimeWarp/SuperHeating/Squeezing/Bulging/NeutronIrradiation) away from negative
consume. - Update generated recipe JSONs (and cement loader) to use
produce(and proper positiveconsumewhere needed, e.g. cement).
Reviewed changes
Copilot reviewed 8 out of 29 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/dev/dubhe/anvilcraft/recipe/component/HasCauldronSimple.java | Adds produce to the simple cauldron component and updates codecs + builder. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/wrap/TimeWarpRecipe.java | Migrates builder produce() to the new produce field. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/wrap/SuperHeatingRecipe.java | Migrates builder produce() to the new produce field. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/wrap/SqueezingRecipe.java | Migrates builder produce() to the new produce field. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/wrap/NeutronIrradiationRecipe.java | Migrates builder produce() to the new produce field. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/wrap/BulgingRecipe.java | Migrates builder produce() to the new produce field. |
| src/main/java/dev/dubhe/anvilcraft/recipe/anvil/predicate/block/HasCauldron.java | Adds produce to the predicate and updates test/accept logic + codecs/builders. |
| src/main/java/dev/dubhe/anvilcraft/data/recipe/BulgingRecipeLoader.java | Fixes cement cauldron recipe by explicitly consuming and producing 1000 mB. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_zombie_head.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_spider_eye.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_rotten_flesh.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_piglin_head.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_rabbit.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_porkchop.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_mutton.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_fish.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_chicken.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/time_warp/oil_from_foods/raw_beef.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/super_heating/melt_gem_cauldron_from_gem_block.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/super_heating/melt_gem_cauldron_from_chromatic_stone.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/super_heating/lava_from_stone.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/super_heating/lava_from_cobblestone.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/water_cauldron_from_wet_sponge.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/water_cauldron_from_moss_block.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/powder_snow_cauldron_from_snow_block.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/lava_cauldron_from_magma_block.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/exp_fluid_from_sculk_use_frost_anvil.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/squeezing/exp_fluid_from_sculk.json | Migrates to produce field. |
| src/generated/resources/data/anvilcraft/recipe/bulging/cement_cauldron.json | Fixes cement recipe by explicitly consuming and producing 1000 mB. |
Comments suppressed due to low confidence (1)
src/main/java/dev/dubhe/anvilcraft/recipe/component/HasCauldronSimple.java:33
HasCauldronSimplerecord now has aproducecomponent, but the constructor Javadoc still listsfluid/consume/transform/chanceonly. This is misleading for API consumers; please add@param produce(and consider clarifying units, e.g. mB).
/**
* 构造一个简单的炼药锅条件
*
* @param fluid 流体ID
* @param consume 消耗量
* @param transform 转换后的流体ID
* @param chance 转换成功的概率
*/
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HasCauldron添加了produce字段,用于声明流体产生量consume负值声明流体产生量的情况已迁移