Kaydax / Ido

Brings 1.13 and 1.14 movement like swimming and crawling into 1.12.2! Based off https://github.com/pentantan/BetterSwiming
Other
18 stars 3 forks source link

helmet position goes wrong when swimming #41

Open ColaLiao opened 4 years ago

ColaLiao commented 4 years ago

when use third person view, helmet position goes wrong when swimming.

Kaydax commented 4 years ago

Screenshots?

ColaLiao commented 4 years ago

image

yezhiyi9670 commented 4 years ago

I have a temp fix.

This issue is because that ModelSwimmingPlayer uses a constant head pitch angle instead of headPitch * 0.017453292F, while LayerBipedArmor uses headPitch * 0.017453292F.

However, changing the head pitch to headPitch * 0.017453292F will make the player model become strange.

So a temporary way to fix it is adding a extending class of LayerBipedArmor, and use this class instead of BipedArmor in RenderPlayerSwimming.

package xyz.kaydax.ido.legacy.model;

import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.layers.*;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
 * This is a temp fix for 'Helmet at wrong place when swimming'.
 * "Patches" the LayerBipedArmor making it use the constant pitch angle.
 * 
 * (It's called a temp fix because it's not good for compatibility)
 */

@SideOnly(Side.CLIENT)
public class SwimmingLayerBipedArmor extends LayerBipedArmor {
    public SwimmingLayerBipedArmor(RenderLivingBase<?> rendererIn) {
        super(rendererIn);
    }

    public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
        super.doRenderLayer(
                entitylivingbaseIn,
                limbSwing,
                limbSwingAmount,
                partialTicks,
                ageInTicks,
                netHeadYaw,
                -51.42857142857143F,
                scaleFactor);
    }
}

I'm not sure whether the author is still working on this mod or not. Maybe I could distribute the bug-fixed version by myself.

lazarusgreen commented 4 years ago

I'm not sure whether the author is still working on this mod or not. Maybe I could distribute the bug-fixed version by myself.

I think at this point it's safe to make the bug-fixed version and distribute it yourself. I would be quite grateful if you made it at least available somewhere private. I'm making a 1.12.2 modpack and am in desperate need of this mod, but can't bring myself to use it until this major aesthetic bug is gone. I would manually apply the fix you provided, but I have absolutely no idea how to do that.

Kaydax commented 4 years ago

I am still working on the md, but it isn't a top priority right now to work on it. I will be making a whole rewrite of the mod soon enough once I have the time to do it

lazarusgreen commented 4 years ago

I am still working on the md, but it isn't a top priority right now to work on it. I will be making a whole rewrite of the mod soon enough once I have the time to do it

Oh, that's very good to know, I was worried the mod's been abandoned! Do you at least know if an update or the rewrite will be available this year?

Kaydax commented 4 years ago

Try and see if its working now with the latest patch so I can close out this ticket

xJon commented 3 years ago

Try and see if its working now with the latest patch so I can close out this ticket

Hey, I tested this with 2.0.0-B and this is still an issue.