Skip to content

Commit

Permalink
offset pose of riptide
Browse files Browse the repository at this point in the history
  • Loading branch information
LucunJi committed Jun 21, 2024
1 parent 3601f44 commit 0e8584a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ private double getPoseOffsetY(LivingEntity targetEntity, float partialTicks, ICo
final float eyeHeightRatio = 0.85f;
if (targetEntity.isFallFlying()) {
return (defaultPlayerEyeHeight - targetEntity.getStandingEyeHeight()) * getFallFlyingLeaning(targetEntity, partialTicks);
} else if (targetEntity.isUsingRiptide()) {
return defaultPlayerEyeHeight - defaultPlayerSwimmingBBHeight * eyeHeightRatio * 0.8;
} else if (targetEntity.isInSwimmingPose()) {
return targetEntity.getLeaningPitch(partialTicks) <= 0 ? 0 : defaultPlayerEyeHeight - targetEntity.getStandingEyeHeight();
} else if (!targetEntity.isInSwimmingPose() && targetEntity.getLeaningPitch(partialTicks) > 0) { // for swimming/crawling pose, only smooth the falling edge
Expand All @@ -164,7 +166,7 @@ private double getPoseOffsetY(LivingEntity targetEntity, float partialTicks, ICo
} else if (poseOffsetMethod == PoseOffsetMethod.MANUAL) {
if (targetEntity.isFallFlying()) {
return Configs.ELYTRA_OFFSET_Y.getDoubleValue() * getFallFlyingLeaning(targetEntity, partialTicks);
} else if ((targetEntity.isInSwimmingPose()) && targetEntity.getLeaningPitch(partialTicks) > 0) { // require nonzero leaning to filter out glitch
} else if ((targetEntity.isInSwimmingPose()) && targetEntity.getLeaningPitch(partialTicks) > 0 || targetEntity.isUsingRiptide()) { // require nonzero leaning to filter out glitch
return Configs.SWIM_CRAWL_OFFSET_Y.getDoubleValue();
} else if (!targetEntity.isInSwimmingPose() && targetEntity.getLeaningPitch(partialTicks) > 0) { // for swimming/crawling pose, only smooth the falling edge
return Configs.SWIM_CRAWL_OFFSET_Y.getDoubleValue() * targetEntity.getLeaningPitch(partialTicks);
Expand Down

0 comments on commit 0e8584a

Please sign in to comment.