summaryrefslogtreecommitdiff
path: root/replacer/check_owner.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2018-02-13 14:05:34 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2018-02-13 14:05:34 -0500
commit335d9a3eddcb590c3ca5de9cba9b152e5e560af1 (patch)
tree1b95d73b945fbc9924438c28a35d7f1019fa255f /replacer/check_owner.lua
parent1d0f113f4c5afcf8479973f2e01786fb9a1fbbb7 (diff)
downloaddreambuilder_modpack-335d9a3eddcb590c3ca5de9cba9b152e5e560af1.tar
dreambuilder_modpack-335d9a3eddcb590c3ca5de9cba9b152e5e560af1.tar.gz
dreambuilder_modpack-335d9a3eddcb590c3ca5de9cba9b152e5e560af1.tar.bz2
dreambuilder_modpack-335d9a3eddcb590c3ca5de9cba9b152e5e560af1.tar.xz
dreambuilder_modpack-335d9a3eddcb590c3ca5de9cba9b152e5e560af1.zip
removed boost_cart and carbone_mobs -- too many crashes
updated blox, homedecor, plantlifed, cottages, farming_redo, framedglass, gloopblocks, mesecons, moreblocks, moretrees, pipeworks, player_textures, replacer, signs_lib, stained_glass, technic, travelnet, unified_inventory, unifieddyes, and worldedit.
Diffstat (limited to 'replacer/check_owner.lua')
-rw-r--r--replacer/check_owner.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/replacer/check_owner.lua b/replacer/check_owner.lua
index f8e843f..6a63f69 100644
--- a/replacer/check_owner.lua
+++ b/replacer/check_owner.lua
@@ -2,15 +2,22 @@
-- see http://forum.minetest.net/viewtopic.php?pid=26061 or https://github.com/VanessaE/homedecor for details!
function replacer_homedecor_node_is_owned(pos, placer)
- if type( minetest.is_protected == "function") then
- return minetest.is_protected( pos, placer:get_player_name() );
+ if( not( placer ) or not(pos )) then
+ return true;
+ end
+ local pname = placer:get_player_name();
+ if (type( minetest.is_protected ) == "function") then
+ local res = minetest.is_protected( pos, pname );
+ if( res ) then
+ minetest.chat_send_player( pname, "Cannot replace node. It is protected." );
+ end
+ return res;
end
-
local ownername = false
if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod
if HasOwner(pos, placer) then -- returns true if the node is owned
- if not IsPlayerNodeOwner(pos, placer:get_player_name()) then
+ if not IsPlayerNodeOwner(pos, pname) then
if type(getLastOwner) == "function" then -- ...is an old version
ownername = getLastOwner(pos)
elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version
@@ -28,7 +35,7 @@ function replacer_homedecor_node_is_owned(pos, placer)
end
if ownername ~= false then
- minetest.chat_send_player( placer:get_player_name(), "Sorry, "..ownername.." owns that spot." )
+ minetest.chat_send_player( pname, "Sorry, "..ownername.." owns that spot." )
return true
else
return false