forked from mtcontrib/mod-kpgmobs
Replace deprecated methods:
- 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool'
This commit is contained in:
parent
735ba1458f
commit
83eb0247bc
8
api.lua
8
api.lua
@ -130,7 +130,7 @@ function kpgmobs:register_mob(name, def)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
|
if self.type == "monster" and minetest.settings:get_bool("only_peaceful_mobs") then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ function kpgmobs:register_mob(name, def)
|
|||||||
do_env_damage(self)
|
do_env_damage(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.type == "monster" and minetest.setting_getbool("enable_damage") then
|
if self.type == "monster" and minetest.settings:get_bool("enable_damage") then
|
||||||
for _,player in pairs(minetest.get_connected_players()) do
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
local s = self.object:getpos()
|
local s = self.object:getpos()
|
||||||
local p = player:getpos()
|
local p = player:getpos()
|
||||||
@ -459,7 +459,7 @@ function kpgmobs:register_mob(name, def)
|
|||||||
self.state = "stand"
|
self.state = "stand"
|
||||||
self.object:setvelocity({x=0, y=self.object:getvelocity().y, z=0})
|
self.object:setvelocity({x=0, y=self.object:getvelocity().y, z=0})
|
||||||
self.object:setyaw(math.random(1, 360)/180*math.pi)
|
self.object:setyaw(math.random(1, 360)/180*math.pi)
|
||||||
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
|
if self.type == "monster" and minetest.settings:get_bool("only_peaceful_mobs") then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
self.lifetimer = 600 - dtime_s
|
self.lifetimer = 600 - dtime_s
|
||||||
@ -539,7 +539,7 @@ function kpgmobs:register_spawn(name, nodes, max_light, min_light, chance, activ
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.setting_getbool("display_mob_spawn") then
|
if minetest.settings:get_bool("display_mob_spawn") then
|
||||||
minetest.chat_send_all("[kpgmobs] Add "..name.." at "..minetest.pos_to_string(pos))
|
minetest.chat_send_all("[kpgmobs] Add "..name.." at "..minetest.pos_to_string(pos))
|
||||||
end
|
end
|
||||||
minetest.env:add_entity(pos, name)
|
minetest.env:add_entity(pos, name)
|
||||||
|
6
init.lua
6
init.lua
@ -511,13 +511,13 @@ kpgmobs:register_mob("kpgmobs:sheep", {
|
|||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
if item:get_name() == "farming:wheat" then
|
if item:get_name() == "farming:wheat" then
|
||||||
if not self.tamed then
|
if not self.tamed then
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
item:take_item()
|
item:take_item()
|
||||||
clicker:set_wielded_item(item)
|
clicker:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
self.tamed = true
|
self.tamed = true
|
||||||
elseif self.naked then
|
elseif self.naked then
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
item:take_item()
|
item:take_item()
|
||||||
clicker:set_wielded_item(item)
|
clicker:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
@ -1088,6 +1088,6 @@ minetest.register_craftitem("kpgmobs:bucket_milk", {
|
|||||||
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
||||||
})
|
})
|
||||||
|
|
||||||
if minetest.setting_get("log_mods") then
|
if minetest.settings:get("log_mods") then
|
||||||
minetest.log("action", "kpgmobs loaded")
|
minetest.log("action", "kpgmobs loaded")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user