Ido icon indicating copy to clipboard operation
Ido copied to clipboard

helmet position goes wrong when swimming

Open ColaLiao opened this issue 6 years ago • 8 comments

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

ColaLiao avatar Jan 23 '20 08:01 ColaLiao

Screenshots?

Kaydax avatar Jan 24 '20 19:01 Kaydax

image

ColaLiao avatar Jan 24 '20 22:01 ColaLiao

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.

yezhiyi9670 avatar Feb 24 '20 09:02 yezhiyi9670

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.

lazarusgreen avatar Jun 18 '20 18:06 lazarusgreen

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

Kaydax avatar Jun 19 '20 02:06 Kaydax

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?

lazarusgreen avatar Jun 19 '20 15:06 lazarusgreen

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

Kaydax avatar Oct 30 '20 19:10 Kaydax

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.

xJon avatar Jun 05 '21 19:06 xJon