mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 20:43:43 +01:00
Replace deprecated getpos call
This commit is contained in:
parent
be9579a365
commit
3fe7dd2249
@ -111,7 +111,7 @@ armor:register_armor("mod_name:speed_boots", {
|
|||||||
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
|
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
|
||||||
reciprocate_damage = true,
|
reciprocate_damage = true,
|
||||||
on_destroy = function(player, index, stack)
|
on_destroy = function(player, index, stack)
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
if pos then
|
if pos then
|
||||||
minetest.sound_play({
|
minetest.sound_play({
|
||||||
name = "mod_name_break_sound",
|
name = "mod_name_break_sound",
|
||||||
|
@ -160,7 +160,7 @@ end
|
|||||||
|
|
||||||
local function init_player_armor(player)
|
local function init_player_armor(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
if not name or not pos then
|
if not name or not pos then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -326,7 +326,7 @@ if armor.config.drop == true or armor.config.destroy == true then
|
|||||||
end
|
end
|
||||||
armor:save_armor_inventory(player)
|
armor:save_armor_inventory(player)
|
||||||
armor:set_player_armor(player)
|
armor:set_player_armor(player)
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
if pos and armor.config.destroy == false then
|
if pos and armor.config.destroy == false then
|
||||||
minetest.after(armor.config.bones_delay, function()
|
minetest.after(armor.config.bones_delay, function()
|
||||||
local meta = nil
|
local meta = nil
|
||||||
@ -427,7 +427,7 @@ if armor.config.water_protect == true or armor.config.fire_protect == true then
|
|||||||
end
|
end
|
||||||
for _,player in pairs(minetest.get_connected_players()) do
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
local hp = player:get_hp()
|
local hp = player:get_hp()
|
||||||
if not name or not pos or not hp then
|
if not name or not pos or not hp then
|
||||||
return
|
return
|
||||||
|
@ -307,7 +307,7 @@ minetest.register_entity("3d_armor_stand:armor_entity", {
|
|||||||
pos = nil,
|
pos = nil,
|
||||||
timer = 0,
|
timer = 0,
|
||||||
on_activate = function(self)
|
on_activate = function(self)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:get_pos()
|
||||||
if pos then
|
if pos then
|
||||||
self.pos = vector.round(pos)
|
self.pos = vector.round(pos)
|
||||||
update_entity(pos)
|
update_entity(pos)
|
||||||
|
@ -5,7 +5,7 @@ local disable_sounds = minetest.settings:get_bool("shields_disable_sounds")
|
|||||||
local use_moreores = minetest.get_modpath("moreores")
|
local use_moreores = minetest.get_modpath("moreores")
|
||||||
local function play_sound_effect(player, name)
|
local function play_sound_effect(player, name)
|
||||||
if not disable_sounds and player then
|
if not disable_sounds and player then
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
if pos then
|
if pos then
|
||||||
minetest.sound_play(name, {
|
minetest.sound_play(name, {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
|
Loading…
Reference in New Issue
Block a user