Update
This commit is contained in:
parent
db2139f7ba
commit
18ff69274f
14 changed files with 565 additions and 11 deletions
43
mods/rgt_realms/init.lua
Normal file
43
mods/rgt_realms/init.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
rgt_realms = {
|
||||
realms = {
|
||||
void = {
|
||||
sky = {
|
||||
type = "plain",
|
||||
base_color = "#000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
local ns = rgt_realms
|
||||
|
||||
function ns.register_realm(def)
|
||||
ns.realms[def.name] = def
|
||||
end
|
||||
|
||||
function ns.get_realm_at_pos(pos)
|
||||
for name, x in pairs(ns.realms) do
|
||||
if name ~= "void" and vector.in_area(pos, x.min, x.max) then
|
||||
return name
|
||||
end
|
||||
end
|
||||
return "void"
|
||||
end
|
||||
|
||||
function ns.update_realm(m)
|
||||
local realm = ns.realms[ns.get_realm_at_pos(m.object:get_pos())]
|
||||
if realm.sky then
|
||||
m.object:set_sky(realm.sky)
|
||||
end
|
||||
end
|
||||
|
||||
function ns.check_position(m)
|
||||
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand("realm", {
|
||||
func = function(name, args)
|
||||
minetest.get_player_by_name(name):set_pos(ns.realms["outback"].min +(ns.realms["outback"].max -ns.realms["outback"].min) /2)
|
||||
ns.update_realm(rgt.players[name])
|
||||
end
|
||||
})
|
||||
2
mods/rgt_realms/mod.conf
Normal file
2
mods/rgt_realms/mod.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
name = rgt_realms
|
||||
depends = rgt_base
|
||||
Loading…
Add table
Add a link
Reference in a new issue