1
0
Fork 0

Remove mcl_experience setting

objects
Wuzzy 2020-12-14 14:16:09 +01:00
parent 70b078cdaf
commit 9028902a87
3 changed files with 3 additions and 24 deletions

View File

@ -46,7 +46,7 @@ end
-- Load default settings -- Load default settings
dofile(minetest.get_modpath("hudbars").."/default_settings.lua") 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: -- reserve some space for experience bar:
hb.settings.start_offset_left.y = hb.settings.start_offset_left.y - 20 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 hb.settings.start_offset_right.y = hb.settings.start_offset_right.y - 20

View File

@ -1,5 +1,4 @@
local S = minetest.get_translator("mcl_experience") local S = minetest.get_translator("mcl_experience")
local USE_XP = minetest.settings:get_bool("mcl_experience", false)
mcl_experience = {} mcl_experience = {}
local pool = {} local pool = {}
local registered_nodes local registered_nodes
@ -100,9 +99,6 @@ end
-- change element of hud -- change element of hud
hud_manager.change_hud = function(data) hud_manager.change_hud = function(data)
if not USE_XP then
return
end
local name = data.player:get_player_name() local name = data.player:get_player_name()
if player_huds[name] and player_huds[name][data.hud_name] then 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) 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 end
pool[name].level = level pool[name].level = level
pool[name].xp, pool[name].bar_step, pool[name].next_level = mcl_experience.bar_to_xp(pool[name].bar, 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)}) hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(level)})
end
-- we may don't update the bar -- we may don't update the bar
end end
@ -168,10 +162,6 @@ minetest.register_on_joinplayer(function(player)
name = player:get_player_name() name = player:get_player_name()
temp_pool = pool[name] temp_pool = pool[name]
if not USE_XP then
return
end
hud_manager.add_hud(player,"experience_bar", hud_manager.add_hud(player,"experience_bar",
{ {
hud_elem_type = "statbar", position = {x=0.5, y=1}, hud_elem_type = "statbar", position = {x=0.5, y=1},
@ -280,7 +270,7 @@ local name
local temp_pool local temp_pool
local xp_amount local xp_amount
minetest.register_on_dieplayer(function(player) 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 return
end end
@ -496,9 +486,6 @@ minetest.register_chatcommand("xp", {
description = S("Gives a player some XP"), description = S("Gives a player some XP"),
privs = {server=true}, privs = {server=true},
func = function(name, params) func = function(name, params)
if not USE_XP then
return false, S("XP are disabled!")
end
local player, xp = nil, 1000 local player, xp = nil, 1000
local P, i = {}, 0 local P, i = {}, 0
for str in string.gmatch(params, "([^ ]+)") do for str in string.gmatch(params, "([^ ]+)") do
@ -530,9 +517,6 @@ minetest.register_chatcommand("xp", {
}) })
function mcl_experience.throw_experience(pos, amount) function mcl_experience.throw_experience(pos, amount)
if not USE_XP then
return false
end
local i, j = 0, 0 local i, j = 0, 0
local obj, xp local obj, xp
while i < amount and j < 100 do while i < amount and j < 100 do

View File

@ -86,11 +86,6 @@ mobs_disable_blood (Disable mob damage particles) bool false
flame_sound (Flame sound) bool true flame_sound (Flame sound) bool true
[Experimental] [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. # Whether ice is translucent. If disabled, ice is fully opaque.
# #
# Note: As of Minetest version 5.1.0, translucent ice above oceans # Note: As of Minetest version 5.1.0, translucent ice above oceans