From 20a9a9ce93f5562a84cfe06ba898a93e5ab4f5df Mon Sep 17 00:00:00 2001 From: luk3yx Date: Wed, 10 Mar 2021 19:53:55 +1300 Subject: [PATCH] Allow disabling node meta overrides --- README.md | 3 +++ monkey_patching.lua | 4 ++++ settingtypes.txt | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 settingtypes.txt diff --git a/README.md b/README.md index 3c9b91f..54b4b1f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ sent to them to try and make sure they are at least usable. - If your mod stores `minetest.show_formspec` during load time, you'll need to add `fs51` as an optional dependency to `mod.conf` so it can use the patched show_formspec code. + - If a mod you use has broken node formspecs with fs51 enabled, try adding + `fs51.disable_meta_override = true` to minetest.conf (and please open an + issue against fs51). ## Dependencies diff --git a/monkey_patching.lua b/monkey_patching.lua index 7683083..6f40173 100644 --- a/monkey_patching.lua +++ b/monkey_patching.lua @@ -100,6 +100,10 @@ minetest.register_on_joinplayer(function(player) end end) +if minetest.settings:get_bool('fs51.disable_meta_override') then + return +end + -- Patch minetest.get_meta() -- Inspired by https://gitlab.com/sztest/nodecore/-/blob/master/mods/nc_api local old_nodemeta_set_string diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..da14732 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,5 @@ +# Disables all automatic formspec translation. +fs51.disable_monkey_patching (Prevent fs51 auto-translation) bool false + +# Disables node meta formspec translation. +fs51.disable_meta_override (Prevent node meta override) bool false