Merge remote-tracking branch 'origin/master' into testing

This commit is contained in:
kay27 2022-02-01 01:28:41 +04:00
commit 5b258f5344
3 changed files with 26 additions and 23 deletions

View File

@ -29,7 +29,7 @@ local psdef= {
minpos = vector.new(-6,3,-6), minpos = vector.new(-6,3,-6),
maxpos = vector.new(6,15,6), maxpos = vector.new(6,15,6),
minvel = vector.new(-vel,-falling_speed,-vel), minvel = vector.new(-vel,-falling_speed,-vel),
maxvel = math.random(vel,-falling_speed+vel,vel), maxvel = vector.new(vel,-falling_speed+vel,vel),
minacc = vector.new(0,0,0), minacc = vector.new(0,0,0),
maxacc = vector.new(0,-0.4,0), maxacc = vector.new(0,-0.4,0),
minexptime = 0.5, minexptime = 0.5,
@ -46,7 +46,7 @@ local psdef_backsplash= {
minpos = vector.new(-3,-1,-3), minpos = vector.new(-3,-1,-3),
maxpos = vector.new(3,0,3), maxpos = vector.new(3,0,3),
minvel = vector.new(-vel,falling_speed*2,-vel), minvel = vector.new(-vel,falling_speed*2,-vel),
maxvel = math.random(vel,falling_speed*2+vel,vel), maxvel = vector.new(vel,falling_speed*2+vel,vel),
minacc = vector.new(0,0,0), minacc = vector.new(0,0,0),
maxacc = vector.new(0,0,0), maxacc = vector.new(0,0,0),
minexptime = 0.1, minexptime = 0.1,
@ -119,19 +119,6 @@ function mcl_weather.rain.remove_player(player)
end end
end end
mcl_worlds.register_on_dimension_change(function(player, dimension)
if dimension ~= "overworld" and dimension ~= "void" then
mcl_weather.rain.remove_sound(player)
mcl_weather.rain.remove_player(player)
elseif dimension == "overworld" then
mcl_weather.rain.update_sound(player)
if mcl_weather.rain.raining then
mcl_weather.rain.add_rain_particles(player)
mcl_weather.rain.add_player(player)
end
end
end)
-- adds and removes rain sound depending how much rain particles around player currently exist. -- adds and removes rain sound depending how much rain particles around player currently exist.
-- have few seconds delay before each check to avoid on/off sound too often -- have few seconds delay before each check to avoid on/off sound too often
-- when player stay on 'edge' where sound should play and stop depending from random raindrop appearance. -- when player stay on 'edge' where sound should play and stop depending from random raindrop appearance.

View File

@ -183,10 +183,13 @@ local function set_interact(player, interact)
local player_name = player:get_player_name() local player_name = player:get_player_name()
local privs = minetest.get_player_privs(player_name) local privs = minetest.get_player_privs(player_name)
if privs.interact ~= interact then if privs.interact ~= interact then
local meta = player:get_meta()
if meta:get_int("ineract_revoked") ~= 1 then
privs.interact = interact privs.interact = interact
minetest.set_player_privs(player_name, privs) minetest.set_player_privs(player_name, privs)
end end
end end
end
local shield_hud = {} local shield_hud = {}
@ -464,6 +467,5 @@ minetest.register_on_joinplayer(function(player)
shields = {}, shields = {},
blocking = 0, blocking = 0,
} }
mcl_shields.players[player].blocking = 0
remove_shield_hud(player) remove_shield_hud(player)
end) end)

View File

@ -20,12 +20,26 @@ end)
for _, action in pairs({"grant", "revoke"}) do for _, action in pairs({"grant", "revoke"}) do
minetest["register_on_priv_" .. action](function(name, _, priv) minetest["register_on_priv_" .. action](function(name, _, priv)
if priv == "fly" then
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
if player then if player then
local meta = player:get_meta() local meta = player:get_meta()
if priv == "fly" then
meta:set_int("fly_changed", 1) meta:set_int("fly_changed", 1)
end end
--[[
so e.g. hackers who have been revoked of the interact privilege
will not automatically get the interact privilege through the mcl shields code back
]]
if priv == "interact" then
if action == "revoke" then
meta:set_int("ineract_revoked", 1)
else
meta:set_int("ineract_revoked", 0)
end
end
end end
end) end)
end end