Fix deprecated functions, update to 5.x (#59)

This commit is contained in:
David Leal 2019-10-05 02:25:05 -05:00 committed by SmallJoker
parent 05ab5e9fbd
commit ac0387786c
5 changed files with 7 additions and 16 deletions

View File

@ -139,7 +139,7 @@ irc.register_bot_command("whereis", {
return false, "There is no player named '"..args.."'"
end
local fmt = "Player %s is at (%.2f,%.2f,%.2f)"
local pos = player:getpos()
local pos = player:get_pos()
return true, fmt:format(args, pos.x, pos.y, pos.z)
end
})

View File

@ -7,7 +7,6 @@ irc.config = {}
local function setting(stype, name, default, required)
local value
if minetest.settings and minetest.settings.get and minetest.settings.get_bool then
-- The current methods for getting settings
if stype == "bool" then
value = minetest.settings:get_bool("irc."..name)
elseif stype == "string" then
@ -15,15 +14,6 @@ local function setting(stype, name, default, required)
elseif stype == "number" then
value = tonumber(minetest.settings:get("irc."..name))
end
else
-- The old methods for getting settings for backward compatibility. Deprecated on 0.4.16+
if stype == "bool" then
value = minetest.setting_getbool("irc."..name)
elseif stype == "string" then
value = minetest.setting_get("irc."..name)
elseif stype == "number" then
value = tonumber(minetest.setting_get("irc."..name))
end
end
if value == nil then
if required then

View File

@ -1,4 +0,0 @@
This mod is just a glue between IRC and Minetest.
It provides two-way communication between the
in-game chat, and an arbitrary IRC channel.

View File

@ -110,7 +110,8 @@ end
minetest.register_privilege("irc_admin", {
description = "Allow IRC administrative tasks to be performed.",
give_to_singleplayer = true
give_to_singleplayer = true,
give_to_admin = true,
})
local stepnum = 0

View File

@ -1 +1,5 @@
name = irc
description = """
This mod is just a glue between IRC and Minetest.
It provides two-way communication between the in-game chat, and an arbitrary IRC channel.
"""