Fix player dive and surface animations in custom fluids (#8738)

This commit is contained in:
ChampionAsh5357 authored and GitHub committed 2022-06-15 14:02:16 +01:00
1 parent ff45bb4c27
commit 48341120fb
1 file changed
+9
@@ -32,3 +32,12 @@
this.m_117775_(p_117814_, p_117815_, p_117816_, p_117817_, (this.f_115290_).f_102812_, (this.f_115290_).f_103374_);
}
@@ -202,7 +_,7 @@
}
} else if (f > 0.0F) {
super.m_7523_(p_117802_, p_117803_, p_117804_, p_117805_, p_117806_);
- float f3 = p_117802_.m_20069_() ? -90.0F - p_117802_.m_146909_() : -90.0F;
+ float f3 = p_117802_.m_20069_() || p_117802_.isInFluidType((fluidType, height) -> p_117802_.canSwimInFluidType(fluidType)) ? -90.0F - p_117802_.m_146909_() : -90.0F;
float f4 = Mth.m_14179_(f, 0.0F, f3);
p_117803_.m_85845_(Vector3f.f_122223_.m_122240_(f4));
if (p_117802_.m_6067_()) {