diff --git a/anti_blockspam/init.lua b/anti_blockspam/init.lua index 91611ed..882dec1 100644 --- a/anti_blockspam/init.lua +++ b/anti_blockspam/init.lua @@ -1,7 +1,7 @@ -local gettime = minetest.get_us_time +-- local gettime = minetest.get_us_time -local queue = {} -local slows = {} +-- local queue = {} +-- local slows = {} minetest.register_node("anti_blockspam:loading", { description = "Visual-only node", @@ -18,7 +18,7 @@ minetest.register_node("anti_blockspam:loading", { use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, - pointable = false, + pointable = true, diggable = false, groups = {not_in_creative_inventory = 1}, }) @@ -30,26 +30,26 @@ minetest.register_on_mods_loaded(function() node_placement_prediction = "anti_blockspam:loading" }) - slows[name] = true + -- slows[name] = true end end - local old_is_protected = minetest.is_protected + -- local old_is_protected = minetest.is_protected - minetest.is_protected = function(pos, name, ...) - local time = gettime() + -- minetest.is_protected = function(pos, name, ...) + -- local time = gettime() - if queue[name] and time - queue[name] < 160000 then - return true - else - return old_is_protected(pos, name, ...) - end - end + -- if queue[name] and time - queue[name] < 160000 then + -- return true + -- else + -- return old_is_protected(pos, name, ...) + -- end + -- end end) -local in_combat = ctf_combat_mode.in_combat -minetest.register_on_placenode(function(pos, newnode, placer) - if placer and placer:is_player() and slows[newnode.name] and in_combat(placer) and pos.y > placer:get_pos().y then - queue[placer:get_player_name()] = gettime() - end -end) +-- local in_combat = ctf_combat_mode.in_combat +-- minetest.register_on_placenode(function(pos, newnode, placer) +-- if placer and placer:is_player() and slows[newnode.name] and in_combat(placer) and pos.y > placer:get_pos().y then +-- queue[placer:get_player_name()] = gettime() +-- end +-- end)