This commit is contained in:
Signal 2025-09-16 02:20:35 -04:00
parent db2139f7ba
commit 18ff69274f
14 changed files with 565 additions and 11 deletions

View file

@ -84,7 +84,7 @@ minetest.register_node(":rgt_towns:constructor", {
local m = minetest.get_meta(pos)
local grid = m:get_string("grid")
local gpos = vector.from_string(m:get_string("build_pos"))
local plot = m:get("plot") or "empty_plot"
local plot = m:get("plot") or "house"
local inv = m:get_inventory()

View file

@ -152,8 +152,14 @@ minetest.register_chatcommand("new_plot", {
minetest.register_chatcommand("load_plot", {
func = function(name, args)
local ws = db:get("workspace:"..name)
if ws then
ws = minetest.deserialize(ws)
else
return
end
if args and args ~= "" then
ns.load_plot(name, args)
ns.load_plot(ws, args)
end
end
})

View file

@ -2,7 +2,8 @@ rgt_towns.main = {}
ns = rgt_towns.main
ns.plots = {
"empty_plot"
"empty_plot",
"house"
}
rgt_towns.register_spawner {
@ -41,3 +42,17 @@ rgt_towns.register_plot{
ground_level = 5,
can_build = ns.plots
}
rgt_towns.register_plot{
name = "house",
label = "House",
description = "Hello world",
schematic = minetest.get_modpath(minetest.get_current_modname()).."/schems/house.mts",
recipe = {
"oak_planks 1", "oak_planks 1", "oak_planks 1",
"oak_log 1", "glass 1", "oak_log 1",
"cobble 1", "cobble 1", "cobble 1",
},
ground_level = 5,
can_build = ns.plots
}

Binary file not shown.