Skip to content

Commit

Permalink
merge fixes from 1.21 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
LucunJi committed Jun 21, 2024
1 parent 6804bdb commit 5011e48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down

0 comments on commit 5011e48

Please sign in to comment.