mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Biome API decorations: 'spawnby' searches a 3D neighbourhood
The neighbours checked are the 8 nodes horizontally surrounding the decoration base and the 8 nodes horizontally surrounding the ground node below the decoration
This commit is contained in:
parent
39439cbd3d
commit
b51738177e
2 changed files with 14 additions and 3 deletions
|
@ -246,7 +246,7 @@ bool DecoSimple::canPlaceDecoration(MMVManip *vm, v3s16 p)
|
|||
return true;
|
||||
|
||||
int nneighs = 0;
|
||||
v3s16 dirs[8] = {
|
||||
v3s16 dirs[16] = {
|
||||
v3s16( 0, 0, 1),
|
||||
v3s16( 0, 0, -1),
|
||||
v3s16( 1, 0, 0),
|
||||
|
@ -254,7 +254,16 @@ bool DecoSimple::canPlaceDecoration(MMVManip *vm, v3s16 p)
|
|||
v3s16( 1, 0, 1),
|
||||
v3s16(-1, 0, 1),
|
||||
v3s16(-1, 0, -1),
|
||||
v3s16( 1, 0, -1)
|
||||
v3s16( 1, 0, -1),
|
||||
|
||||
v3s16( 0, 1, 1),
|
||||
v3s16( 0, 1, -1),
|
||||
v3s16( 1, 1, 0),
|
||||
v3s16(-1, 1, 0),
|
||||
v3s16( 1, 1, 1),
|
||||
v3s16(-1, 1, 1),
|
||||
v3s16(-1, 1, -1),
|
||||
v3s16( 1, 1, -1)
|
||||
};
|
||||
|
||||
// Check a Moore neighborhood if there are enough spawnby nodes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue