From 9028902a87f4ed83ecde5923f2b476b81aeacc31 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 14 Dec 2020 14:16:09 +0100 Subject: [PATCH] Remove mcl_experience setting --- mods/HUD/hudbars/init.lua | 2 +- mods/HUD/mcl_experience/init.lua | 20 ++------------------ settingtypes.txt | 5 ----- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/mods/HUD/hudbars/init.lua b/mods/HUD/hudbars/init.lua index 59d8fc238..44c826656 100644 --- a/mods/HUD/hudbars/init.lua +++ b/mods/HUD/hudbars/init.lua @@ -46,7 +46,7 @@ end -- Load default settings dofile(minetest.get_modpath("hudbars").."/default_settings.lua") -if minetest.get_modpath("mcl_experience") and minetest.settings:get_bool("mcl_experience", false) then +if minetest.get_modpath("mcl_experience") then -- reserve some space for experience bar: hb.settings.start_offset_left.y = hb.settings.start_offset_left.y - 20 hb.settings.start_offset_right.y = hb.settings.start_offset_right.y - 20 diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index 68e8e6dcb..0215e6d90 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -1,5 +1,4 @@ local S = minetest.get_translator("mcl_experience") -local USE_XP = minetest.settings:get_bool("mcl_experience", false) mcl_experience = {} local pool = {} local registered_nodes @@ -100,9 +99,6 @@ end -- change element of hud hud_manager.change_hud = function(data) - if not USE_XP then - return - end local name = data.player:get_player_name() if player_huds[name] and player_huds[name][data.hud_name] then data.player:hud_change(player_huds[name][data.hud_name], data.element, data.data) @@ -153,9 +149,7 @@ function mcl_experience.set_player_xp_level(player,level) end pool[name].level = level pool[name].xp, pool[name].bar_step, pool[name].next_level = mcl_experience.bar_to_xp(pool[name].bar, level) - if USE_XP then - hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(level)}) - end + hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(level)}) -- we may don't update the bar end @@ -168,10 +162,6 @@ minetest.register_on_joinplayer(function(player) name = player:get_player_name() temp_pool = pool[name] - if not USE_XP then - return - end - hud_manager.add_hud(player,"experience_bar", { hud_elem_type = "statbar", position = {x=0.5, y=1}, @@ -280,7 +270,7 @@ local name local temp_pool local xp_amount minetest.register_on_dieplayer(function(player) - if minetest.settings:get_bool("mcl_keepInventory", false) or not USE_XP then + if minetest.settings:get_bool("mcl_keepInventory", false) then return end @@ -496,9 +486,6 @@ minetest.register_chatcommand("xp", { description = S("Gives a player some XP"), privs = {server=true}, func = function(name, params) - if not USE_XP then - return false, S("XP are disabled!") - end local player, xp = nil, 1000 local P, i = {}, 0 for str in string.gmatch(params, "([^ ]+)") do @@ -530,9 +517,6 @@ minetest.register_chatcommand("xp", { }) function mcl_experience.throw_experience(pos, amount) - if not USE_XP then - return false - end local i, j = 0, 0 local obj, xp while i < amount and j < 100 do diff --git a/settingtypes.txt b/settingtypes.txt index 8d67e5f91..18471d7bf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -86,11 +86,6 @@ mobs_disable_blood (Disable mob damage particles) bool false flame_sound (Flame sound) bool true [Experimental] -# Whether to use experience. -# Note that experience points are currently useless. - -mcl_experience (Experience) bool false - # Whether ice is translucent. If disabled, ice is fully opaque. # # Note: As of Minetest version 5.1.0, translucent ice above oceans