2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-03-02 19:35:36 -05:00
|
|
|
-- SKIP: include nodecore
|
2019-03-10 01:32:36 -05:00
|
|
|
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
|
2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2019-01-12 20:46:56 -05:00
|
|
|
local nodecore = rawget(_G, "nodecore") or {}
|
2018-11-02 07:52:23 -04:00
|
|
|
rawset(_G, "nodecore", nodecore)
|
2018-11-02 18:47:44 -04:00
|
|
|
|
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)
|
2018-11-02 21:20:51 -04:00
|
|
|
|
2019-09-07 09:08:57 -04:00
|
|
|
nodecore.product = "NodeCore"
|
2019-02-04 20:15:33 -05:00
|
|
|
nodecore.version = include("version")
|
2018-11-03 08:46:14 -04:00
|
|
|
|
2019-03-10 01:32:36 -05:00
|
|
|
local function callguard(n, t, k, v)
|
|
|
|
if type(v) ~= "function" then return v end
|
|
|
|
return function(first, ...)
|
|
|
|
if first == t then
|
2019-03-24 22:32:36 -04:00
|
|
|
error("called " .. n .. ":" .. k .. "() instead of " .. n .. "." .. k .. "()")
|
2019-03-10 01:32:36 -05:00
|
|
|
end
|
|
|
|
return v(first, ...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
for k, v in pairs(minetest) do
|
|
|
|
minetest[k] = callguard("minetest", minetest, k, v)
|
|
|
|
end
|
2019-08-27 19:14:51 -04:00
|
|
|
setmetatable(nodecore, {
|
|
|
|
__newindex = function(t, k, v)
|
2019-03-10 01:32:36 -05:00
|
|
|
rawset(nodecore, k, callguard("nodecore", t, k, v))
|
2019-08-27 19:14:51 -04:00
|
|
|
end
|
|
|
|
})
|
2019-03-10 01:32:36 -05:00
|
|
|
|
2019-10-27 10:05:57 -04:00
|
|
|
include("compat_vector")
|
2019-02-04 20:15:33 -05:00
|
|
|
include("issue7020")
|
2019-10-13 09:38:07 -04:00
|
|
|
include("issue9043")
|
2019-02-03 12:10:27 -05:00
|
|
|
|
2019-02-04 20:15:33 -05:00
|
|
|
include("util_misc")
|
2019-09-09 07:05:01 -04:00
|
|
|
include("util_falling")
|
2019-02-04 20:15:33 -05:00
|
|
|
include("util_scan_flood")
|
|
|
|
include("util_node_is")
|
|
|
|
include("util_toolcaps")
|
2019-02-23 09:44:22 -05:00
|
|
|
include("util_stack")
|
2019-02-23 13:14:09 -05:00
|
|
|
include("util_phealth")
|
2019-03-05 23:05:56 -05:00
|
|
|
include("util_facedir")
|
2019-04-06 23:51:05 -04:00
|
|
|
include("util_sound")
|
2019-08-23 20:40:33 -04:00
|
|
|
include("util_translate")
|
2019-08-27 21:41:03 -04:00
|
|
|
include("util_ezschematic")
|
2019-11-10 08:10:34 -05:00
|
|
|
include("util_gametime")
|
2019-02-04 20:16:54 -05:00
|
|
|
include("match")
|
2019-02-09 22:44:56 -05:00
|
|
|
|
|
|
|
include("fx_digparticles")
|
2019-01-06 12:02:37 -05:00
|
|
|
|
2019-02-04 20:15:33 -05:00
|
|
|
include("register_limited_abm")
|
2019-10-29 07:12:01 -04:00
|
|
|
include("register_aism")
|
Active ItemStack Modifier overhaul.
AISM's now tick against stacks, including in piles, shelves,
and player inventories, (hopefully) efficiently compared to
the old way with separate ABMs. Item entity support is also
possible, but not necessary yet.
This started out as a bugfix for being able to put a torch inside a
shelf, which didn't make much sense gameplay-wise. It ended up
going quite a bit further.
- Aggregate now gets wet in stack form. Swimming with dry
concrete now has consequences.
- Lux reactions, radiation, and infusion should now behave more
consistently.
- Sponges can now wet or dry in stack form, including inside
containers.
- Torch ignition, quenching, and extinguishing is now more
consistent regardless of context, and torches are now more
dangerous, and can ignite things in more contexts.
2019-10-29 20:03:00 -04:00
|
|
|
include("register_soaking")
|
2019-03-14 21:35:33 -04:00
|
|
|
include("register_ambiance")
|
2019-09-07 09:08:57 -04:00
|
|
|
include("register_mods")
|
2019-02-23 22:48:39 -05:00
|
|
|
include("mapgen_shared")
|
2018-11-02 19:08:59 -04:00
|
|
|
|
2019-02-04 20:15:33 -05:00
|
|
|
include("item_on_register")
|
|
|
|
include("item_drop_in_place")
|
|
|
|
include("item_falling_repose")
|
2019-10-15 20:35:26 -04:00
|
|
|
include("item_falling_settle")
|
2019-02-04 20:15:33 -05:00
|
|
|
include("item_alternate_loose")
|
|
|
|
include("item_group_visinv")
|
|
|
|
include("item_oldnames")
|
|
|
|
include("item_tool_wears_to")
|
2019-04-01 00:39:30 -04:00
|
|
|
include("item_tool_sounds")
|
2019-03-14 21:48:29 -04:00
|
|
|
include("item_punch_sounds")
|
2019-12-07 22:24:09 -05:00
|
|
|
include("item_nodebox_zfighting")
|
2019-12-09 04:46:33 -05:00
|
|
|
include("item_virtual")
|