Skip to content

Commit 8e19bb8

Browse files
committed
add config
1 parent 76608f3 commit 8e19bb8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/main/java/gtexpert/common/GTEConfigHolder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,8 @@ public static class GregtechOverride {
7171

7272
@Config.Comment({ "Raising Terracotta Grinding from ULV to MV.", "Default: false" })
7373
public boolean nerfTerracottaCrafting = false;
74+
75+
@Config.Comment({ "Disable auto eat function of QuarkTech helmet", "Default: true" })
76+
public boolean disableHelmetAutoEat = true;
7477
}
7578
}

src/main/java/gtexpert/mixins/gregtech/QuarkTechSuiteMixin.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88

99
import gregtech.common.items.armor.QuarkTechSuite;
1010

11+
import gtexpert.common.GTEConfigHolder;
12+
1113
@Mixin(value = QuarkTechSuite.class, remap = false)
1214
public class QuarkTechSuiteMixin {
1315

14-
// disable autoeat in modpack
1516
@Redirect(method = "onArmorTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/FoodStats;needFood()Z"))
16-
private boolean gteCore$onArmorTick(FoodStats instance) {
17-
return false;
17+
private boolean gteCore$onArmorTick(FoodStats foodStats) {
18+
if (GTEConfigHolder.ceuOverride.disableHelmetAutoEat) {
19+
return false;
20+
} else {
21+
return foodStats.needFood();
22+
}
1823
}
1924
}

0 commit comments

Comments
 (0)