diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-18 14:38:13 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-18 14:38:13 -0400 |
commit | 892df477a4c724b8a46fe002a8a83ad64c27888c (patch) | |
tree | 9391dffcfb4f531fc9263584987d19cb38f09f8c | |
parent | b9d06746405f8d0b7f82101da689b33cde8429e8 (diff) | |
download | dreambuilder_modpack-892df477a4c724b8a46fe002a8a83ad64c27888c.tar dreambuilder_modpack-892df477a4c724b8a46fe002a8a83ad64c27888c.tar.gz dreambuilder_modpack-892df477a4c724b8a46fe002a8a83ad64c27888c.tar.bz2 dreambuilder_modpack-892df477a4c724b8a46fe002a8a83ad64c27888c.tar.xz dreambuilder_modpack-892df477a4c724b8a46fe002a8a83ad64c27888c.zip |
update unified dyes
-rw-r--r-- | unifieddyes/init.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua index 379f641..47faf46 100644 --- a/unifieddyes/init.lua +++ b/unifieddyes/init.lua @@ -561,13 +561,14 @@ function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger) end function unifieddyes.on_use(itemstack, player, pointed_thing) - local playername = player:get_player_name() - if minetest.is_protected(unifieddyes.select_node(pointed_thing), playername) - and not minetest.check_player_privs(playername, "protection_bypass") then - minetest.chat_send_player(playername, "Sorry, someone else owns that spot.") - return + if pointed_thing and pointed_thing.type == "node" then + if minetest.is_protected(unifieddyes.select_node(pointed_thing), playername) + and not minetest.check_player_privs(playername, "protection_bypass") then + minetest.chat_send_player(playername, "Sorry, someone else owns that spot.") + return + end end if pointed_thing and pointed_thing.type == "object" then @@ -575,7 +576,7 @@ function unifieddyes.on_use(itemstack, player, pointed_thing) return player:get_wielded_item() -- punch may modified the wielded item, load the new and return it end - if not (pointed_thing and pointed_thing.type == "node") then return end -- if "using" the dye not on a node + if not (pointed_thing and pointed_thing.type == "node") then return end -- if "using" the dye on nothing at all (e.g. air) local pos = minetest.get_pointed_thing_position(pointed_thing) local node = minetest.get_node(pos) |