Fixup sword blocking in <= 1.8

Closes https://github.com/ViaVersion/ViaFabricPlus/pull/438

Co-authored-by: Error <45919406+OfficialError@users.noreply.github.com>
This commit is contained in:
FlorianMichael 2024-06-12 04:30:23 +02:00
parent aa27837c56
commit 456a5a94b9
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -49,10 +49,12 @@ public abstract class MixinHeldItemRenderer {
if (VisualSettings.global().enableSwordBlocking.isEnabled() || blockHitAnimation) {
final Arm arm = hand == Hand.MAIN_HAND ? player.getMainArm() : player.getMainArm().getOpposite();
matrices.translate(arm == Arm.RIGHT ? -0.1F : 0.1F, 0.05F, 0.0F);
if (blockHitAnimation) {
applySwingOffset(matrices, arm, swingProgress);
matrices.translate(arm == Arm.RIGHT ? -0.14F : 0.14F, 0.12F, 0.12F);
} else {
matrices.translate(arm == Arm.RIGHT ? -0.15F : 0.15F, 0.07F, 0.12F);
}
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-102.25f));
matrices.multiply((arm == Arm.RIGHT ? RotationAxis.POSITIVE_Y : RotationAxis.NEGATIVE_Y).rotationDegrees(13.365f));