33import com .cleanroommc .modularui .drawable .text .BaseKey ;
44import com .cleanroommc .modularui .drawable .text .LangKey ;
55import com .llamalad7 .mixinextras .injector .ModifyExpressionValue ;
6+ import org .jetbrains .annotations .NotNull ;
67import org .spongepowered .asm .mixin .Mixin ;
8+ import org .spongepowered .asm .mixin .Shadow ;
79import 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 )
1117public 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