Modular Multipurpose Minetest Modding Library
Go to file
Lars Mueller 2b1c9cff7c Add support for new texture modifiers
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`.
2023-05-31 20:12:18 +02:00
build Move text.utf8 to utf8.char 2022-09-09 14:17:18 +02:00
doc Add experimental texture modifier DSL 2023-05-24 19:39:20 +02:00
minetest Add support for new texture modifiers 2023-05-31 20:12:18 +02:00
persistence Experimental modules have matured 2022-09-09 14:45:54 +02:00
web Move text.utf8 to utf8.char 2022-09-09 14:17:18 +02:00
b3d.lua b3d -> glTF: Fix handling of static vertices in animated meshes 2023-04-02 14:52:57 +02:00
base64.lua Add base64 encoding & decoding 2023-02-28 13:39:20 +01:00
binary.lua binary: Float writing: Fix exponent assertions 2022-07-03 13:29:49 +02:00
bluon.lua Experimental modules have matured 2022-09-09 14:45:54 +02:00
file.lua text.split[_unlimited]: Use pattern by default 2022-09-28 20:50:25 +02:00
func.lua Add func.identity 2022-09-30 16:09:16 +02:00
hashheap.lua Fix hashheap 2022-01-19 17:17:07 +01:00
hashlist.lua Fix hashlist:pop_head 2021-12-27 20:09:26 +01:00
heap.lua Heap: Localize math.floor & table.insert 2022-01-19 16:38:06 +01:00
init.lua Bump version 2023-04-02 15:10:53 +02:00
iterator.lua Add various iterator.* functions 2022-10-01 12:56:24 +02:00
json.lua Fix json.new setting an invalid metatable 2023-02-25 20:33:24 +01:00
kdtree.lua Redo environments 2021-06-17 19:45:08 +02:00
less_than.lua Add less_than function utility module 2022-10-01 18:11:44 +02:00
License.txt Add proper license file 2021-07-06 22:03:44 +02:00
logo.svg Minor logo fixes 2021-09-11 10:10:52 +02:00
luon.lua Luon: Incorporate changes to MT serializer 2022-10-02 14:18:16 +02:00
math.lua Fix math.fround 2023-02-26 16:47:39 +01:00
matrix4.lua Add basic 4x4 matrix "class" (for b3d to glTF) 2023-02-26 13:18:10 +01:00
minetest.lua Add experimental texture modifier DSL 2023-05-24 19:39:20 +02:00
mod.conf Update mod.conf: Add dbg & strictest as opt deps 2022-07-10 15:43:52 +02:00
persistence.lua Clean up persistence.lua 2022-02-27 17:41:25 +01:00
quaternion.lua Add quaternion.len 2023-02-26 14:46:13 +01:00
Readme.md Readme: Acknowledge grorp's contributions 2022-10-29 17:31:23 +02:00
schema.lua Fix table values constraint in schema validation 2022-09-18 16:06:12 +02:00
table.lua Add table.(slice|splice|move) 2022-10-01 14:34:31 +02:00
text.lua Fix text.lines & deprecate text.split_lines 2022-09-29 21:06:51 +02:00
trie.lua Trie: Remove TODO comment 2022-08-19 18:19:45 +02:00
utf8.lua Add utf8.codes iterator; change utf8.codepoint 2022-10-01 20:39:25 +02:00
vararg.lua Add vararg module & move func.aggregate to it 2022-09-07 12:43:16 +02:00
vector.lua Add vector.reflect 2022-09-09 14:34:42 +02:00
web.lua Add web.uri.encode[_component] 2022-01-19 17:24:29 +01:00

Logo 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

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.