[SPIGOT-2548] CraftWorld's spawnFallingBlock shifts the spawn location to the centre of the block Created: 23/Jul/16  Updated: 24/Jul/16  Resolved: 23/Jul/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Paddy Lamont Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: craftbukkit, entities
Environment:

Localhost server


Attachments: PNG File FYfUHNf.png    

 Description   

In the spawnFallingBlock method of CraftWorld the location that is accepted for creating the FallingSand entity is reset to the middle of the current block.

This does not allow developers to spawn falling sand which does not match the grid.

If for whatever reason you would like to maintain that it centres the blocks to the grid, there is also another issue with this as in at least newer minecraft versions is that the blocks actually spawn half a block above the block they were intended to be spawned in. This is due to falling sand being centred at the centre of the bottom face of the block, not the absolute centre of the block, which is something which may have been changed in newer versions of minecraft. To fix this you would just need to not add 0.5 to the y of the falling sand.



 Comments   
Comment by Paddy Lamont [ 24/Jul/16 ]

Falling blocks have been solidifying off the grid for a long time when people have used plugins which create more realistic explosions.

Their behaviour is to change the block that their location is in. It just floors their locations x, y and z when it makes a new BlockPosition.

I do think you should remove the + 0.5 in the y value though, as looking at the source for falling blocks they only add 0.5 to the x and z when they create the EntityFallingBlock.

Comment by md_5 [ 23/Jul/16 ]

And what happens when falling blocks solidify off grid? Sounds like a recipe for glitched behaviour.

Generated at Thu Mar 27 04:31:24 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.