mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
New block properties and lua functions
This commit is contained in:
parent
9e1a7213c7
commit
9ebbe1029d
7 changed files with 40 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
function on_random_update(x, y, z)
|
||||
local dirtid = block_index('base:dirt');
|
||||
if is_solid_at(x, y+1, z) then
|
||||
set_block(x, y, z, dirtid)
|
||||
set_block(x, y, z, dirtid, 0)
|
||||
else
|
||||
local grassblockid = block_index('base:grass_block')
|
||||
for lx=-1,1 do
|
||||
|
|
@ -9,7 +9,7 @@ function on_random_update(x, y, z)
|
|||
for lz=-1,1 do
|
||||
if get_block(x + lx, y + ly, z + lz) == dirtid then
|
||||
if not is_solid_at(x + lx, y + ly + 1, z + lz) then
|
||||
set_block(x + lx, y + ly, z + lz, grassblockid)
|
||||
set_block(x + lx, y + ly, z + lz, grassblockid, 0)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue