added fall grass to LBM

master
NathanSalapat 2016-06-20 14:18:37 -05:00
parent b04fcbe35d
commit b94f061198
1 changed files with 31 additions and 0 deletions

View File

@ -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
})