mirror of
https://github.com/cultom/hammermod.git
synced 2024-08-19 20:44:09 +02:00
enable multiplayer
This commit is contained in:
parent
7d33e26a63
commit
2f8350846b
12
init.lua
12
init.lua
@ -26,21 +26,19 @@ minetest.register_tool("hammermod:steel_hammer", {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local thomas_dig_none = "tupeuxyaller"
|
local steelHammerDigs = {}
|
||||||
|
|
||||||
minetest.register_on_dignode(
|
minetest.register_on_dignode(
|
||||||
function(pos, oldnode, digger)
|
function(pos, oldnode, digger)
|
||||||
|
|
||||||
--TODO thomas_dig_none per player
|
|
||||||
if digger == nil or digger:get_wielded_item():get_name() ~= "hammermod:steel_hammer" then
|
if digger == nil or digger:get_wielded_item():get_name() ~= "hammermod:steel_hammer" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if thomas_dig_none ~= "tupeuxyaller" then
|
local playerName = digger:get_player_name()
|
||||||
|
if(playerName == "" or steelHammerDigs[playerName]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
steelHammerDigs[playerName] = true
|
||||||
thomas_dig_none = "kesketufousla"
|
|
||||||
|
|
||||||
local posDiff = pos.y - digger:get_pos().y
|
local posDiff = pos.y - digger:get_pos().y
|
||||||
if(posDiff < 2 and posDiff > 1) then
|
if(posDiff < 2 and posDiff > 1) then
|
||||||
@ -125,6 +123,6 @@ minetest.register_on_dignode(
|
|||||||
minetest.node_dig(pos, minetest.get_node(pos), digger)
|
minetest.node_dig(pos, minetest.get_node(pos), digger)
|
||||||
|
|
||||||
end
|
end
|
||||||
thomas_dig_none = "tupeuxyaller"
|
steelHammerDigs[playerName] = nil
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user