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 ;
7+ import org .spongepowered .asm .mixin .Debug ;
68import org .spongepowered .asm .mixin .Mixin ;
9+ import org .spongepowered .asm .mixin .Shadow ;
710import org .spongepowered .asm .mixin .injection .At ;
11+ import org .spongepowered .asm .mixin .injection .Inject ;
12+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
13+
14+ import java .util .function .Supplier ;
815
916// all this mixin does is switch newlines to the expected format
1017@ Mixin (value = LangKey .class , remap = false )
1118public abstract class LangKeyMixin extends BaseKey {
1219
20+ @ Shadow
21+ private long time ;
22+
1323 @ ModifyExpressionValue (method = "getFormatted" ,
1424 at = @ At (value = "INVOKE" ,
1525 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 +35,12 @@ public String getTranslateKey(String original) {
2535 public String switchNewLines (String original ) {
2636 return original .replace ("/n" , "\n " );
2737 }
38+
39+ @ Debug (export = true )
40+ @ Inject (method = "<init>(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)V" ,
41+ at = @ At (value = "RETURN" ))
42+ private void setTimeToNegativeOne (@ NotNull Supplier <String > keySupplier , @ NotNull Supplier <Object []> argsSupplier ,
43+ CallbackInfo ci ) {
44+ time = -1 ;
45+ }
2846}
0 commit comments