Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOP Farmland blocks can cause the player to get stuck if trampled #1267

Open
oliwier509 opened this issue Feb 1, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@oliwier509
Copy link
Contributor

Description of the Bug

possible fix:
private void turnToDirt(World worldIn, BlockPos pos) {
IBlockState iblockstate = Blocks.DIRT.getDefaultState();
worldIn.setBlockState(pos, iblockstate);
AxisAlignedBB axisalignedbb = iblockstate.getCollisionBoundingBox(worldIn, pos).offset(pos);

for (Entity entity : worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb)) {
    if (entity instanceof EntityPlayerMP) {
        double delta = axisalignedbb.maxY - entity.posY;
        ((EntityPlayerMP) entity).connection.setPlayerLocation(0, delta, 0, 0, 0, EnumSet.allOf(SPacketPlayerPosLook.EnumFlags.class));
    } else {
        entity.setPosition(entity.posX, axisalignedbb.maxY, entity.posZ);
    }
}

}

relevant post: https://discord.com/channels/881234100504109166/1333065684233486449
this is the same behavior as: https://bugs.mojang.com/browse/MC-104259

Reproduction

2025-01-25.20-09-24.mp4

Version

fa76204

Relevant log output

@oliwier509 oliwier509 added the bug Something isn't working label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant