From 9bffa6d5d084c523ff7739dcb2f81ab70eee34fd Mon Sep 17 00:00:00 2001 From: Carlos Chon Date: Sun, 10 Nov 2024 05:01:28 -0800 Subject: [PATCH] Beacons are now disable by default --- init.lua | 10 +++++++--- settingtypes.txt | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 settingtypes.txt diff --git a/init.lua b/init.lua index e9364a6..cea24a5 100644 --- a/init.lua +++ b/init.lua @@ -126,6 +126,9 @@ end --------------- CHAT COMMANDS ------------------- +-- Load beacon setting from settings.conf +local beacons_enabled = minetest.settings:get_bool("beacons.enable", false) + -- CREATE WAYPOINT minetest.register_chatcommand("wc", { params = "", @@ -150,8 +153,10 @@ minetest.register_chatcommand("wc", { -- Add the waypoint to the player's HUD addWaypointHud(waypoints, player) - -- Place a beacon at the waypoint location - placeBeacon(round_pos) + -- Check if beacons are enabled before placing a beacon + if beacons_enabled then + placeBeacon(round_pos) + end -- Save the waypoints to modstorage save() @@ -165,7 +170,6 @@ minetest.register_chatcommand("wc", { }) - -- DELETE WAYPOINT minetest.register_chatcommand("wd", { params = "", diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..02dc39f --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,2 @@ +# Enable or disable beacons in the mod +beacons.enable (Enable Beacons) bool false