mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-24 16:23:43 +01:00
Modular Multipurpose Minetest Modding Library
2b1c9cff7c
https://github.com/minetest/minetest/pull/10100 has introduced a few inconsistencies with the formats of previous texture modifiers: `[fill` is the first texture modifier to have a modifying and a generating variant. Thus `texmod` "constructors" and `texmod` "modifiers" / methods had to be separated; `texmod.fill` is not the same as `tm.fill` where `tm` is `texmod` instance. It is rather dirty that the generating variant would ignore extraneous parameters of the modifying variant, so this is not replicated by the parser. `[hsl`, `[colorizehsl`, `[contrast` and `[screen` are pretty standard texture modifiers as far as the DSL is concerned. `[hsl` and `[colorizehsl` are very similar. `[hardlight` is the first texture modifier to exist just for swapping the base and parameter. `a^[overlay:b` and `b^[hardlight:a` are both normalized to `b:[hardlight:a` by the DSL. `[overlay` (called "overlay blend" in the docs) creates a naming conflict with literal overlaying (`^`). This is resolved by renaming `:overlay` to `:blit`. |
||
---|---|---|
build | ||
doc | ||
minetest | ||
persistence | ||
web | ||
b3d.lua | ||
base64.lua | ||
binary.lua | ||
bluon.lua | ||
file.lua | ||
func.lua | ||
hashheap.lua | ||
hashlist.lua | ||
heap.lua | ||
init.lua | ||
iterator.lua | ||
json.lua | ||
kdtree.lua | ||
less_than.lua | ||
License.txt | ||
logo.svg | ||
luon.lua | ||
math.lua | ||
matrix4.lua | ||
minetest.lua | ||
mod.conf | ||
persistence.lua | ||
quaternion.lua | ||
Readme.md | ||
schema.lua | ||
table.lua | ||
text.lua | ||
trie.lua | ||
utf8.lua | ||
vararg.lua | ||
vector.lua | ||
web.lua |
Modding Library (modlib
)
Multipurpose Minetest Modding Library
At a glance
No dependencies. Licensed under the MIT License. Written by Lars Mueller aka LMD or appguru(eu). Requires Lua 5.1 / LuaJIT.
Acknowledgement
- luk3yx: Various suggestions, bug reports and fixes
- grorp (Gregor Parzefall): Bug reports & proposed fixes for node box code
- NobWow: Another bugfix
Principles
- Game-agnostic: Modlib aims to provide nothing game-specific;
- Minimal invasiveness: Modlib should not disrupt other mods; even at the expense of syntactic sugar, changes to the global environment - apart from the addition of the modlib scope - are forbidden
- Architecture: Modlib is organized hierarchically
- Performance: Modlib tries to not compromise performance for convenience; modlib loads lazily
Tests
The tests are located in a different repo, modlib_test
, as they are quite heavy due to testing the PNG reader using PngSuite. Reading the tests for examples of API usage is recommended.
API
(Incomplete) documentation resides in the doc
folder; you'll have to dive into the code for everything else.
The mod namespace is modlib
, containing all modules which in turn contain variables & functions.
Modules are lazily loaded by indexing the modlib
table. Do _ = modlib.<module>
to avoid file load spikes at run time.
Localizing modules (local <module> = modlib.<module>
) is recommended.