From 3a37b1c8cc124fd75cae0e8c2ca7098a81ce3c36 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 3 Nov 2022 00:24:16 +0100 Subject: [PATCH] Add a setting to disable hunger --- mods/PLAYER/mcl_hunger/init.lua | 5 ++--- settingtypes.txt | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 9f25c5eda..321139c5f 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -11,10 +11,9 @@ Hunger is enabled when damage is enabled. If the damage setting is changed within the game, this does NOT update the hunger mechanic, so the game must be restarted for this to take effect. ]] -if minetest.settings:get_bool("enable_damage") == true then +mcl_hunger.active = false +if minetest.settings:get_bool("enable_damage") == true and minetest.settings:get_bool("mcl_enable_hunger") ~= false then mcl_hunger.active = true -else - mcl_hunger.active = false end mcl_hunger.HUD_TICK = 0.1 diff --git a/settingtypes.txt b/settingtypes.txt index 4c376d9c7..3c3344258 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -77,6 +77,9 @@ mcl_hand_range (Hand range) float 4.5 1 128 # Default:10 mcl_hand_range_creative (Creative mode hand range) float 10 1 128 +# If enabled the hunger mechanic will be active +mcl_enable_hunger (Hunger mechanic) bool true + [Mobs] # If enabled, mobs will spawn naturally. This does not affect # affect mob spawners.