Skip to content

Commit

Permalink
undo the change in scale of offset configs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucunJi committed Jun 21, 2024
1 parent 0e8584a commit b7bd8c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,15 @@ private double getPoseOffsetY(LivingEntity targetEntity, float partialTicks, ICo
return PlayerEntity.DEFAULT_EYE_HEIGHT - targetEntity.getStandingEyeHeight();
}
} else if (poseOffsetMethod == PoseOffsetMethod.MANUAL) {
// TODO: remove the divisor (and update config's default values accordingly) when updating the major version
if (targetEntity.isFallFlying()) {
return Configs.ELYTRA_OFFSET_Y.getDoubleValue() * getFallFlyingLeaning(targetEntity, partialTicks);
return Configs.ELYTRA_OFFSET_Y.getDoubleValue() / -100D * getFallFlyingLeaning(targetEntity, partialTicks);
} else if ((targetEntity.isInSwimmingPose()) && targetEntity.getLeaningPitch(partialTicks) > 0 || targetEntity.isUsingRiptide()) { // require nonzero leaning to filter out glitch
return Configs.SWIM_CRAWL_OFFSET_Y.getDoubleValue();
return Configs.SWIM_CRAWL_OFFSET_Y.getDoubleValue() / -100D;
} 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);
return Configs.SWIM_CRAWL_OFFSET_Y.getDoubleValue() / -100D * targetEntity.getLeaningPitch(partialTicks);
} else if (targetEntity.isInSneakingPose()) {
return Configs.SNEAK_OFFSET_Y.getDoubleValue();
return Configs.SNEAK_OFFSET_Y.getDoubleValue() / -100D;
}
}
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public class Configs {
MIRRORED = Category.GENERAL.add(new LocalizedConfigBoolean(MOD_ID, "mirror", false));

POSE_OFFSET_METHOD = Category.POSTURES.add(new LocalizedConfigOptionList(MOD_ID, POSE_OFFSET_METHOD_KEY, PoseOffsetMethod.AUTO));
SNEAK_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "sneaking_y_offset", 0.35, -3, 3));
SWIM_CRAWL_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "swim_crawl_y_offset", 1.22, -3, 3));
ELYTRA_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "elytra_y_offset", 1.22, -3, 3));
SNEAK_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "sneaking_y_offset", -35, -100, 100));
SWIM_CRAWL_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "swim_crawl_y_offset", -122, -300, 300));
ELYTRA_OFFSET_Y = Category.POSTURES.add(new LocalizedConfigDouble(MOD_ID, "elytra_y_offset", -122, -300, 300));

PITCH_MIN = Category.ROTATIONS.add(new LocalizedConfigDouble(MOD_ID, "pitch_min", -20, -180, 180));
PITCH_MAX = Category.ROTATIONS.add(new LocalizedConfigDouble(MOD_ID, "pitch_max", 20, -180, 180));
Expand Down

0 comments on commit b7bd8c2

Please sign in to comment.