From 5011e48f0ca39a76b186623c68c4dc4775b480e7 Mon Sep 17 00:00:00 2001 From: lucunji Date: Fri, 21 Jun 2024 18:35:21 -0400 Subject: [PATCH] merge fixes from 1.21 branch --- .github/workflows/test-build.yml | 5 ++++ .../client/render/PlayerHUDRenderer.java | 25 +++++++------------ src/main/resources/fabric.mod.json | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 48372e5..6205882 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -23,3 +23,8 @@ jobs: run: | chmod +x ./gradlew ./gradlew clean build + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: artifacts + path: build/libs/*.jar diff --git a/src/main/java/github/io/lucunji/explayerenderer/client/render/PlayerHUDRenderer.java b/src/main/java/github/io/lucunji/explayerenderer/client/render/PlayerHUDRenderer.java index c8fa2a8..11d9427 100644 --- a/src/main/java/github/io/lucunji/explayerenderer/client/render/PlayerHUDRenderer.java +++ b/src/main/java/github/io/lucunji/explayerenderer/client/render/PlayerHUDRenderer.java @@ -20,7 +20,6 @@ import net.minecraft.client.render.entity.EntityRenderDispatcher; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityPose; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; @@ -115,21 +114,15 @@ public void doRender(float partialTicks) { transformEntity(livingVehicle, partialTicks, false); } - try { - var method = Entity.class.getDeclaredMethod("getPassengerAttachmentPos", Entity.class, EntityDimensions.class, float.class); - method.setAccessible(true); - performRendering(vehicle, - Configs.OFFSET_X.getDoubleValue() * scaledWidth, - Configs.OFFSET_Y.getDoubleValue() * scaledHeight, - Configs.SIZE.getDoubleValue() * scaledHeight, - Configs.MIRRORED.getBooleanValue(), - vehicle.getLerpedPos(partialTicks).subtract(targetEntity.getLerpedPos(partialTicks)) - .rotateY((float)Math.toRadians(yawLerped)).toVector3f(), // undo the rotation - Configs.LIGHT_DEGREE.getDoubleValue(), - partialTicks); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } + performRendering(vehicle, + Configs.OFFSET_X.getDoubleValue() * scaledWidth, + Configs.OFFSET_Y.getDoubleValue() * scaledHeight, + Configs.SIZE.getDoubleValue() * scaledHeight, + Configs.MIRRORED.getBooleanValue(), + vehicle.getLerpedPos(partialTicks).subtract(targetEntity.getLerpedPos(partialTicks)) + .rotateY((float)Math.toRadians(yawLerped)).toVector3f(), // undo the rotation + Configs.LIGHT_DEGREE.getDoubleValue(), + partialTicks); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f1111dd..cb8839d 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "explayerenderer", - "version": "2.4.0", + "version": "2.4.1", "name": "ExtraPlayerRenderer", "description": "Render an extra player figure on your screen. Made for game streaming and recordings.",