Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public double CalculateEquationNoise(long Noise) {
}
answer += RawEquation.get(3);
var fake_answer = (long) (answer + noise * Math.random());
// true_answer 会因 range 缺失或过小而为 0,此处除法随之得 NaN 或 Infinity 并写进 NBT
if (true_answer == 0) return 0.0;
return ((double) fake_answer / true_answer);
}

Expand All @@ -167,6 +169,7 @@ public double CalculateEquation(long Noise) {
}
answer += RawEquation.get(3);
var fake_answer = (long) (answer + noise * Math.random());
if (true_answer == 0) return 0.0;
return ((double) answer / true_answer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ public static Component recipeModifier(MetaMachine machine, RecipeHandlerGroup g
var input = recipe.data.getInt("input");
var duration = 1.0;
var true_eut = pmachine.muti * pmachine.heat * 131072 + EUt;
var parallel = Math.max((true_eut / input), 0.01); // 真实并行
// 真实并行。配方漏写 input 时 getInt 返回 0,浮点除零得 Infinity,(int) 收窄成 Integer.MAX_VALUE,并行基数与时长倍率会一起失真
var parallel = input > 0 ? Math.max(true_eut / input, 0.01) : 1.0;
if (parallel < 1) {
duration = 1 / (parallel * parallel);
parallel = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ private static void photovoltaicAssemberRecipes(Consumer<FinishedRecipe> provide
.inputItems(VOLTAGE_COIL_IV)
.inputFluids(VanadiumGallium.getFluid(576))
.outputItems(CTNHBlocks.PV_COIL.asStack())
.addData("input", 130712)
.addData("input", 131072)
.duration(20)
.save(provider);

Expand All @@ -540,7 +540,7 @@ private static void photovoltaicAssemberRecipes(Consumer<FinishedRecipe> provide
.inputItems(CRYSTAL_SYSTEM_ON_CHIP.asStack(8))
.inputFluids(Cryotheum.getFluid(8000))
.outputItems(CTNHItems.PV_DRONE_TIER1.asStack())
.addData("input", 261424)
.addData("input", 262144)
.duration(400)
.save(provider);

Expand All @@ -552,7 +552,7 @@ private static void photovoltaicAssemberRecipes(Consumer<FinishedRecipe> provide
.inputItems(HIGHLY_ADVANCED_SOC_WAFER, 14)
.inputFluids(Cryotheum.getFluid(28000))
.outputItems(CTNHItems.PV_DRONE_TIER2.asStack(), 7)
.addData("input", 2091392)
.addData("input", 2097152)
.duration(400)
.save(provider);

Expand Down
Loading