@@ -1840,8 +1840,13 @@ func (p *Player) placeBlock(pos cube.Pos, b world.Block, ignoreBBox bool) bool {
1840
1840
p .resendBlocks (pos , cube .Faces ()... )
1841
1841
return false
1842
1842
}
1843
- if ! ignoreBBox && p .obstructedPos (pos , b ) {
1844
- p .resendBlocks (pos , cube .Faces ()... )
1843
+ if obstructed , selfOnly := p .obstructedPos (pos , b ); obstructed && ! ignoreBBox {
1844
+ if ! selfOnly {
1845
+ // Only resend blocks if there were other entities blocking the
1846
+ // placement than the player itself. Resending blocks placed inside
1847
+ // the player itself leads to synchronisation issues.
1848
+ p .resendBlocks (pos , cube .Faces ()... )
1849
+ }
1845
1850
return false
1846
1851
}
1847
1852
@@ -1856,9 +1861,13 @@ func (p *Player) placeBlock(pos cube.Pos, b world.Block, ignoreBBox bool) bool {
1856
1861
return true
1857
1862
}
1858
1863
1859
- // obstructedPos checks if the position passed is obstructed if the block passed is attempted to be placed.
1860
- // The function returns true if there is an entity in the way that could prevent the block from being placed.
1861
- func (p * Player ) obstructedPos (pos cube.Pos , b world.Block ) bool {
1864
+ // obstructedPos checks if the position passed is obstructed if the block
1865
+ // passed is attempted to be placed. The function returns true as the first
1866
+ // bool if there is an entity in the way that could prevent the block from
1867
+ // being placed.
1868
+ // If the only entity preventing the block from being placed is the player
1869
+ // itself, the second bool returned is true too.
1870
+ func (p * Player ) obstructedPos (pos cube.Pos , b world.Block ) (obstructed , selfOnly bool ) {
1862
1871
blockBoxes := b .Model ().BBox (pos , p .tx )
1863
1872
for i , box := range blockBoxes {
1864
1873
blockBoxes [i ] = box .Translate (pos .Vec3 ())
@@ -1871,11 +1880,15 @@ func (p *Player) obstructedPos(pos cube.Pos, b world.Block) bool {
1871
1880
continue
1872
1881
default :
1873
1882
if cube .AnyIntersections (blockBoxes , t .BBox (e ).Translate (e .Position ()).Grow (- 1e-6 )) {
1874
- return true
1883
+ obstructed = true
1884
+ if e .H () == p .handle {
1885
+ continue
1886
+ }
1887
+ return true , false
1875
1888
}
1876
1889
}
1877
1890
}
1878
- return false
1891
+ return obstructed , true
1879
1892
}
1880
1893
1881
1894
// BreakBlock makes the player break a block in the world at a position passed. If the player is unable to
0 commit comments