Skip to content

Commit 5fb1e2a

Browse files
committed
Fix server boot crash
1 parent 047e86e commit 5fb1e2a

4 files changed

Lines changed: 39 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.7.1
2+
- Fix server boot crash [#354](https://github.com/GTModpackTeam/GTExpert-Core/pull/354)
3+
4+
* * *
5+
16
# 2.7.0
27
- Chisel integration move to [GTModpackTeam/GTMoreTools](https://github.com/GTModpackTeam/GTMoreTools)
38

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.github.gtexpert.core.mixins.gregtech;
2+
3+
import java.util.List;
4+
5+
import net.minecraft.client.resources.I18n;
6+
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Redirect;
10+
11+
import gregtech.common.items.armor.QuarkTechSuite;
12+
13+
import com.github.gtexpert.core.common.GTEConfigHolder;
14+
15+
/**
16+
* Client-only mixin to hide the auto-eat tooltip when the feature is disabled via config.
17+
*/
18+
@Mixin(value = QuarkTechSuite.class, remap = false)
19+
public class QuarkTechSuiteClientMixin {
20+
21+
/**
22+
* Hides the auto-eat tooltip when the feature is disabled via config.
23+
*/
24+
@Redirect(method = "addInfo",
25+
at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"))
26+
private boolean gtexpert$hideAutoEatTooltip(List<String> list, Object element) {
27+
if (GTEConfigHolder.ceuOverride.disableHelmetAutoEat &&
28+
element.equals(I18n.format("metaarmor.tooltip.autoeat"))) {
29+
return false;
30+
}
31+
return list.add((String) element);
32+
}
33+
}

src/main/java/com/github/gtexpert/core/mixins/gregtech/QuarkTechSuiteMixin.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package com.github.gtexpert.core.mixins.gregtech;
22

3-
import java.util.List;
4-
5-
import net.minecraft.client.resources.I18n;
63
import net.minecraft.util.FoodStats;
74

85
import org.spongepowered.asm.mixin.Mixin;
@@ -35,17 +32,4 @@ public class QuarkTechSuiteMixin {
3532
return foodStats.needFood();
3633
}
3734
}
38-
39-
/**
40-
* Hides the auto-eat tooltip when the feature is disabled via config.
41-
*/
42-
@Redirect(method = "addInfo",
43-
at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"))
44-
private boolean gtexpert$hideAutoEatTooltip(List<String> list, Object element) {
45-
if (GTEConfigHolder.ceuOverride.disableHelmetAutoEat &&
46-
element.equals(I18n.format("metaarmor.tooltip.autoeat"))) {
47-
return false;
48-
}
49-
return list.add((String) element);
50-
}
5135
}

src/main/resources/mixins.gtexpert.gregtech.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"server": [
1111
],
1212
"client": [
13+
"QuarkTechSuiteClientMixin"
1314
]
1415
}

0 commit comments

Comments
 (0)