From 1bdebb2186ed6d0934c9670a6305042ad33c0e7a Mon Sep 17 00:00:00 2001 From: AliasAlreadyTaken Date: Sat, 20 Dec 2025 13:24:31 +0100 Subject: [PATCH] Allows user to enable or disable parts of the content --- init.lua | 85 ++++++++++++++++++++++++++++++++++++----------- settingtypes.txt | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 20 deletions(-) create mode 100644 settingtypes.txt diff --git a/init.lua b/init.lua index b8915f3..1dbb8fd 100644 --- a/init.lua +++ b/init.lua @@ -84,28 +84,73 @@ dofile(minetest.get_modpath("cottages").."/functions.lua"); -- anvil and threshing floor show huds dofile(minetest.get_modpath("cottages").."/hud_functions.lua"); --- uncomment parts you do not want -dofile(minetest.get_modpath("cottages").."/nodes_furniture.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_historic.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_feldweg.lua"); --- allows to dig hay and straw fast -dofile(minetest.get_modpath("cottages").."/nodes_pitchfork.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_straw.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_hay.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_anvil.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_doorlike.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_fences.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_roof.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_barrel.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_mining.lua"); -dofile(minetest.get_modpath("cottages").."/nodes_water.lua"); ---dofile(minetest.get_modpath("cottages").."/nodes_chests.lua"); +-- set the setting to false in minetest.conf if you do not want the specific part +if minetest.settings:get_bool("cottages_furniture", true) then + dofile(minetest.get_modpath("cottages").."/nodes_furniture.lua"); +end --- add receipes for threshing floor and handmill to unified_inventory -dofile(minetest.get_modpath("cottages").."/unified_inventory_receipes.lua"); +if minetest.settings:get_bool("cottages_historic", true) then + dofile(minetest.get_modpath("cottages").."/nodes_historic.lua"); +end --- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod -dofile(minetest.get_modpath("cottages").."/alias.lua"); +if minetest.settings:get_bool("cottages_feldweg", true) then + dofile(minetest.get_modpath("cottages").."/nodes_feldweg.lua"); +end + +if minetest.settings:get_bool("cottages_pitchfork", true) then + -- allows to dig hay and straw fast + dofile(minetest.get_modpath("cottages").."/nodes_pitchfork.lua"); +end + +if minetest.settings:get_bool("cottages_straw", true) then + dofile(minetest.get_modpath("cottages").."/nodes_straw.lua"); +end + +if minetest.settings:get_bool("cottages_hay", true) then + dofile(minetest.get_modpath("cottages").."/nodes_hay.lua"); +end + +if minetest.settings:get_bool("cottages_anvil", true) then + dofile(minetest.get_modpath("cottages").."/nodes_anvil.lua"); +end + +if minetest.settings:get_bool("cottages_doorlike", true) then + dofile(minetest.get_modpath("cottages").."/nodes_doorlike.lua"); +end + +if minetest.settings:get_bool("cottages_fences", true) then + dofile(minetest.get_modpath("cottages").."/nodes_fences.lua"); +end + +if minetest.settings:get_bool("cottages_roof", true) then + dofile(minetest.get_modpath("cottages").."/nodes_roof.lua"); +end + +if minetest.settings:get_bool("cottages_barrel", true) then + dofile(minetest.get_modpath("cottages").."/nodes_barrel.lua"); +end + +if minetest.settings:get_bool("cottages_mining", true) then + dofile(minetest.get_modpath("cottages").."/nodes_mining.lua"); +end + +if minetest.settings:get_bool("cottages_water", true) then + dofile(minetest.get_modpath("cottages").."/nodes_water.lua"); +end + +if minetest.settings:get_bool("cottages_chests", true) then + --dofile(minetest.get_modpath("cottages").."/nodes_chests.lua"); +end + +if minetest.settings:get_bool("cottages_unified_inventory_receipes", true) then + -- add receipes for threshing floor and handmill to unified_inventory + dofile(minetest.get_modpath("cottages").."/unified_inventory_receipes.lua"); +end + +if minetest.settings:get_bool("cottages_alias", true) then + -- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod + dofile(minetest.get_modpath("cottages").."/alias.lua"); +end -- variable no longer needed cottages.S = nil; diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..15990b2 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,86 @@ +[cottages] + +# Cottages Furniture +# Set this to false to disable the cottages_furniture content +# Optional, default is true +cottages_furniture (Cottages Furniture) bool true + +# Cottages Historic +# Set this to false to disable the cottages_historic content +# Optional, default is true +cottages_historic (Cottages Historic) bool true + +# Cottages Feldweg +# Set this to false to disable the cottages_feldweg content +# Optional, default is true +cottages_feldweg (Cottages Feldweg) bool true + +# Cottages Feldweg Mode +# Set this to choose the cottages_feldweg_mode +# Optional, default is "mesh" +cottages_feldweg_mode (Cottages Feldweg Mode) enum mesh mesh,simple,flat,nodebox,mesh_incl_45 + +# Cottages Pitchfork +# Set this to false to disable the cottages_pitchfork content +# Optional, default is true +cottages_pitchfork (Cottages Pitchfork) bool true + +# Cottages Straw +# Set this to false to disable the cottages_straw content +# Optional, default is true +cottages_straw (Cottages Straw) bool true + +# Cottages Hay +# Set this to false to disable the cottages_hay content +# Optional, default is true +cottages_hay (Cottages Hay) bool true + +# Cottages Anvil +# Set this to false to disable the cottages_anvil content +# Optional, default is true +cottages_anvil (Cottages Anvil) bool true + +# Cottages Doorlike +# Set this to false to disable the cottages_doorlike content +# Optional, default is true +cottages_doorlike (Cottages Doorlike) bool true + +# Cottages Fences +# Set this to false to disable the cottages_fences content +# Optional, default is true +cottages_fences (Cottages Fences) bool true + +# Cottages Roof +# Set this to false to disable the cottages_roof content +# Optional, default is true +cottages_roof (Cottages Roof) bool true + +# Cottages Barrel +# Set this to false to disable the cottages_barrel content +# Optional, default is true +cottages_barrel (Cottages Barrel) bool true + +# Cottages Mining +# Set this to false to disable the cottages_mining content +# Optional, default is true +cottages_mining (Cottages Mining) bool true + +# Cottages Water +# Set this to false to disable the cottages_water content +# Optional, default is true +cottages_water (Cottages Water) bool true + +# Cottages Chests +# Set this to false to disable the cottages_chests content +# Optional, default is true +cottages_chests (Cottages Chests) bool true + +# Cottages UI recipes +# Set this to false to disable the cottages_unified_inventory_receipes content +# Optional, default is true +cottages_unified_inventory_receipes (Cottages UI recipes) bool true + +# Cottages Alias +# Set this to false to disable the cottages_alias content +# Optional, default is true +cottages_alias (Cottages Alias) bool true