Support for start-a-node mode without water mod. Removed secondary sapplings from initial gift.

master
Alexander Weber 2017-06-04 10:23:45 +02:00
parent 99625bd421
commit 8119e0dfdc
1 changed files with 18 additions and 9 deletions

View File

@ -17,26 +17,35 @@ local function fill_chest(blockpos)
inv:set_size("main", 8*4)
-- Fill with stuff
inv:set_stack("main", 1, 'default:cobble 12')
inv:set_stack("main", 2, 'nodetest:papyrus_roots 6')
if minetest.get_modpath("water") then
inv:set_stack("main", 2, 'nodetest:papyrus_roots 6')
else
inv:set_stack("main", 2, 'bucket:bucket_water 6')
end
inv:set_stack("main", 3, 'default:dirt 2')
inv:set_stack("main", 4, 'default:sapling')
inv:set_stack("main", 5, 'default:junglesapling')
if minetest.get_modpath("conifer") then
inv:set_stack("main", 6, 'conifer:sapling')
end
end
if minetest.global_exists("startanode") then
minetest.log("Undernull startup player chests handeled by startanode mod")
if minetest.get_modpath("water") then
-- start-a-node is a chest. Trough papyrus_roots the player can start at each place on water surface
local water_level = minetest.setting_get("water_level") or 0
startanode.min_pos.y = water_level -1
startanode.max_pos.y = water_level -1
startanode.node_name = "default:chest"
startanode.after_place_func = function(player, pos)
fill_chest(pos)
end
else
-- keep the start-a-node as stone and place the chest above without water
startanode.after_place_func = function(player, pos)
chestpos = {x=pos.x, y=pos.y+1,z=pos.z}
minetest.set_node(chestpos, {name="default:chest"})
fill_chest(chestpos)
end
end
startanode.node_name = "default:chest"
startanode.after_place_func = function(player, pos)
fill_chest(pos)
end
return
end