added fall grass to LBM
parent
b04fcbe35d
commit
b94f061198
31
grass.lua
31
grass.lua
|
@ -32,3 +32,34 @@ minetest.register_abm({
|
|||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "mymonths:change_grass",
|
||||
nodenames = {'default:dirt_with_grass', 'mymonths:fall_dirt'},
|
||||
run_at_every_load = true,
|
||||
action = function (pos, node)
|
||||
local n = node.name
|
||||
local month = tonumber(mymonths.month_counter)
|
||||
local day = tonumber(mymonths.day_counter)
|
||||
|
||||
if month == 11
|
||||
or month == 12
|
||||
or month == 1
|
||||
or month == 2 then
|
||||
if n == 'default:dirt_with_grass' then
|
||||
minetest.set_node(pos, {name = 'mymonths:fall_grass'})
|
||||
end
|
||||
|
||||
elseif month == 4
|
||||
or month == 5
|
||||
or month == 6
|
||||
or month == 7
|
||||
or month == 8
|
||||
or month == 9
|
||||
or month == 10 then
|
||||
if n == 'mymonths:fall_grass' then
|
||||
minetest.set_node(pos, {name = 'default:dirt_with_grass'})
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue