Skip to content

Commit 58d4e2d

Browse files
Update to 1.21.9-pre2
1 parent 4fbc76a commit 58d4e2d

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

src/main/java/net/wurstclient/mixin/BlockEntityRenderDispatcherMixin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.spongepowered.asm.mixin.injection.At;
1212
import org.spongepowered.asm.mixin.injection.Inject;
1313
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14+
1415
import net.minecraft.client.render.block.entity.BlockEntityRenderManager;
1516
import net.minecraft.client.render.block.entity.state.BlockEntityRenderState;
1617
import net.minecraft.client.render.command.OrderedRenderCommandQueue;
@@ -23,11 +24,11 @@
2324
public class BlockEntityRenderDispatcherMixin
2425
{
2526
@Inject(at = @At("HEAD"),
26-
method = "render(Lnet/minecraft/client/render/block/entity/state/BlockEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;Lnet/minecraft/class_12075;)V",
27+
method = "render(Lnet/minecraft/client/render/block/entity/state/BlockEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;Lnet/minecraft/client/render/state/CameraRenderState;)V",
2728
cancellable = true)
2829
private <S extends BlockEntityRenderState> void onRenderRenderState(
2930
S renderState, MatrixStack matrices, OrderedRenderCommandQueue queue,
30-
CameraRenderState otherRenderState, CallbackInfo ci)
31+
CameraRenderState cameraRenderState, CallbackInfo ci)
3132
{
3233
RenderBlockEntityEvent event = new RenderBlockEntityEvent(renderState);
3334
EventManager.fire(event);

src/main/java/net/wurstclient/mixin/LabelCommandRendererMixin.java

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.llamalad7.mixinextras.injector.ModifyReceiver;
2020
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
2121
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
22+
2223
import net.minecraft.client.render.command.LabelCommandRenderer;
2324
import net.minecraft.client.render.command.OrderedRenderCommandQueueImpl;
2425
import net.minecraft.client.render.state.CameraRenderState;
@@ -31,22 +32,21 @@
3132
@Mixin(LabelCommandRenderer.Commands.class)
3233
public 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
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"depends": {
2929
"fabricloader": ">=0.17.0",
3030
"fabric-api": ">=0.133.7",
31-
"minecraft": "~1.21.9-beta.1",
31+
"minecraft": "~1.21.9-beta.2",
3232
"java": ">=21"
3333
},
3434
"suggests": {

0 commit comments

Comments
 (0)