Skip to content

Commit

Permalink
Turn off the placement limit
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Aug 15, 2023
1 parent 641324c commit 6a08e2f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions anti_blockspam/init.lua
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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},
})
Expand All @@ -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)

0 comments on commit 6a08e2f

Please sign in to comment.