mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
grass_block.lua update to new api
This commit is contained in:
parent
15bb6d998d
commit
7097136cd3
1 changed files with 7 additions and 7 deletions
|
|
@ -1,15 +1,15 @@
|
|||
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, 0)
|
||||
local dirtid = block.index('base:dirt');
|
||||
if block.is_solid_at(x, y+1, z) then
|
||||
block.set(x, y, z, dirtid, 0)
|
||||
else
|
||||
local grassblockid = block_index('base:grass_block')
|
||||
local grassblockid = block.index('base:grass_block')
|
||||
for lx=-1,1 do
|
||||
for ly=-1,1 do
|
||||
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, 0)
|
||||
if block.get(x + lx, y + ly, z + lz) == dirtid then
|
||||
if not block.is_solid_at(x + lx, y + ly + 1, z + lz) then
|
||||
block.set(x + lx, y + ly, z + lz, grassblockid, 0)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue