241e79647f
A somewhat more optimized and cleaned up version of what I used to rip the node appearances for Klots. Added: - Custom dumper with more compact format support - Detecting reused tables and extracting into local vars - Actually handling the media files instead of handing a list to the user to go find via shell script - Documentation, more chatcommands
22 lines
581 B
Lua
22 lines
581 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local loadfile, minetest, unpack
|
|
= loadfile, minetest, unpack
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
local include
|
|
do
|
|
local modpath = minetest.get_modpath(modname)
|
|
local included = {}
|
|
include = function(n)
|
|
local found = included[n]
|
|
if found ~= nil then return unpack(found) end
|
|
found = {loadfile(modpath .. "/" .. n .. ".lua")(include)}
|
|
included[n] = found
|
|
return unpack(found)
|
|
end
|
|
end
|
|
|
|
include("commands")
|