2013-04-04 01:17:39 +02:00
|
|
|
-- Minetest 0.4.6 mod: technic
|
|
|
|
-- namespace: technic
|
|
|
|
-- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
|
2013-01-27 14:03:46 +01:00
|
|
|
|
2013-06-30 07:12:02 +02:00
|
|
|
technic = {}
|
|
|
|
|
2013-07-11 18:19:09 +02:00
|
|
|
local modpath = minetest.get_modpath("technic")
|
|
|
|
|
|
|
|
technic.modpath = modpath
|
|
|
|
|
2013-07-02 00:03:36 +02:00
|
|
|
technic.dprint = function(string)
|
2013-07-08 22:53:44 +02:00
|
|
|
if technic.DBG == 1 then
|
|
|
|
print(string)
|
|
|
|
end
|
|
|
|
end
|
2013-07-02 00:03:36 +02:00
|
|
|
|
2013-01-27 14:03:46 +01:00
|
|
|
--Read technic config file
|
|
|
|
dofile(modpath.."/config.lua")
|
2013-02-21 22:01:49 +01:00
|
|
|
--helper functions
|
|
|
|
dofile(modpath.."/helpers.lua")
|
2013-01-27 14:03:46 +01:00
|
|
|
|
|
|
|
--items
|
|
|
|
dofile(modpath.."/items.lua")
|
|
|
|
|
2013-07-02 00:03:36 +02:00
|
|
|
-- Register functions
|
|
|
|
dofile(modpath.."/register_machine_and_tool.lua")
|
2013-07-11 01:04:58 +02:00
|
|
|
|
2013-07-11 18:19:09 +02:00
|
|
|
-- Machines
|
|
|
|
dofile(modpath.."/machines/init.lua")
|
2013-02-06 15:34:01 +01:00
|
|
|
|
2013-01-27 14:03:46 +01:00
|
|
|
function has_locked_chest_privilege(meta, player)
|
2013-07-02 00:03:36 +02:00
|
|
|
if player:get_player_name() ~= meta:get_string("owner") then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
return true
|
2013-01-27 14:03:46 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2013-07-02 00:03:36 +02:00
|
|
|
-- Swap nodes out. Return the node name.
|
2013-01-27 14:03:46 +01:00
|
|
|
function hacky_swap_node(pos,name)
|
2013-07-02 00:03:36 +02:00
|
|
|
local node = minetest.env:get_node(pos)
|
|
|
|
if node.name ~= name then
|
|
|
|
local meta = minetest.env:get_meta(pos)
|
|
|
|
local meta0 = meta:to_table()
|
|
|
|
node.name = name
|
|
|
|
minetest.env:set_node(pos,node)
|
|
|
|
meta = minetest.env:get_meta(pos)
|
|
|
|
meta:from_table(meta0)
|
|
|
|
end
|
|
|
|
return node.name
|
2013-01-27 14:03:46 +01:00
|
|
|
end
|