Skip to content

Commit 570018d

Browse files
authored
Fix regression in #2672 which made all GT material fluids unsearchable in JEI (#2854)
1 parent 92acc6a commit 570018d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/gregtech/mixins/mui2/LangKeyMixin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
import com.cleanroommc.modularui.drawable.text.BaseKey;
44
import com.cleanroommc.modularui.drawable.text.LangKey;
55
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
6+
import org.jetbrains.annotations.NotNull;
67
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.Shadow;
79
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12+
13+
import java.util.function.Supplier;
814

915
// all this mixin does is switch newlines to the expected format
1016
@Mixin(value = LangKey.class, remap = false)
1117
public abstract class LangKeyMixin extends BaseKey {
1218

19+
@Shadow
20+
private long time;
21+
1322
@ModifyExpressionValue(method = "getFormatted",
1423
at = @At(value = "INVOKE",
1524
target = "Lcom/cleanroommc/modularui/drawable/text/FontRenderHelper;formatArgs([Ljava/lang/Object;Lcom/cleanroommc/modularui/drawable/text/FormattingState;Ljava/lang/String;Z)Ljava/lang/String;"))
@@ -25,4 +34,11 @@ public String getTranslateKey(String original) {
2534
public String switchNewLines(String original) {
2635
return original.replace("/n", "\n");
2736
}
37+
38+
@Inject(method = "<init>(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)V",
39+
at = @At(value = "RETURN"))
40+
private void setTimeToNegativeOne(@NotNull Supplier<String> keySupplier, @NotNull Supplier<Object[]> argsSupplier,
41+
CallbackInfo ci) {
42+
time = -1;
43+
}
2844
}

0 commit comments

Comments
 (0)