Fix code formatting issue

This commit is contained in:
Aaron Suen 2022-04-18 23:46:45 -04:00
parent 47f89855ed
commit cf489835cf

View File

@ -27,30 +27,33 @@ local function bump(player)
end
minetest.register_on_joinplayer(function(player) return bump(player) end)
minetest.register_on_placenode(function(_, _, player) --[[do not return]] bump(player) end)
minetest.register_on_dignode(function(_, _, player) return bump(player) end)
minetest.register_on_punchnode(function(_, _, player) return bump(player) end)
minetest.register_on_chat_message(function(pname) bumpn(pname) end)
minetest.register_on_player_receive_fields(function(player) return bump(player) end)
minetest.register_on_craft(function(_, player) return bump(player) end)
minetest.register_on_player_inventory_action(function(player) return bump(player) end)
minetest.register_on_placenode(function(_, _, player)
--do not return
bump(player)
end)
minetest.register_on_dignode(function(_, _, player) return bump(player) end)
minetest.register_on_punchnode(function(_, _, player) return bump(player) end)
minetest.register_on_chat_message(function(pname) bumpn(pname) end)
minetest.register_on_player_receive_fields(function(player) return bump(player) end)
minetest.register_on_craft(function(_, player) return bump(player) end)
minetest.register_on_player_inventory_action(function(player) return bump(player) end)
local looks = {}
local function checkplayer(player)
local pname = player:get_player_name()
local look = player:get_look_dir()
local old = looks[pname]
looks[pname] = look
if player:get_player_control_bits() ~= 0 then return bumpn(pname) end
if not (old and vector.equals(old, look)) then return bumpn(pname) end
return pname
local looks = {}
local function checkplayer(player)
local pname = player:get_player_name()
local look = player:get_look_dir()
local old = looks[pname]
looks[pname] = look
if player:get_player_control_bits() ~= 0 then return bumpn(pname) end
if not (old and vector.equals(old, look)) then return bumpn(pname) end
return pname
end
minetest.register_globalstep(function()
for _, player in pairs(minetest.get_connected_players()) do
if (not minetest.check_player_privs(player, modname)) ~= (not invert) then return end
local pname = checkplayer(player)
if times[pname] < now() - timeout then
minetest.kick_player(pname, reason)
end
end
minetest.register_globalstep(function()
for _, player in pairs(minetest.get_connected_players()) do
if (not minetest.check_player_privs(player, modname)) ~= (not invert) then return end
local pname = checkplayer(player)
if times[pname] < now() - timeout then
minetest.kick_player(pname, reason)
end
end
end)
end)