1919import com .llamalad7 .mixinextras .injector .ModifyReceiver ;
2020import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
2121import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
22+
2223import net .minecraft .client .render .command .LabelCommandRenderer ;
2324import net .minecraft .client .render .command .OrderedRenderCommandQueueImpl ;
2425import net .minecraft .client .render .state .CameraRenderState ;
3132@ Mixin (LabelCommandRenderer .Commands .class )
3233public class LabelCommandRendererMixin
3334{
34- // Note: These fields are backwards compared to 25w36b, might be a bug.
35- @ Shadow // labelCommands
35+ @ Shadow
3636 @ Final
37- List <OrderedRenderCommandQueueImpl .LabelCommand > field_62987 ;
37+ List <OrderedRenderCommandQueueImpl .LabelCommand > seethroughLabels ;
3838
39- @ Shadow // seeThroughLabelCommands
39+ @ Shadow
4040 @ Final
41- List <OrderedRenderCommandQueueImpl .LabelCommand > field_62988 ;
41+ List <OrderedRenderCommandQueueImpl .LabelCommand > normalLabels ;
4242
4343 @ WrapOperation (
4444 at = @ At (value = "INVOKE" ,
4545 target = "Lnet/minecraft/client/util/math/MatrixStack;scale(FFF)V" ),
46- method = "method_74829 (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;Lnet /minecraft/text/Text;ZIDLnet/minecraft/class_12075 ;)V" )
46+ method = "add (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;ILnet /minecraft/text/Text;ZIDLnet/minecraft/client/render/state/CameraRenderState ;)V" )
4747 private void wrapLabelScale (MatrixStack matrices , float x , float y , float z ,
4848 Operation <Void > original , MatrixStack matrices2 , @ Nullable Vec3d vec3d ,
49- Text text , boolean bl , int i , double d , CameraRenderState state )
49+ int i , Text text , boolean bl , int j , double d , CameraRenderState state )
5050 {
5151 NameTagsHack nameTags = WurstClient .INSTANCE .getHax ().nameTagsHack ;
5252 if (!nameTags .isEnabled ())
@@ -60,15 +60,15 @@ private void wrapLabelScale(MatrixStack matrices, float x, float y, float z,
6060 if (distance > 10 )
6161 scale *= distance / 10 ;
6262
63- matrices . scale ( scale , -scale , scale );
63+ original . call ( matrices , scale , -scale , scale );
6464 }
6565
6666 /**
6767 * Modifies the notSneaking parameter to force labels to show when NameTags
6868 * is enabled.
6969 */
7070 @ ModifyVariable (at = @ At ("HEAD" ),
71- method = "method_74829 (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;Lnet /minecraft/text/Text;ZIDLnet/minecraft/class_12075 ;)V" ,
71+ method = "add (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;ILnet /minecraft/text/Text;ZIDLnet/minecraft/client/render/state/CameraRenderState ;)V" ,
7272 argsOnly = true )
7373 private boolean forceNotSneaking (boolean notSneaking )
7474 {
@@ -78,54 +78,46 @@ private boolean forceNotSneaking(boolean notSneaking)
7878
7979 /**
8080 * Swaps the target list for the first add() call
81- * (field_62988 -> field_62987 ) if NameTags is enabled in
81+ * (normalLabels -> seethroughLabels ) if NameTags is enabled in
8282 * see-through mode.
8383 */
8484 @ ModifyReceiver (
8585 at = @ At (value = "INVOKE" ,
8686 target = "Ljava/util/List;add(Ljava/lang/Object;)Z" ,
8787 ordinal = 0 ),
88- method = "method_74829 (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;Lnet /minecraft/text/Text;ZIDLnet/minecraft/class_12075 ;)V" )
88+ method = "add (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;ILnet /minecraft/text/Text;ZIDLnet/minecraft/client/render/state/CameraRenderState ;)V" )
8989 private List <OrderedRenderCommandQueueImpl .LabelCommand > swapFirstList (
9090 List <OrderedRenderCommandQueueImpl .LabelCommand > originalList ,
9191 Object labelCommand )
9292 {
9393 NameTagsHack nameTags = WurstClient .INSTANCE .getHax ().nameTagsHack ;
9494
9595 if (nameTags .isEnabled () && nameTags .isSeeThrough ())
96- // field_62988 is seeThroughLabelCommands,
97- // field_62987 is labelCommands
98- // Swap the first add() call from
99- // seeThroughLabelCommands to labelCommands
100- if (originalList == field_62988 )
101- return field_62987 ;
96+ if (originalList == normalLabels )
97+ return seethroughLabels ;
10298
10399 return originalList ;
104100 }
105101
106102 /**
107103 * Swaps the target list for the second add() call
108- * (field_62987 -> field_62988 ) if NameTags is enabled in
104+ * (seethroughLabels -> normalLabels ) if NameTags is enabled in
109105 * see-through mode.
110106 */
111107 @ ModifyReceiver (
112108 at = @ At (value = "INVOKE" ,
113109 target = "Ljava/util/List;add(Ljava/lang/Object;)Z" ,
114110 ordinal = 1 ),
115- method = "method_74829 (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;Lnet /minecraft/text/Text;ZIDLnet/minecraft/class_12075 ;)V" )
111+ method = "add (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Vec3d;ILnet /minecraft/text/Text;ZIDLnet/minecraft/client/render/state/CameraRenderState ;)V" )
116112 private List <OrderedRenderCommandQueueImpl .LabelCommand > swapSecondList (
117113 List <OrderedRenderCommandQueueImpl .LabelCommand > originalList ,
118114 Object labelCommand )
119115 {
120116 NameTagsHack nameTags = WurstClient .INSTANCE .getHax ().nameTagsHack ;
121117
122118 if (nameTags .isEnabled () && nameTags .isSeeThrough ())
123- // field_62987 is labelCommands,
124- // field_62988 is seeThroughLabelCommands
125- // Swap the second add() call from labelCommands to
126- // seeThroughLabelCommands
127- if (originalList == field_62987 )
128- return field_62988 ;
119+ if (originalList == seethroughLabels )
120+ return normalLabels ;
129121
130122 return originalList ;
131123 }
0 commit comments