68 lines
1.8 KiB
Lua
Raw Normal View History

-- LUALOCALS < ---------------------------------------------------------
2019-03-02 19:35:36 -05:00
-- SKIP: include nodecore
local dofile, error, minetest, pairs, rawget, rawset, setmetatable,
table, type
= dofile, error, minetest, pairs, rawget, rawset, setmetatable,
table, type
2019-02-04 20:15:33 -05:00
local table_concat, table_insert
= table.concat, table.insert
-- LUALOCALS > ---------------------------------------------------------
2019-01-12 20:46:56 -05:00
local nodecore = rawget(_G, "nodecore") or {}
rawset(_G, "nodecore", nodecore)
2019-02-04 20:15:33 -05:00
local include = rawget(_G, "include") or function(...)
local parts = {...}
table_insert(parts, 1, minetest.get_modpath(minetest.get_current_modname()))
if parts[#parts]:sub(-4) ~= ".lua" then
parts[#parts] = parts[#parts] .. ".lua"
end
return dofile(table_concat(parts, "/"))
end
rawset(_G, "include", include)
2019-02-04 20:15:33 -05:00
nodecore.version = include("version")
local function callguard(n, t, k, v)
if type(v) ~= "function" then return v end
return function(first, ...)
if first == t then
error("called " .. t .. ":" .. k .. "() instead of " .. t .. "." .. k .. "()")
end
return v(first, ...)
end
end
for k, v in pairs(minetest) do
minetest[k] = callguard("minetest", minetest, k, v)
end
setmetatable(nodecore, {__newindex = function(t, k, v)
rawset(nodecore, k, callguard("nodecore", t, k, v))
end})
2019-02-04 20:15:33 -05:00
include("issue7020")
2019-02-04 20:15:33 -05:00
include("util_misc")
include("util_scan_flood")
include("util_logtrace")
include("util_node_is")
include("util_toolcaps")
include("util_stack")
include("util_phealth")
2019-03-05 23:05:56 -05:00
include("util_facedir")
2019-02-04 20:16:54 -05:00
include("match")
include("fx_digparticles")
2019-02-04 20:15:33 -05:00
include("register_limited_abm")
2019-03-14 21:35:33 -04:00
include("register_ambiance")
include("mapgen_shared")
2019-02-04 20:15:33 -05:00
include("item_on_register")
include("item_drop_in_place")
include("item_falling_repose")
include("item_alternate_loose")
include("item_group_visinv")
include("item_oldnames")
include("item_tool_wears_to")
2019-03-14 21:48:29 -04:00
include("item_punch_sounds")