Skip to content

Commit 5dfbd2b

Browse files
committed
Fix an issue where players would be pushed out when placing blocks
1 parent 3f48cff commit 5dfbd2b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/main/java/cn/nukkit/level/Level.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,8 +3239,8 @@ public Item useItemOn(Vector3 vector, Item item, BlockFace face, float fx, float
32393239
AxisAlignedBB bb = player.getBoundingBox().getOffsetBoundingBox(diff.x, diff.y, diff.z);
32403240
bb.expand(-0.01, -0.01, -0.01);
32413241
if (boundingBox.intersectsWith(bb)) {
3242-
// This is a hack to prevent the player from placing blocks inside themselves
3243-
return LazyHolder.INVALID_ITEM;
3242+
// prevent the player from placing blocks inside themselves
3243+
return null;
32443244
}
32453245
}
32463246
}
@@ -5657,8 +5657,4 @@ protected void closeSub() {
56575657
*/
56585658
private record LightUpdateEntry(int x, int y, int z, int light) {
56595659
}
5660-
5661-
private static class LazyHolder {
5662-
static final Item INVALID_ITEM = new Item(10000); //HACK
5663-
}
56645660
}

0 commit comments

Comments
 (0)