From 82d5bd956bf3aa1a853fc0826e5b06400af67319 Mon Sep 17 00:00:00 2001 From: Fff Date: Thu, 12 Nov 2026 11:36:21 -0800 Subject: [PATCH] =?UTF-8?q?fix(recipe):=20=E4=BF=AE=E5=A4=8D=E7=87=83?= =?UTF-8?q?=E7=83=A7=E5=8A=A0=E7=83=AD=E5=99=A8=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=8A=A0=E5=B7=A5=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 按配方与配置限制计算鱼缸批量加工数量 - 保持一次铁砧触发只消耗一次燃料,并遵守原料及输出容量限制 --- .../recipe/anvil/util/FishTankRecipes.java | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/main/java/dev/dubhe/anvilcraft/recipe/anvil/util/FishTankRecipes.java b/src/main/java/dev/dubhe/anvilcraft/recipe/anvil/util/FishTankRecipes.java index f2083bafcf..1ab3843892 100644 --- a/src/main/java/dev/dubhe/anvilcraft/recipe/anvil/util/FishTankRecipes.java +++ b/src/main/java/dev/dubhe/anvilcraft/recipe/anvil/util/FishTankRecipes.java @@ -19,9 +19,6 @@ import dev.anvilcraft.lib.v2.recipe.util.ItemBatchPlan; import dev.anvilcraft.lib.v2.recipe.util.Range; import dev.dubhe.anvilcraft.AnvilCraft; -import dev.dubhe.anvilcraft.api.recipe.CauldronProcessing; -import dev.dubhe.anvilcraft.block.BurningHeaterBlock; -import dev.dubhe.anvilcraft.block.entity.BurningHeaterBlockEntity; import dev.dubhe.anvilcraft.block.entity.FishTankBlockEntity; import dev.dubhe.anvilcraft.init.recipe.ModRecipeTriggers; import dev.dubhe.anvilcraft.recipe.anvil.outcome.DamageAnvil; @@ -64,7 +61,7 @@ public static boolean trigger(InWorldRecipeManager manager, InWorldRecipeContext List inputs = stacks(tank.getInput()); List outputs = stacks(tank.getOutputHandler()); List batches = new ArrayList<>(); - int limit = batchLimit(process, impact, tank.getBlockPos().below()); + int limit = Math.min(process.maxEfficiency(), AnvilLibRecipe.CONFIG.inWorldRecipeMaxEfficiency); Predicate prepare = batch -> prepare(holder, impact, tank, snapshot, batches, batch); ItemBatchPlan.SlotCapacity capacity = (slot, stack) -> tank.getOutputHandler().getSlotLimit(slot); ItemBatchPlan plan = tank.isProcessingOutput() @@ -93,27 +90,6 @@ public static boolean trigger(InWorldRecipeManager manager, InWorldRecipeContext return true; } - private static int batchLimit(AbstractProcessRecipe recipe, InWorldRecipeContext impact, BlockPos heaterPos) { - int limit = Math.min(recipe.maxEfficiency(), AnvilLibRecipe.CONFIG.inWorldRecipeMaxEfficiency); - var processor = recipe.getProperty().getCauldronProcessor(); - if (processor == null || !(impact.getLevel().getBlockEntity(heaterPos) instanceof BurningHeaterBlockEntity heater)) { - return limit; - } - for (IRecipeOutcome outcome : recipe.outcomes()) { - if (!(outcome instanceof SuperHeatingRecipe.ConsumeFuel) || impact.get(SuperHeatingRecipe.ConsumeFuel.FUEL_CONSUMED)) { - continue; - } - int remaining = Math.max(0, heater.getBurnTime() - SuperHeatingRecipe.ConsumeFuel.FUEL_COST_TICKS); - int heat = remaining >= BurningHeaterBlockEntity.LIT_THRESHOLD ? 2 : remaining > 0 ? 1 : 0; - var after = heater.getBlockState().setValue(BurningHeaterBlock.LEVEL, heat); - if (!CauldronProcessing.matches(processor, after)) { - return Math.min(limit, 1); - } - break; - } - return limit; - } - private static boolean prepare( RecipeHolder holder, InWorldRecipeContext impact, FishTankBlockEntity tank, FishTankBlockEntity snapshot, List batches, ItemBatchPlan.Batch batch