Skip to content

Commit

Permalink
special floor for spawning npcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeb187 committed Jul 8, 2018
1 parent 264180f commit 7b99076
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions buildings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function settlements.build_schematic(pos, building, replace_wall, name)
schem_lua = schem_lua:gsub("default:cobble", material)
end
schem_lua = schem_lua:gsub("default:dirt_with_grass", balcony_material)
-- special material for spawning npcs
schem_lua = schem_lua:gsub("default:junglewood", "settlements:junglewood")
-- format schematic string
local schematic = loadstring(schem_lua)()
-- build foundation for the building an make room above
Expand Down
16 changes: 14 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@ dofile(settlements.modpath.."/buildings.lua")
-- load settlements on server
--
settlements_in_world = settlements.load()
--
-- register block for npc spawn
--
minetest.register_node("settlements:junglewood", {
description = "special junglewood floor",
tiles = {"default_junglewood.png"},
groups = {choppy=3, wood=2},
sounds = default.node_sound_wood_defaults(),
})



--
-- register inhabitants
--
if minetest.get_modpath("mobs_npc") ~= nil then
--mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, day_toggle)
mobs:register_spawn("mobs_npc:npc", {"default:junglewood"}, 20, 0, 1, 7, 31000, nil)
mobs:register_spawn("mobs_npc:trader", {"default:junglewood"}, 20, 0, 1, 7, 31000, nil)
mobs:register_spawn("mobs_npc:npc", {"settlements:junglewood"}, 20, 0, 1, 7, 31000, nil)
mobs:register_spawn("mobs_npc:trader", {"settlements:junglewood"}, 20, 0, 1, 7, 31000, nil)
end
--
-- on map generation, try to build a settlement
Expand Down

0 comments on commit 7b99076

Please sign in to comment.