Use smaller position offset when placing blocks (#940)

This commit is contained in:
Bloepiloepi 2022-04-18 01:15:38 +02:00 committed by GitHub
parent bb236b34b6
commit f0fa81b712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,7 +343,7 @@ final class BlockCollision {
// Need to move player slightly away from block we're placing.
// If player is at block 40 we cannot place a block at block 39 with side length 1 because the block will be in [39, 40]
// For this reason we subtract a small amount from the player position
Point playerPos = entity.getPosition().add(entity.getPosition().sub(blockPos).mul(0.01));
Point playerPos = entity.getPosition().add(entity.getPosition().sub(blockPos).mul(0.0000001));
intersects = b.registry().collisionShape().intersectBox(playerPos.sub(blockPos), entity.getBoundingBox());
} else {
intersects = b.registry().collisionShape().intersectBox(entity.getPosition().sub(blockPos), entity.getBoundingBox());