summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 8da41fa..156cbe7 100644
--- a/init.lua
+++ b/init.lua
@@ -252,6 +252,32 @@ function minetest.item_place(itemstack, placer, pointed_thing)
owner = landrush.get_owner(pointed_thing.above)
player = placer:get_player_name()
if landrush.can_interact(player, pointed_thing.above) or itemstack:get_name() == "" then
+ -- add a workaround for TNT, since overwriting the registered node seems not to work
+ if itemstack:get_name() == "tnt:tnt" or itemstack:get_name() == "tnt:tnt_burning" then
+ local pos = pointed_thing.above
+ local temp_pos = pos
+ temp_pos.x = pos.x + 2
+ if player ~= landrush.get_owner( temp_pos ) then
+ minetest.chat_send_player( player, "Do not place TNT near claimed areas..." )
+ return itemstack
+ end
+ temp_pos.x = pos.x - 2
+ if player ~= landrush.get_owner( temp_pos ) then
+ minetest.chat_send_player( player, "Do not place TNT near claimed areas..." )
+ return itemstack
+ end
+ temp_pos.z = pos.z + 2
+ if player ~= landrush.get_owner( temp_pos ) then
+ minetest.chat_send_player( player, "Do not place TNT near claimed areas..." )
+ return itemstack
+ end
+ temp_pos.z = pos.z - 2
+ if player ~= landrush.get_owner( temp_pos ) then
+ minetest.chat_send_player( player, "Do not place TNT near claimed areas..." )
+ return itemstack
+ end
+ end
+ -- end of the workaround
return landrush.default_place(itemstack, placer, pointed_thing)
else
if ( owner ~= nil ) then
@@ -493,5 +519,6 @@ dofile(path.."/bucket.lua")
dofile(path.."/doors.lua")
dofile(path.."/fire.lua")
dofile(path.."/chatcommands.lua")
+dofile(path.."/screwdriver.lua")
end )