Redo code style

entity
Benrob0329 2017-04-04 21:58:09 -04:00
parent 95179a88bc
commit b630fe5c43
5 changed files with 554 additions and 540 deletions

396
demat.lua
View File

@ -1,226 +1,226 @@
function tardis.demat(owner)
local pos = tardis.owners[owner]["exterior"]
minetest.set_node(pos, {name = "tardis:tardis_demat"})
function tardis.demat (owner)
local pos = tardis.tardises [owner]["exterior"]
tardis.owners[owner]["in_vortex"] = true
minetest.sound_play("tardis_demat", {
pos = pos,
max_hear_distance = 100,
gain = 10,
})
minetest.set_node (pos, {name = "tardis:tardis_demat"})
tardis.tardises [owner]["in_vortex"] = true
minetest.sound_play ("tardis_demat", {
pos = pos ,
max_hear_distance = 100 ,
gain = 10 ,
})
end
minetest.register_node("tardis:tardis_demat", {
tiles = {"tardis_exterior.png^[opacity:255"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 5,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_1"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(7)
end,
minetest.register_node ("tardis:tardis_demat", {
tiles = {"tardis_exterior.png^[opacity:255"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 5 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_1"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(7)
end ,
})
minetest.register_node("tardis:tardis_demat_1", {
tiles = {"tardis_exterior.png^[opacity:225"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_2"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_1", {
tiles = {"tardis_exterior.png^[opacity:225"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_2"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_2", {
tiles = {"tardis_exterior.png^[opacity:200"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_3"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_2", {
tiles = {"tardis_exterior.png^[opacity:200"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_3"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_3", {
tiles = {"tardis_exterior.png^[opacity:175"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_4"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
tiles = {"tardis_exterior.png^[opacity:175"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_4"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_4", {
tiles = {"tardis_exterior.png^[opacity:150"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_5"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(0.5)
end,
minetest.register_node ("tardis:tardis_demat_4", {
tiles = {"tardis_exterior.png^[opacity:150"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_5"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(0.5)
end ,
})
minetest.register_node("tardis:tardis_demat_5", {
tiles = {"tardis_exterior.png^[opacity:125"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_6"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_5", {
tiles = {"tardis_exterior.png^[opacity:125"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_6"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_6", {
tiles = {"tardis_exterior.png^[opacity:100"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_7"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_6", {
tiles = {"tardis_exterior.png^[opacity:100"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_7"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_7", {
tiles = {"tardis_exterior.png^[opacity:75"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
light_source = 10,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_8"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_7", {
tiles = {"tardis_exterior.png^[opacity:75"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
light_source = 10 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_8"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_8", {
tiles = {"tardis_exterior.png^[opacity:50"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_9"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_8", {
tiles = {"tardis_exterior.png^[opacity:50"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_9"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_9", {
tiles = {"tardis_exterior.png^[opacity:25"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 7,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_10"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_9", {
tiles = {"tardis_exterior.png^[opacity:25"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 7 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_10"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_demat_10", {
tiles = {"tardis_exterior.png^[opacity:10"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
minetest.set_node(pos, {name = "tardis:tardis_demat_11"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(0.5)
end,
minetest.register_node ("tardis:tardis_demat_10", {
tiles = {"tardis_exterior.png^[opacity:10"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
minetest.set_node (pos, {name = "tardis:tardis_demat_11"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(0.5)
end ,
})
minetest.register_node("tardis:tardis_demat_11", {
tiles = {"tardis_exterior.png^[opacity:5"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 5,
on_timer = function(pos)
minetest.set_node(pos, {name = "air"})
minetest.forceload_free_block(pos)
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_demat_11", {
tiles = {"tardis_exterior.png^[opacity:5"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 5 ,
on_timer = function (pos)
minetest.set_node (pos, {name = "air"})
minetest.forceload_free_block (pos)
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})

View File

@ -1,58 +1,75 @@
function tardis.swap_node(pos, name)
local meta = minetest.get_meta(pos)
local meta_old = meta:to_table()
minetest.set_node(pos, name)
local meta = minetest.get_meta(pos)
meta:from_table(meta_old)
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local worldpath = minetest.get_worldpath()
function tardis.swap_node (pos, name)
local meta = minetest.get_meta (pos)
local meta_old = meta:to_table()
minetest.set_node (pos, name)
local meta = minetest.get_meta (pos)
meta:from_table (meta_old)
end
function tardis:spawn_interior(pos, owner)
local place_pos = {x = pos["x"], y = 30000, z = pos["z"]}
local interior_doors_pos = { x = (place_pos["x"] + 5),y = (place_pos["y"] + 1),z = (place_pos["z"] +1) }
local demat_lever_pos = {x = (place_pos["x"] + 4) , y = (place_pos["y"] + 2) , z = (place_pos["z"] + 7) }
minetest.place_schematic(place_pos, modpath .. "/schematics/tardis_interior.mts")
tardis.owners[owner] = {}
tardis.owners[owner]["exterior"] = pos
tardis.owners[owner]["interior"] = interior_doors_pos
tardis.owners[owner]["in_vortex"] = false
function tardis:spawn_interior (pos, owner)
local place_pos = {
x = pos ["x"] ,
y = 30000 ,
z = pos ["z"] ,
}
local interior_doors_pos = {
x = (place_pos ["x"] + 5) ,
y = (place_pos ["y"] + 1) ,
z = (place_pos ["z"] + 1) ,
}
local demat_lever_pos = {
x = (place_pos ["x"] + 4) ,
y = (place_pos ["y"] + 2) ,
z = (place_pos ["z"] + 7) ,
}
local demat_meta = minetest.get_meta(demat_lever_pos)
demat_meta:set_string("owner", owner)
local interior_doors_meta = minetest.get_meta(interior_doors_pos)
interior_doors_meta:set_string("owner", owner)
print(minetest.pos_to_string(tardis.owners[owner]["interior"]))
minetest.place_schematic (place_pos, modpath .. "/schematics/tardis_interior.mts")
local file = io.open(worldpath .. "/tardis.owners", "w+")
file:write(minetest.serialize(tardis.owners))
file:close()
tardis.tardises [owner] = {}
tardis.tardises [owner]["exterior"] = pos
tardis.tardises [owner]["interior"] = interior_doors_pos
tardis.tardises [owner]["in_vortex"] = false
local demat_meta = minetest.get_meta (demat_lever_pos)
demat_meta:set_string ("owner", owner)
local interior_doors_meta = minetest.get_meta (interior_doors_pos)
interior_doors_meta:set_string ("owner", owner)
minetest.log("info", minetest.pos_to_string (tardis.tardises [owner]["interior"] ))
local file = io.open (worldpath .. "/tardis.tardises", "w+")
file:write ( minetest.serialize (tardis.tardises) )
file:close()
end
function tardis.set_nav(player, owner)
local player_name = player:get_player_name()
minetest.show_formspec(player_name, "tardis:remat_form",
"size[4,3]" ..
"field[1,1.5;3,1;coords;Co-ords;]" ..
"button_exit[1,2;2,1;exit;Go!]")
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "tardis:remat_form" then
function tardis.set_nav (player, owner)
local player_name = player:get_player_name()
minetest.show_formspec (player_name, "tardis:remat_form",
"size[4,3]" ..
"field[1,1.5;3,1;coords;Co-ords;]" ..
"button_exit[1,2;2,1;exit;Go!]")
minetest.register_on_player_receive_fields (function (player, formname, fields)
if formname ~= "tardis:remat_form" then
return false
end
end
local coords = minetest.string_to_pos(fields.coords)
local coords = minetest.string_to_pos (fields.coords)
if (coords == nil) then
minetest.chat_send_player(player_name, "Please Enter Valed Coords")
else
tardis.owners[owner]["destination"] = coords
if (coords == nil) then
minetest.chat_send_player (player_name, "Please Enter Valed Coords")
else
tardis.tardises [owner]["destination"] = coords
return true
end
end)
end
end)
end

View File

@ -1,36 +1,37 @@
tardis = {}
tardis.owners = {}
tardis.tardises = {}
modpath = minetest.get_modpath(minetest.get_current_modname())
worldpath = minetest.get_worldpath()
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local worldpath = minetest.get_worldpath()
dofile(modpath .. "/remat.lua")
dofile(modpath .. "/demat.lua")
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/nodes.lua")
local file = io.open(worldpath .. "/tardis.owners", "r")
local file = io.open(worldpath .. "/tardis.tardises", "r")
if file then
tardis.owners = minetest.deserialize(file:read("*all"))
file:close()
tardis.tardises = minetest.deserialize(file:read("*all"))
file:close()
end
minetest.register_chatcommand("set_nav", {
func = function(name, param)
if (tardis.owners[name] == nil) then
name.chat_send_player(name, "Must be owner!")
else
local owner = name
local player = minetest.get_player_by_name(name)
tardis.set_nav(player, owner)
end
end
func = function(name, param)
if (tardis.tardises[name] == nil) then
name.chat_send_player(name, "Must be owner!")
else
local owner = name
local player = minetest.get_player_by_name(name)
tardis.set_nav(player, owner)
end
end
})
minetest.register_on_shutdown(function()
local file = io.open(worldpath .. "/tardis.owners", "w+")
file:write(minetest.serialize(tardis.owners))
file:close()
local file = io.open(worldpath .. "/tardis.tardises", "w+")
file:write(minetest.serialize(tardis.tardises))
file:close()
end)

199
nodes.lua
View File

@ -1,122 +1,119 @@
minetest.register_node("tardis:tardis", {
decription = "Time And Reletive Dimention In Space",
tiles = {"tardis_exterior.png"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
minetest.register_node ("tardis:tardis", {
decription = "Time And Relative Dimention In Space" ,
tiles = { "tardis_exterior.png" } ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
local player = placer:get_player_name()
tardis.swap_node(pos, {name = "tardis:tardis"})
if (player == nil) then
local meta = minetest.get_meta(pos)
local player = meta:get_string("owner")
on_place = function (itemstack, placer, pointed_thing)
local pos = pointed_thing.above
local player = placer:get_player_name()
tardis.swap_node (pos, {name = "tardis:tardis"})
tardis.owners[player]["exterior"] = pos
if (player == nil) then
local meta = minetest.get_meta (pos)
local player = meta:get_string ("owner")
tardis.tardises [player]["exterior"] = pos
elseif (tardis.tardises [player] == nil) then
tardis:spawn_interior (pos, player)
else
tardis.tardises [player]["exterior"] = pos
end
elseif (tardis.owners[player] == nil) then
tardis:spawn_interior(pos, player)
else
tardis.owners[player]["exterior"] = pos
end
local meta = minetest.get_meta(pos)
meta:set_string("owner", player)
local meta = minetest.get_meta (pos)
meta:set_string ("owner", player)
itemstack:take_item (1)
end ,
itemstack:take_item(1)
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
local teleport = tardis.owners[owner]["interior"]
player.setpos(player, teleport)
--player.set_look_horizontal(0)
end,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta (pos)
local owner = meta:get_string ("owner")
local teleport = tardis.tardises [owner]["interior"]
player.setpos (player, teleport)
--player.set_look_horizontal(0)
end ,
})
minetest.register_node("tardis:demat_lever_on", {
groups = {crumbly = 1},
tiles = {"tardis_demat.png"},
drawtype = "mesh",
mesh = "tardis_demat_on.obj",
paramtype = "light",
is_ground_content = true,
minetest.register_node ("tardis:demat_lever_on", {
tiles = {"tardis_demat.png"} ,
drawtype = "mesh" ,
mesh = "tardis_demat_on.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local player_name = player:get_player_name()
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
if (tardis.remat(owner) == false) then
minetest.chat_send_player(player_name, "Nav Not Set!!")
else
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
local player_name = player:get_player_name()
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
minetest.sound_play("tardis_demat", {
pos = pos,
max_hear_distance = 10,
gain = 10,
})
minetest.swap_node(pos, {name = "tardis:demat_lever_off"})
end
end
if (tardis.remat (owner) == false) then
minetest.chat_send_player (player_name, "Nav Not Set!!")
else
minetest.sound_play ("tardis_demat", {
pos = pos ,
max_hear_distance = 10 ,
gain = 10 ,
})
minetest.swap_node (pos, {name = "tardis:demat_lever_off"})
end
end
})
minetest.register_node("tardis:demat_lever_off", {
groups = {crumbly = 1},
tiles = {"tardis_demat.png"},
drawtype = "mesh",
mesh = "tardis_demat_off.obj",
paramtype = "light",
is_ground_content = true,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
tardis.demat(owner)
minetest.register_node ("tardis:demat_lever_off", {
groups = {crumbly = 1} ,
tiles = {"tardis_demat.png"} ,
drawtype = "mesh" ,
mesh = "tardis_demat_off.obj" ,
paramtype = "light" ,
is_ground_content = true ,
minetest.sound_play("tardis_demat", {
pos = pos,
max_hear_distance = 10,
gain = 10,
})
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
minetest.swap_node(pos, {name = "tardis:demat_lever_on"})
tardis.demat (owner)
minetest.sound_play ("tardis_demat", {
pos = pos ,
max_hear_distance = 10 ,
gain = 10 ,
})
end,
minetest.swap_node (pos, {name = "tardis:demat_lever_on"})
end ,
})
minetest.register_node("tardis:interior_doors", {
tiles = {"tardis_exterior.png"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_interior_doors.obj",
paramtype = "light",
is_ground_content = true,
minetest.register_node ("tardis:interior_doors", {
tiles = {"tardis_exterior.png"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_interior_doors.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
print(owner)
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta (pos)
local owner = meta:get_string ("owner")
if ( tardis.owners[owner]["in_vortex"] == false ) then
local teleport = tardis.owners[owner]["exterior"]
player:setpos(teleport)
end
end
if (tardis.tardises == nil) or
(tardis.tardises [owner] == nil) or
(tardis.tardises [owner]["in_vortex"] == nil) then
minetest.log ("error", "in_vortex not initialised for " .. owner)
return
end
if (tardis.tardises [owner]["in_vortex"] == false) then
local teleport = tardis.tardises [owner]["exterior"]
player:setpos (teleport)
else
minetest.chat_send_player (player, "TARDIS In Vortex, Door Locked Automaticly")
end
end
})

351
remat.lua
View File

@ -1,203 +1,202 @@
function tardis.remat(owner)
function tardis.remat (owner)
if (tardis.tardises [owner]["destination"] == nil) then
return false
else
local pos = tardis.tardises [owner]["destination"]
if (tardis.owners[owner]["destination"] == nil) then
return false
else
local pos = tardis.owners[owner]["destination"]
minetest.forceload_block (pos)
minetest.set_node (pos, {name = "tardis:tardis_remat"})
minetest.forceload_block(pos)
minetest.set_node(pos, {name = "tardis:tardis_remat"})
local meta = minetest.get_meta(pos)
meta:set_string("owner", owner)
tardis.owners[owner]["exterior"] = pos
minetest.sound_play("tardis_remat", {
pos = pos,
max_hear_distance = 100,
gain = 10,
})
end
local meta = minetest.get_meta (pos)
meta:set_string ("owner", owner)
tardis.tardises [owner]["exterior"] = pos
minetest.sound_play ("tardis_remat", {
pos = pos ,
max_hear_distance = 100 ,
gain = 10 ,
})
end
end
minetest.register_node("tardis:tardis_remat", {
tiles = {"tardis_exterior.png^[opacity:1"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_1"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(11)
end,
minetest.register_node ("tardis:tardis_remat", {
tiles = {"tardis_exterior.png^[opacity:1"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_1"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(11)
end ,
})
minetest.register_node("tardis:tardis_remat_1", {
tiles = {"tardis_exterior.png^[opacity:25"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 7,
minetest.register_node ("tardis:tardis_remat_1", {
tiles = {"tardis_exterior.png^[opacity:25"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 7 ,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_2"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1.5)
end,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_2"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1.5)
end ,
})
minetest.register_node("tardis:tardis_remat_2", {
tiles = {"tardis_exterior.png^[opacity:50"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_3"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_remat_2", {
tiles = {"tardis_exterior.png^[opacity:50"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_3"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_remat_3", {
tiles = {"tardis_exterior.png^[opacity:75"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_4"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_remat_3", {
tiles = {"tardis_exterior.png^[opacity:75"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_4"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_remat_4", {
tiles = {"tardis_exterior.png^[opacity:100"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_5"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(0.5)
end,
minetest.register_node ("tardis:tardis_remat_4", {
tiles = {"tardis_exterior.png^[opacity:100"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_5"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(0.5)
end ,
})
minetest.register_node("tardis:tardis_remat_5", {
tiles = {"tardis_exterior.png^[opacity:125"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_6"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_remat_5", {
tiles = {"tardis_exterior.png^[opacity:125"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_6"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_remat_6", {
tiles = {"tardis_exterior.png^[opacity:150"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_7"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_remat_6", {
tiles = {"tardis_exterior.png^[opacity:150"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_7"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_remat_7", {
tiles = {"tardis_exterior.png^[opacity:175"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
light_source = 10,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_8"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
minetest.register_node ("tardis:tardis_remat_7", {
tiles = {"tardis_exterior.png^[opacity:175"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
light_source = 10 ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_8"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})
minetest.register_node("tardis:tardis_remat_8", {
tiles = {"tardis_exterior.png^[opacity:200"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis_remat_9"})
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(0.5)
end,
minetest.register_node ("tardis:tardis_remat_8", {
tiles = {"tardis_exterior.png^[opacity:200"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis_remat_9"})
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(0.5)
end ,
})
minetest.register_node("tardis:tardis_remat_9", {
tiles = {"tardis_exterior.png^[opacity:225"},
use_texture_alpha = true,
drawtype = "mesh",
mesh = "tardis_exterior.obj",
paramtype = "light",
is_ground_content = true,
light_source = 10,
on_timer = function(pos)
tardis.swap_node(pos, {name = "tardis:tardis"})
minetest.register_node ("tardis:tardis_remat_9", {
tiles = {"tardis_exterior.png^[opacity:225"} ,
use_texture_alpha = true ,
drawtype = "mesh" ,
mesh = "tardis_exterior.obj" ,
paramtype = "light" ,
is_ground_content = true ,
light_source = 10 ,
local meta = minetest.get_meta(pos)
owner = meta:get_string("owner")
on_timer = function (pos)
tardis.swap_node (pos, {name = "tardis:tardis"})
tardis.owners[owner]["in_vortex"] = false
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(1)
end,
local meta = minetest.get_meta (pos)
owner = meta:get_string ("owner")
tardis.tardises [owner]["in_vortex"] = false
end ,
on_construct = function (pos)
minetest.get_node_timer (pos):start(1)
end ,
})