removed dependency from a function in default
This commit is contained in:
parent
833396f6de
commit
860263fa7b
20
init.lua
20
init.lua
@ -11,6 +11,26 @@ if( not( minetest.get_modpath( 'unified_inventory' ))) then
|
||||
end
|
||||
|
||||
|
||||
-- the one from default is not available in MCL2 and not fixed enough yet
|
||||
handle_schematics.can_interact_with_node = function(player, pos)
|
||||
if player then
|
||||
if minetest.check_player_privs(player, "protection_bypass") then
|
||||
return true
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
|
||||
if owner and owner ~= "" and owner == player:get_player_name() then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
handle_schematics.modpath = minetest.get_modpath( "handle_schematics");
|
||||
|
||||
-- realtest handles some things diffrently without beeing easy to identify
|
||||
|
@ -35,7 +35,7 @@ minetest.register_craft({
|
||||
-- mobs who wish to use this function have to provide the required item in itemstack
|
||||
handle_schematics.place_node_using_support_setup = function(pos, clicker, itemstack )
|
||||
-- TODO: does can_interact_with_node work with mobs?
|
||||
if not( default.can_interact_with_node(clicker, pos)) then
|
||||
if not( handle_schematics.can_interact_with_node(clicker, pos)) then
|
||||
return itemstack;
|
||||
end
|
||||
|
||||
@ -137,7 +137,7 @@ end
|
||||
|
||||
-- right-clicking a dig_here-indicator ought to dig the next node below it that needs digging and place appropriate scaffolding
|
||||
handle_schematics.dig_node_using_dig_here_indicator = function(pos, clicker, itemstack )
|
||||
if not( default.can_interact_with_node(clicker, pos)) then
|
||||
if not( handle_schematics.can_interact_with_node(clicker, pos)) then
|
||||
return itemstack;
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user