Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
在Onetick模式中对鸿蒙配方进行了修改 (#10)
Browse files Browse the repository at this point in the history
* 修改了硅岩燃料燃烧时间

* 修改了硅岩燃料燃烧时间

* delete proxy

* 在Onetick模式中对鸿蒙之眼配方进行了修改 包括: 运行时间 1tick; 0L氢&氦需求; 基础成功概率为500%

* 在Onetick模式中对鸿蒙之眼配方进行了修改
包括:
运行时间 1tick;
所有配方1000L氢&氦需求;
所有配方基础成功概率为500%
所有配方启动电能需求为114EU,产出为999999999 EU

* 在Onetick模式中对鸿蒙之眼配方进行了修改
包括:
运行时间 1tick;
所有配方1L氢&氦需求;
所有配方基础成功概率为500%
所有配方启动电能需求为114EU,产出为999999999 EU

---------

Co-authored-by: 初夏同学 <[email protected]>
  • Loading branch information
Ol925 and wohaopa authored Aug 17, 2024
1 parent e88577d commit 739b112
Showing 1 changed file with 100 additions and 11 deletions.
111 changes: 100 additions & 11 deletions src/main/java/com/github/wohaopa/GTNHModify/strategies/OneTick.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,111 @@ public int handler_FurnaceProcessingTime(Object owner, int number) {
return 1;
}

private Field field;
private Field miningTimeSecondsField;
private Field hydrogenRequirementField;
private Field heliumRequirementField;
private Field baseSuccessChanceField;
private Field euOutputField;
private Field euStartCostField;

public void handler_EyeOfHarmonyRecipe(EyeOfHarmonyRecipe eyeOfHarmonyRecipe) {
if (field == null) {
try {
Class<?> clazz = EyeOfHarmonyRecipe.class;
field = clazz.getDeclaredField("miningTimeSeconds");
field.setAccessible(true);
Class<?> clazz = EyeOfHarmonyRecipe.class;

} catch (NoSuchFieldException ignored) {}
// miningTimeSeconds
{
if (miningTimeSecondsField == null) {
try {
miningTimeSecondsField = clazz.getDeclaredField("miningTimeSeconds");
miningTimeSecondsField.setAccessible(true);
} catch (NoSuchFieldException ignored) {}
}
if (miningTimeSecondsField != null) {
try {
miningTimeSecondsField.setLong(eyeOfHarmonyRecipe, 1);
} catch (IllegalAccessException ignored) {}
}
}

// hydrogenRequirement
{
if (hydrogenRequirementField == null) {
try {
hydrogenRequirementField = clazz.getDeclaredField("hydrogenRequirement");
hydrogenRequirementField.setAccessible(true);

} catch (NoSuchFieldException ignored) {}
}
if (hydrogenRequirementField != null) {
try {
long hydrogenRequirement = hydrogenRequirementField.getLong(eyeOfHarmonyRecipe);
hydrogenRequirementField.setLong(eyeOfHarmonyRecipe, 1);
} catch (IllegalAccessException ignored) {}
}
}

// heliumRequirement
{
if (heliumRequirementField == null) {
try {
heliumRequirementField = clazz.getDeclaredField("heliumRequirement");
heliumRequirementField.setAccessible(true);

} catch (NoSuchFieldException ignored) {}
}
if (heliumRequirementField != null) {
try {
long heliumRequirement = heliumRequirementField.getLong(eyeOfHarmonyRecipe);
heliumRequirementField.setLong(eyeOfHarmonyRecipe, 1);
} catch (IllegalAccessException ignored) {}
}
}
try {
if (field != null) {
field.setLong(eyeOfHarmonyRecipe, 1);

// baseSuccessChance
{
if (baseSuccessChanceField == null) {
try {
baseSuccessChanceField = clazz.getDeclaredField("baseSuccessChance");
baseSuccessChanceField.setAccessible(true);

} catch (NoSuchFieldException ignored) {}
}
if (baseSuccessChanceField != null) {
try {
double baseSuccessChance = baseSuccessChanceField.getDouble(eyeOfHarmonyRecipe);
baseSuccessChanceField.setDouble(eyeOfHarmonyRecipe, 5);
} catch (IllegalAccessException ignored) {}
}
}

// euOutput
{
if (euOutputField == null) {
try {
euOutputField = clazz.getDeclaredField("euOutput");
euOutputField.setAccessible(true);
} catch (NoSuchFieldException ignored) {}
}
} catch (IllegalAccessException ignored) {}
if (euOutputField != null) {
try {
euOutputField.setLong(eyeOfHarmonyRecipe, 999999999);
} catch (IllegalAccessException ignored) {}
}
}

// euStartCost
{
if (euStartCostField == null) {
try {
euStartCostField = clazz.getDeclaredField("euStartCost");
euStartCostField.setAccessible(true);
} catch (NoSuchFieldException ignored) {}
}
if (euStartCostField != null) {
try {
euStartCostField.setLong(eyeOfHarmonyRecipe, 114);
} catch (IllegalAccessException ignored) {}
}
}
}

}

0 comments on commit 739b112

Please sign in to comment.