From a652652310c0023ea0c58c47e76fd6dd0079f1cd Mon Sep 17 00:00:00 2001 From: Michal Cieslakiewicz Date: Fri, 12 Oct 2018 08:50:34 +0200 Subject: [PATCH] minertools: add flashlight setting for UMG. UMG can be a light source when enabled in mod settings. This works with wielded_light or similar mods, otherwise it does not matter. Signed-off-by: Michal Cieslakiewicz --- minertools/init.lua | 8 ++++++++ minertools/settingtypes.txt | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 minertools/settingtypes.txt diff --git a/minertools/init.lua b/minertools/init.lua index 2706a72..99eb3fe 100644 --- a/minertools/init.lua +++ b/minertools/init.lua @@ -17,6 +17,13 @@ minertools = {} --------- ]]-- +-- parameters +if minetest.settings:get_bool("minertools_flashlight_on") then + light_level = minetest.LIGHT_MAX +else + light_level = 0 +end + -- recognized ores local find_ore_list = { "default:stone_with_coal", "default:stone_with_iron", @@ -841,6 +848,7 @@ minetest.register_tool("minertools:ultimate_mining_gizmo", { wield_image = "minertools_umg_hand.png", wield_scale = { x = 1, y = 1, z = 1 }, inventory_image = "minertools_umg_inv.png", + light_source = light_level, stack_max = 1, range = 12, -- AMA + 2 _init_metadata = multidevice_init_metadata, diff --git a/minertools/settingtypes.txt b/minertools/settingtypes.txt new file mode 100644 index 0000000..697c8e7 --- /dev/null +++ b/minertools/settingtypes.txt @@ -0,0 +1,3 @@ +# Make Ultimate Mining Gizmo a light source, works only if wielded_light +# or similar mod is active, otherwise does nothing (and doesn't hurt either) +minertools_flashlight_on (UMG has flashlight - requires mod like wielded_light) bool false