From ad77a955c07eb12df89b9abbfbfc7623cca4fa68 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:36:17 -0500 Subject: [PATCH 1/2] fix: correctly restore entity bounding boxes when computing movement physics --- Minecraft.World/Entities/Entity.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Minecraft.World/Entities/Entity.cpp b/Minecraft.World/Entities/Entity.cpp index 007d82209..0321c5ac7 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/Entities/Entity.cpp @@ -664,6 +664,8 @@ void Entity::move(double xa, double ya, double za, double yaOrg = ya; double zaOrg = za; + AABB bbOrg = bb; + bool isPlayerSneaking = onGround && isSneaking() && instanceof(eTYPE_PLAYER); @@ -769,6 +771,9 @@ void Entity::move(double xa, double ya, double za, ya = footSize; za = zaOrg; + AABB normal = bb; + bb = bbOrg; + // 4J - added extra expand, as if we don't move up by footSize by // hitting a block above us, then overall we could be trying to move as // much as footSize downwards, so we'd better include cubes under our @@ -825,6 +830,7 @@ void Entity::move(double xa, double ya, double za, xa = xaN; ya = yaN; za = zaN; + bb = normal; } } From 2302f25e93e199ec34f1636d27136b37336961db Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:38:26 -0500 Subject: [PATCH 2/2] chore: fmt --- Minecraft.World/Entities/Entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Minecraft.World/Entities/Entity.cpp b/Minecraft.World/Entities/Entity.cpp index 0321c5ac7..64e5a0bb4 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/Entities/Entity.cpp @@ -462,8 +462,8 @@ void Entity::setPos(double x, double y, double z) { this->z = z; float w = bbWidth / 2; float h = bbHeight; - bb = {x - w, y - heightOffset + ySlideOffset, z - w, x + w, - y - heightOffset + ySlideOffset + h, z + w}; + bb = {x - w, y - heightOffset + ySlideOffset, z - w, + x + w, y - heightOffset + ySlideOffset + h, z + w}; } void Entity::turn(float xo, float yo) {