Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

helmet position goes wrong when swimming #41

Open
ColaLiao opened this issue Jan 23, 2020 · 8 comments
Open

helmet position goes wrong when swimming #41

ColaLiao opened this issue Jan 23, 2020 · 8 comments
Labels
bug Something isn't working multiplayer This bug is happening in multiplayer singleplayer This bug is happening in singleplayer

Comments

@ColaLiao
Copy link

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

@Kaydax
Copy link
Owner

Kaydax commented Jan 24, 2020

Screenshots?

@ColaLiao
Copy link
Author

image

@Kaydax Kaydax added bug Something isn't working multiplayer This bug is happening in multiplayer singleplayer This bug is happening in singleplayer labels Jan 26, 2020
@yezhiyi9670
Copy link

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
Copy link

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
Copy link
Owner

Kaydax commented Jun 19, 2020

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
Copy link

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
Copy link
Owner

Kaydax commented Oct 30, 2020

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

@xJon
Copy link

xJon commented Jun 5, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working multiplayer This bug is happening in multiplayer singleplayer This bug is happening in singleplayer
Projects
None yet
Development

No branches or pull requests

5 participants