mirror of
https://github.com/minetest-mods/irc.git
synced 2024-11-05 09:40:20 +01:00
Fix deprecated functions, update to 5.x (#59)
This commit is contained in:
parent
05ab5e9fbd
commit
ac0387786c
|
@ -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
|
||||
})
|
||||
|
|
10
config.lua
10
config.lua
|
@ -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
|
||||
|
|
|
@ -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.
|
3
init.lua
3
init.lua
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user