Replace getpos() with get_pos()
This commit is contained in:
parent
1f1361d179
commit
e789801662
58 changed files with 105 additions and 105 deletions
|
@ -178,7 +178,7 @@ mcl_weather.rain.make_weather = function()
|
|||
end
|
||||
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:getpos())) then
|
||||
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then
|
||||
mcl_weather.rain.remove_sound(player)
|
||||
return false
|
||||
end
|
||||
|
|
|
@ -140,7 +140,7 @@ mcl_weather.skycolor = {
|
|||
|
||||
local players = mcl_weather.skycolor.utils.get_players(nil)
|
||||
for _, player in ipairs(players) do
|
||||
local pos = player:getpos()
|
||||
local pos = player:get_pos()
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
if dim == "overworld" then
|
||||
player:set_sky(color, "plain", nil, true)
|
||||
|
|
|
@ -8,7 +8,7 @@ mcl_weather.snow.add_snow_particles = function(player)
|
|||
mcl_weather.rain.last_rp_count = 0
|
||||
for i=mcl_weather.snow.particles_count, 1,-1 do
|
||||
local random_pos_x, random_pos_y, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||
random_pos_y = math.random() + math.random(player:getpos().y - 1, player:getpos().y + 7)
|
||||
random_pos_y = math.random() + math.random(player:get_pos().y - 1, player:get_pos().y + 7)
|
||||
if minetest.get_node_light({x=random_pos_x, y=random_pos_y, z=random_pos_z}, 0.5) == 15 then
|
||||
mcl_weather.rain.last_rp_count = mcl_weather.rain.last_rp_count + 1
|
||||
minetest.add_particle({
|
||||
|
@ -78,7 +78,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:getpos())) then
|
||||
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then
|
||||
return false
|
||||
end
|
||||
mcl_weather.snow.add_snow_particles(player)
|
||||
|
|
|
@ -75,7 +75,7 @@ end
|
|||
-- checks if player is undewater. This is needed in order to
|
||||
-- turn off weather particles generation.
|
||||
mcl_weather.is_underwater = function(player)
|
||||
local ppos = player:getpos()
|
||||
local ppos = player:get_pos()
|
||||
local offset = player:get_eye_offset()
|
||||
local player_eye_pos = {x = ppos.x + offset.x,
|
||||
y = ppos.y + offset.y + 1.5,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue