Chests Created In Lava/Water/Mid-Air/Walls
redpoptarts opened this issue ยท 3 comments
Instead of creating the chest in the exact location of the players death...
If the player died in a 'non-air' block (liquids usually, or solids for suffocation), calculate the nearest air block directly above the location of death. (preferably check for 2 air blocks so the chest can be opened if the terrain is protected from modification)
Similarly, if the player died in 'air', check below vertically to place the chest above the first non-air block.
If processor usage becomes a problem (probably not, since it should find the nearest block pretty quickly in MOST circumstances), the distance-to-chest can be limited to a reasonable number.
Searching sideways is too difficult, only search vertically. For large chests, when an air block is detected, search the adjacent 4 blocks for 1 more air block.
Config Option: If a suitable space for the chest(s) cannot be found...
A) Create the block at the location of death, over writing the blocks there. (Default, current behavior)
B) Do not create a chest, destroy the contents (This option is good for servers who do not want chests overwriting special terrain/buildings/features)
will look into it, problem comes with people wanting to have the old version of the code and your new version, especially with water.
It shouldn't overwrite other blocks though... do you have examples... especially of the block ID?
see also #52