summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2020-04-15 15:11:59 -0500
committercheapie <no-email-for-you@example.com>2020-04-15 15:11:59 -0500
commitc5c37344c7e466add62a40993ea1c25372af5f7c (patch)
treed6f648299a7a20f616a2e4724a7720ac4aa3dbd9
parentc4027b8be0db78a533d87348d5dca782a45041d7 (diff)
downloadareasprotector-c5c37344c7e466add62a40993ea1c25372af5f7c.tar
areasprotector-c5c37344c7e466add62a40993ea1c25372af5f7c.tar.gz
areasprotector-c5c37344c7e466add62a40993ea1c25372af5f7c.tar.bz2
areasprotector-c5c37344c7e466add62a40993ea1c25372af5f7c.tar.xz
areasprotector-c5c37344c7e466add62a40993ea1c25372af5f7c.zip
Fix deprecated API calls
-rw-r--r--init.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/init.lua b/init.lua
index 5fc2692..041c5e1 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,4 @@
-
-local creative_mode = minetest.setting_getbool("creative_mode")
+local creative_mode = minetest.settings:get_bool("creative_mode")
local function cyan(str)
return minetest.colorize("#00FFFF",str)
@@ -9,20 +8,20 @@ local function red(str)
return minetest.colorize("#FF5555",str)
end
-local radius_large = minetest.setting_get("areasprotector_radius_large")
- or minetest.setting_get("areasprotector_radius")
+local radius_large = minetest.settings:get("areasprotector_radius_large")
+ or minetest.settings:get("areasprotector_radius")
or 16
-local height_large = minetest.setting_get("areasprotector_height_large")
- or minetest.setting_get("areasprotector_radius_large")
- or minetest.setting_get("areasprotector_radius")
+local height_large = minetest.settings:get("areasprotector_height_large")
+ or minetest.settings:get("areasprotector_radius_large")
+ or minetest.settings:get("areasprotector_radius")
or 16
-local radius_small = minetest.setting_get("areasprotector_radius_small")
+local radius_small = minetest.settings:get("areasprotector_radius_small")
or 7
-local height_small = minetest.setting_get("areasprotector_height_small")
- or minetest.setting_get("areasprotector_radius_small")
+local height_small = minetest.settings:get("areasprotector_height_small")
+ or minetest.settings:get("areasprotector_radius_small")
or 7
local function remove_display(pos)
@@ -52,7 +51,7 @@ local function on_place(itemstack, player, pointed, radius, height, sizeword)
meta:set_string("infotext",infotext)
meta:set_int("area_id",id)
meta:set_string("owner",name)
- if not minetest.setting_getbool("creative_mode") then
+ if not creative_mode then
itemstack:take_item()
end
return itemstack
@@ -100,7 +99,7 @@ local function on_punch(pos, node, puncher, sizeword)
end
local function on_step(self, dtime, sizeword)
- if minetest.get_node(self.object:getpos()).name ~= "areasprotector:protector_"..sizeword then
+ if minetest.get_node(self.object:get_pos()).name ~= "areasprotector:protector_"..sizeword then
self.object:remove()
return
end