1616import lu .kolja .expandedae .helper .cpu .ISearchScreen ;
1717import lu .kolja .expandedae .helper .cpu .TableEntrySorters ;
1818import net .minecraft .network .chat .Component ;
19+ import net .minecraft .network .chat .MutableComponent ;
1920import net .minecraft .world .entity .player .Inventory ;
2021import org .apache .commons .lang3 .StringUtils ;
2122import org .spongepowered .asm .mixin .Mixin ;
2223import org .spongepowered .asm .mixin .Shadow ;
2324import org .spongepowered .asm .mixin .Unique ;
2425import org .spongepowered .asm .mixin .injection .At ;
2526import org .spongepowered .asm .mixin .injection .Inject ;
26- import org .spongepowered .asm .mixin .injection .ModifyArg ;
2727import org .spongepowered .asm .mixin .injection .Redirect ;
2828import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
2929
@@ -82,16 +82,17 @@ private void updateBeforeRender(CallbackInfo ci) {
8282 * When the duration is stuck, it'll default to a very large number that would overlap into the search field,
8383 * this replaces it with "∞" in that case
8484 */
85- @ ModifyArg (
85+ @ Redirect (
8686 method = "updateBeforeRender" ,
8787 at = @ At (
8888 value = "INVOKE" ,
8989 target = "Lnet/minecraft/network/chat/MutableComponent;append(Ljava/lang/String;)Lnet/minecraft/network/chat/MutableComponent;" ,
9090 ordinal = 0
91- )
91+ ),
92+ remap = true
9293 )
93- private String eae$formatDuration (String duration ) {
94- return duration .equals (" - 2562047:47:16" ) ? " - ∞" : duration ;
94+ private MutableComponent eae$formatDuration (MutableComponent instance , String duration ) {
95+ return instance . append ( duration .equals (" - 2562047:47:16" ) ? " - ∞" : duration ) ;
9596 }
9697
9798 /**
@@ -150,4 +151,4 @@ public boolean mouseClicked(double xCoord, double yCoord, int btn) {
150151 public SortDir eae$getSortDir () {
151152 return eae$sortDirToggle .getCurrentValue ();
152153 }
153- }
154+ }
0 commit comments