summaryrefslogtreecommitdiff
path: root/unifieddyes
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 03:31:02 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 03:31:02 -0400
commit6bd13c15ff9d18ab41f57a58683525e2b65f35c2 (patch)
treeb5eb12215a25c1438615722ad6ef24b26fea8d37 /unifieddyes
parentf97625c9789721c93ec0f142c8a91014acc04000 (diff)
downloaddreambuilder_modpack-6bd13c15ff9d18ab41f57a58683525e2b65f35c2.tar
dreambuilder_modpack-6bd13c15ff9d18ab41f57a58683525e2b65f35c2.tar.gz
dreambuilder_modpack-6bd13c15ff9d18ab41f57a58683525e2b65f35c2.tar.bz2
dreambuilder_modpack-6bd13c15ff9d18ab41f57a58683525e2b65f35c2.tar.xz
dreambuilder_modpack-6bd13c15ff9d18ab41f57a58683525e2b65f35c2.zip
update technic and unified dyes
Diffstat (limited to 'unifieddyes')
-rw-r--r--unifieddyes/init.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua
index cfce06b..3329612 100644
--- a/unifieddyes/init.lua
+++ b/unifieddyes/init.lua
@@ -503,6 +503,14 @@ 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
+ end
+
if pointed_thing and pointed_thing.type == "object" then
pointed_thing.ref:punch(player, 0, itemstack:get_tool_capabilities())
return player:get_wielded_item() -- punch may modified the wielded item, load the new and return it
@@ -513,7 +521,6 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
local pos = minetest.get_pointed_thing_position(pointed_thing)
local node = minetest.get_node(pos)
local nodedef = minetest.registered_nodes[node.name]
- local playername = player:get_player_name()
if not nodedef then return end -- target was an unknown node, just bail out