Fix some deprecation warnings

This commit is contained in:
HybridDog 2021-12-22 18:24:47 +01:00
parent fb1eca6c11
commit c35d18a519
6 changed files with 19 additions and 18 deletions

View File

@ -197,7 +197,7 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv
if not sound_allowed then -- avoid playing the sound multiple times, e.g. when middle mouse click if not sound_allowed then -- avoid playing the sound multiple times, e.g. when middle mouse click
return return
end end
minetest.sound_play("default_wood_footstep", {pos=player:getpos(), gain=0.25}) minetest.sound_play("default_wood_footstep", {pos=player:get_pos(), gain=0.25})
sound_allowed = false sound_allowed = false
minetest.after(0, function() minetest.after(0, function()
sound_allowed = true sound_allowed = true

View File

@ -398,7 +398,7 @@ minetest.register_chatcommand("nether_help", {
minetest.chat_send_player(name, "Something went wrong.") minetest.chat_send_player(name, "Something went wrong.")
return false return false
end end
if player:getpos().y > nether.start then if player:get_pos().y > nether.start then
minetest.chat_send_player(name, minetest.chat_send_player(name,
"Usually you don't neet this guide here. " .. "Usually you don't neet this guide here. " ..
"You can view it in the nether.") "You can view it in the nether.")

View File

@ -391,18 +391,18 @@ minetest.register_on_generated(function(minp, maxp, seed)
map_lengths_xyz), map_lengths_xyz),
} }
end end
pelin_maps.a:get2dMap_flat({x=minp.x, y=minp.z}, pmap1) pelin_maps.a:get_2d_map_flat({x=minp.x, y=minp.z}, pmap1)
pelin_maps.b:get2dMap_flat({x=minp.x, y=minp.z}, pmap2) pelin_maps.b:get_2d_map_flat({x=minp.x, y=minp.z}, pmap2)
pelin_maps.c:get2dMap_flat({x=minp.x, y=minp.z}, pmap3) pelin_maps.c:get_2d_map_flat({x=minp.x, y=minp.z}, pmap3)
local forest_possible = maxp.y > f_h_min and minp.y < f_h_max local forest_possible = maxp.y > f_h_min and minp.y < f_h_max
--local pmap_f_bottom = minetest.get_perlin_map(perlins.forest_bottom, --local pmap_f_bottom = minetest.get_perlin_map(perlins.forest_bottom,
-- map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z}) -- map_lengths_xyz):get_2d_map_flat({x=minp.x, y=minp.z})
local perlin_f_bottom, strassx, strassz local perlin_f_bottom, strassx, strassz
if forest_possible then if forest_possible then
perlin_f_bottom = minetest.get_perlin(11, 3, 0.8, tmp2) perlin_f_bottom = minetest.get_perlin(11, 3, 0.8, tmp2)
pelin_maps.forest_top:get2dMap_flat({x=minp.x, y=minp.z}, pmap_f_top) pelin_maps.forest_top:get_2d_map_flat({x=minp.x, y=minp.z}, pmap_f_top)
strassx = get_ws_list(2, minp.x) strassx = get_ws_list(2, minp.x)
strassz = get_ws_list(2, minp.z) strassz = get_ws_list(2, minp.z)
end end
@ -485,7 +485,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local pstr = p.x.." "..p.z local pstr = p.x.." "..p.z
if not f_perlins[pstr] then if not f_perlins[pstr] then
f_perlins[pstr] = math.floor(f_h_min + (math.abs( f_perlins[pstr] = math.floor(f_h_min + (math.abs(
perlin_f_bottom:get2d{x=p.x, y=p.z} + 1)) perlin_f_bottom:get_2d{x=p.x, y=p.z} + 1))
* f_yscale_bottom + 0.5) * f_yscale_bottom + 0.5)
end end
local top_noise = pmap_f_top[count]+1 local top_noise = pmap_f_top[count]+1

View File

@ -362,6 +362,7 @@ minetest.register_node("nether:apple", {
tiles = {"nether_fruit_top.png", "nether_fruit_bottom.png", tiles = {"nether_fruit_top.png", "nether_fruit_bottom.png",
"nether_fruit.png", "nether_fruit.png^[transformFX", "nether_fruit.png", "nether_fruit.png^[transformFX",
"nether_fruit.png^[transformFX", "nether_fruit.png"}, "nether_fruit.png^[transformFX", "nether_fruit.png"},
use_texture_alpha = "opaque",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -641,7 +642,7 @@ minetest.register_node("nether:portal", {
light_source = 12, light_source = 12,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
use_texture_alpha = true, use_texture_alpha = "blend",
walkable = false, walkable = false,
pointable = false, pointable = false,
buildable_to = false, buildable_to = false,

View File

@ -1,6 +1,6 @@
local function throw_pearl(item, player) local function throw_pearl(item, player)
local playerpos = player:getpos() local playerpos = player:get_pos()
playerpos.y = playerpos.y+1.625 playerpos.y = playerpos.y+1.625
local obj = minetest.add_entity(playerpos, "nether:pearl_entity") local obj = minetest.add_entity(playerpos, "nether:pearl_entity")
local dir = player:get_look_dir() local dir = player:get_look_dir()
@ -99,7 +99,7 @@ minetest.register_entity("nether:pearl_entity", {
self.player = tmp.player self.player = tmp.player
end, end,
get_staticdata = function(self) get_staticdata = function(self)
--forceload(vector.round(self.object:getpos())) --forceload(vector.round(self.object:get_pos()))
return minetest.serialize({ return minetest.serialize({
player = self.player, player = self.player,
}) })
@ -121,7 +121,7 @@ minetest.register_entity("nether:pearl_entity", {
return return
end end
local pos = self.object:getpos() local pos = self.object:get_pos()
local rpos = vector.round(pos) local rpos = vector.round(pos)
local lastpos = self.lastpos local lastpos = self.lastpos
if not lastpos then if not lastpos then

View File

@ -72,7 +72,7 @@ end
-- where the player appears after dying -- where the player appears after dying
local function get_player_died_target(player) local function get_player_died_target(player)
local target = vector.add(player:getpos(), local target = vector.add(player:get_pos(),
{x=math.random(-100,100), y=0, z=math.random(-100,100)}) {x=math.random(-100,100), y=0, z=math.random(-100,100)})
target.y = portal_target + math.random(4) target.y = portal_target + math.random(4)
return target return target
@ -172,7 +172,7 @@ minetest.register_chatcommand("from_hell", {
return false, "Something went wrong." return false, "Something went wrong."
end end
minetest.chat_send_player(pname, "You are free now") minetest.chat_send_player(pname, "You are free now")
local pos = player:getpos() local pos = player:get_pos()
player_from_nether(player, {x=pos.x, y=100, z=pos.z}) player_from_nether(player, {x=pos.x, y=100, z=pos.z})
return true, pname.." is now out of the nether." return true, pname.." is now out of the nether."
end end
@ -246,7 +246,7 @@ if nether_prisons then
local metatable_overridden local metatable_overridden
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- set the background when the player joins -- set the background when the player joins
if player:getpos().y < nether.start then if player:get_pos().y < nether.start then
update_background(player, true) update_background(player, true)
end end
@ -270,7 +270,7 @@ else
-- test if player is in nether when he/she joins -- test if player is in nether when he/she joins
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
players_in_nether[player:get_player_name()] = players_in_nether[player:get_player_name()] =
player:getpos().y < nether.start or nil player:get_pos().y < nether.start or nil
end) end)
end end
@ -310,7 +310,7 @@ local function obsi_teleport_player(player, pos, target)
return return
end end
local objpos = player:getpos() local objpos = player:get_pos()
objpos.y = objpos.y+0.1 -- Fix some glitches at -8000 objpos.y = objpos.y+0.1 -- Fix some glitches at -8000
if minetest.get_node(vector.round(objpos)).name ~= "nether:portal" then if minetest.get_node(vector.round(objpos)).name ~= "nether:portal" then
return return
@ -655,7 +655,7 @@ function nether.teleport_player(player)
minetest.log("error", "[nether] Missing player.") minetest.log("error", "[nether] Missing player.")
return return
end end
local pos = vector.round(player:getpos()) local pos = vector.round(player:get_pos())
if not is_netherportal(pos) then if not is_netherportal(pos) then
return return
end end