From 1ddc1abb97247cb53801c3b32b706db6ec82c3fc Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 1 Sep 2022 12:10:12 +0200 Subject: [PATCH] Add setting for bookshelf inventories --- mods/ITEMS/mcl_books/init.lua | 3 +++ settingtypes.txt | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_books/init.lua b/mods/ITEMS/mcl_books/init.lua index 14a102478..af84feb66 100644 --- a/mods/ITEMS/mcl_books/init.lua +++ b/mods/ITEMS/mcl_books/init.lua @@ -5,6 +5,8 @@ local C = minetest.colorize local max_text_length = 4500 -- TODO: Increase to 12800 when scroll bar was added to written book local max_title_length = 64 +local bookshelf_inv = minetest.settings:get_bool("mcl_bookshelf_inventories",true) + local header = "" if minetest.get_modpath("mcl_init") then header = "no_prepend[]" .. mcl_vars.gui_nonbg .. mcl_vars.gui_bg_color .. @@ -366,6 +368,7 @@ local function protection_check_put_take(pos, listname, index, stack, player) end local function bookshelf_gui(pos, node, clicker) + if not bookshelf_inv then return end local name = minetest.get_meta(pos):get_string("name") if name == "" then diff --git a/settingtypes.txt b/settingtypes.txt index a883905c6..8d8291a0a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -172,6 +172,10 @@ fix_doubleplants (Mcimport double plant fixes) bool true # Allow players to create Minecraft-like maps. enable_real_maps (Enable Real Maps) bool true +[Additional Features] +# Enable Bookshelf inventories +mcl_bookshelf_inventories (Enable bookshelf inventories) bool true + [Debugging] # If enabled, this will show the itemstring of an item in the description. -mcl_item_id_debug (Item ID Debug) bool false \ No newline at end of file +mcl_item_id_debug (Item ID Debug) bool false