Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Commit 5011e48

Browse files
committed
merge fixes from 1.21 branch
1 parent 6804bdb commit 5011e48

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.github/workflows/test-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ jobs:
2323
run: |
2424
chmod +x ./gradlew
2525
./gradlew clean build
26+
- name: Upload
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: artifacts
30+
path: build/libs/*.jar

src/main/java/github/io/lucunji/explayerenderer/client/render/PlayerHUDRenderer.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import net.minecraft.client.render.entity.EntityRenderDispatcher;
2121
import net.minecraft.client.util.math.MatrixStack;
2222
import net.minecraft.entity.Entity;
23-
import net.minecraft.entity.EntityDimensions;
2423
import net.minecraft.entity.EntityPose;
2524
import net.minecraft.entity.LivingEntity;
2625
import net.minecraft.entity.player.PlayerEntity;
@@ -115,21 +114,15 @@ public void doRender(float partialTicks) {
115114
transformEntity(livingVehicle, partialTicks, false);
116115
}
117116

118-
try {
119-
var method = Entity.class.getDeclaredMethod("getPassengerAttachmentPos", Entity.class, EntityDimensions.class, float.class);
120-
method.setAccessible(true);
121-
performRendering(vehicle,
122-
Configs.OFFSET_X.getDoubleValue() * scaledWidth,
123-
Configs.OFFSET_Y.getDoubleValue() * scaledHeight,
124-
Configs.SIZE.getDoubleValue() * scaledHeight,
125-
Configs.MIRRORED.getBooleanValue(),
126-
vehicle.getLerpedPos(partialTicks).subtract(targetEntity.getLerpedPos(partialTicks))
127-
.rotateY((float)Math.toRadians(yawLerped)).toVector3f(), // undo the rotation
128-
Configs.LIGHT_DEGREE.getDoubleValue(),
129-
partialTicks);
130-
} catch (NoSuchMethodException e) {
131-
throw new RuntimeException(e);
132-
}
117+
performRendering(vehicle,
118+
Configs.OFFSET_X.getDoubleValue() * scaledWidth,
119+
Configs.OFFSET_Y.getDoubleValue() * scaledHeight,
120+
Configs.SIZE.getDoubleValue() * scaledHeight,
121+
Configs.MIRRORED.getBooleanValue(),
122+
vehicle.getLerpedPos(partialTicks).subtract(targetEntity.getLerpedPos(partialTicks))
123+
.rotateY((float)Math.toRadians(yawLerped)).toVector3f(), // undo the rotation
124+
Configs.LIGHT_DEGREE.getDoubleValue(),
125+
partialTicks);
133126
}
134127

135128

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"id": "explayerenderer",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55

66
"name": "ExtraPlayerRenderer",
77
"description": "Render an extra player figure on your screen. Made for game streaming and recordings.",

0 commit comments

Comments
 (0)