technic/technic/init.lua

52 lines
1.1 KiB
Lua
Raw Normal View History

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
technic = {}
2013-07-11 18:19:09 +02:00
local modpath = minetest.get_modpath("technic")
technic.modpath = modpath
technic.dprint = function(string)
if technic.DBG == 1 then
print(string)
end
end
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")
-- Register functions
dofile(modpath.."/register_machine_and_tool.lua")
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)
if player:get_player_name() ~= meta:get_string("owner") then
return false
end
return true
2013-01-27 14:03:46 +01:00
end
-- Swap nodes out. Return the node name.
2013-01-27 14:03:46 +01:00
function hacky_swap_node(pos,name)
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