diff --git a/machine.lua b/machine.lua index b40813c..a479b00 100644 --- a/machine.lua +++ b/machine.lua @@ -34,12 +34,17 @@ minetest.register_node('mylandscaping:machine', { can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); local inv = meta:get_inventory() - if not inv:is_empty("input") then + + if player:get_player_name() ~= meta:get_string("owner") then + return false + elseif not inv:is_empty("input") then return false elseif not inv:is_empty("output") then return false end return true + + end, after_place_node = function(pos, placer, itemstack) diff --git a/mixer.lua b/mixer.lua index a79f078..89426e6 100644 --- a/mixer.lua +++ b/mixer.lua @@ -35,9 +35,15 @@ minetest.register_node('mylandscaping:mixer', { can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); local inv = meta:get_inventory() - if not inv:is_empty("input") then + if player:get_player_name() ~= meta:get_string("owner") then return false - elseif not inv:is_empty("output") then + elseif not inv:is_empty("cobble") then + return false + elseif not inv:is_empty("gravel") then + return false + elseif not inv:is_empty("concrete") then + return false + elseif not inv:is_empty("sand") then return false end return true diff --git a/myconcrete_machine.lua b/myconcrete_machine.lua index c54c3a3..cee7fcc 100644 --- a/myconcrete_machine.lua +++ b/myconcrete_machine.lua @@ -37,7 +37,10 @@ minetest.register_node('mylandscaping:machine', { can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); local inv = meta:get_inventory() - if not inv:is_empty("input") then + + if player:get_player_name() ~= meta:get_string("owner") then + return false + elseif not inv:is_empty("input") then return false elseif not inv:is_empty("output") then return false diff --git a/myconcrete_mixer.lua b/myconcrete_mixer.lua index 4527acc..a4362f5 100644 --- a/myconcrete_mixer.lua +++ b/myconcrete_mixer.lua @@ -34,9 +34,15 @@ minetest.register_node('mylandscaping:mixer', { can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); local inv = meta:get_inventory() - if not inv:is_empty("input") then + if player:get_player_name() ~= meta:get_string("owner") then return false - elseif not inv:is_empty("output") then + elseif not inv:is_empty("cobble") then + return false + elseif not inv:is_empty("gravel") then + return false + elseif not inv:is_empty("concrete") then + return false + elseif not inv:is_empty("sand") then return false end return true