Skip to content

Commit

Permalink
Better handle some mods breaking isCrouching
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jan 21, 2024
1 parent 3be55a3 commit 555eb42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/dev/tr7zw/firstperson/LogicHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Pose;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.Boat;
import net.minecraft.world.entity.vehicle.Minecart;
Expand Down Expand Up @@ -93,7 +94,8 @@ public void updatePositionOffset(Entity entity, Vec3 defValue) {
} else {
bodyOffset = Constants.SWIM_DOWN_BODY_OFFSET;
}
} else if (player.isCrouching()) {
// some mods seem to break the isCrouching method
} else if (player.isCrouching() || player.getPose() == Pose.CROUCHING) {
bodyOffset = Constants.SNEAK_BODY_OFFSET + (fpm.getConfig().sneakXOffset / 100f);
} else if (player.isPassenger()) {
if (player.getVehicle() instanceof Boat || player.getVehicle() instanceof Minecart) {
Expand Down

0 comments on commit 555eb42

Please sign in to comment.