removed thirst factor change as it crashed server.
parent
6309978b10
commit
d6dd9e7ee8
|
@ -0,0 +1,43 @@
|
|||
minetest.register_abm({ --Flowers die in late fall
|
||||
nodenames = {'group:flower'},
|
||||
interval = 10,
|
||||
chance = 10,
|
||||
action = function (pos)
|
||||
if mymonths.month == 'October' or mymonths.month == 'November' then
|
||||
minetest.set_node(pos, {name = 'air'})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({ --Flowers grow in spring, flower spread ABM is in flower mod, this just gives initial population as that ABM won't grow flowers where there are none.
|
||||
nodenames = {'group:soil'},
|
||||
interval = 240,
|
||||
chance = 100,
|
||||
action = function (pos)
|
||||
if mymonths.month == 'March' or mymonths.month == 'April' then
|
||||
local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4}
|
||||
local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4}
|
||||
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flower")
|
||||
if #flowers > 2 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y+1
|
||||
if minetest.get_node(pos).name == 'air' then
|
||||
local key = math.random(1,6)
|
||||
if key == 1 then
|
||||
minetest.set_node(pos, {name = 'flowers:dandelion_white'})
|
||||
elseif key == 2 then
|
||||
minetest.set_node(pos, {name = "flowers:dandelion_yellow"})
|
||||
elseif key == 3 then
|
||||
minetest.set_node(pos, {name = "flowers:geranium"})
|
||||
elseif key == 4 then
|
||||
minetest.set_node(pos, {name = "flowers:rose"})
|
||||
elseif key == 5 then
|
||||
minetest.set_node(pos, {name = "flowers:tulip"})
|
||||
elseif key == 6 then
|
||||
minetest.set_node(pos, {name = "flowers:viola"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
7
init.lua
7
init.lua
|
@ -16,6 +16,9 @@ mymonths.snow_on_ground = true
|
|||
--Puddles appear when raining
|
||||
mymonths.use_puddles = true
|
||||
|
||||
--Flowers die in winter, grown in spring
|
||||
mymonths.flowers_die = true
|
||||
|
||||
|
||||
local modpath = minetest.get_modpath("mymonths")
|
||||
local input = io.open(modpath.."/settings.txt", "r")
|
||||
|
@ -69,6 +72,10 @@ if mymonths.leaves == false then
|
|||
minetest.register_alias("mymonths:leaves_sticks", "default:leaves")
|
||||
end
|
||||
|
||||
if mymonths.flowers_die == true then
|
||||
dofile(minetest.get_modpath("mymonths").."/flowers.lua")
|
||||
end
|
||||
|
||||
if minetest.get_modpath("thirsty") then
|
||||
thirst = true
|
||||
end
|
||||
|
|
12
months.lua
12
months.lua
|
@ -88,12 +88,12 @@ local day = mymonths.day_counter
|
|||
mymonths.month = m2
|
||||
mymonths.day_speed = m3
|
||||
mymonths.night_speed = m4
|
||||
if thirst == true then
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
thirsty.set_thirst_factor(name, m5)
|
||||
end
|
||||
end
|
||||
-- if thirst == true then
|
||||
-- for _,player in ipairs(minetest.get_connected_players()) do
|
||||
-- local players_names = player:get_player_name()
|
||||
-- thirsty.set_thirst_factor(players_names, m5)
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue