summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-18 21:27:50 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-18 21:27:50 -0400
commit672c91d615e5da90cd6b11601608981ff2568d40 (patch)
treebefa10ebe421406e0e466d300b74af01a41a12f5
parent892df477a4c724b8a46fe002a8a83ad64c27888c (diff)
downloaddreambuilder_modpack-672c91d615e5da90cd6b11601608981ff2568d40.tar
dreambuilder_modpack-672c91d615e5da90cd6b11601608981ff2568d40.tar.gz
dreambuilder_modpack-672c91d615e5da90cd6b11601608981ff2568d40.tar.bz2
dreambuilder_modpack-672c91d615e5da90cd6b11601608981ff2568d40.tar.xz
dreambuilder_modpack-672c91d615e5da90cd6b11601608981ff2568d40.zip
update unified dyes
-rw-r--r--unifieddyes/init.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua
index 47faf46..9b85903 100644
--- a/unifieddyes/init.lua
+++ b/unifieddyes/init.lua
@@ -561,6 +561,7 @@ function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
end
function unifieddyes.on_use(itemstack, player, pointed_thing)
+ local stackname = itemstack:get_name()
local playername = player:get_player_name()
if pointed_thing and pointed_thing.type == "node" then
@@ -593,6 +594,14 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
end
end
+ if player:get_player_control().sneak then
+ if unifieddyes.last_used_dye[playername] then
+ minetest.chat_send_player(playername, "Shift-punched a node, switching back to neutral color." )
+ end
+ unifieddyes.last_used_dye[playername] = nil
+ return
+ end
+
-- if the target is unknown, has no groups defined, or isn't UD-colorable, just bail out
if not (nodedef and nodedef.groups and nodedef.groups.ud_param2_colorable) then
minetest.chat_send_player(playername, "That node can't be colored.")
@@ -617,13 +626,15 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
return
end
- local stackname = itemstack:get_name()
local pos2 = unifieddyes.select_node(pointed_thing)
local paletteidx, hue = unifieddyes.getpaletteidx(stackname, palette_type)
if paletteidx then
- unifieddyes.last_used_dye[playername] = stackname
+ if unifieddyes.last_used_dye[playername] ~= stackname then
+ minetest.chat_send_player(playername, "Color "..stackname.." selected, auto-coloring activated." )
+ unifieddyes.last_used_dye[playername] = stackname
+ end
local meta = minetest.get_meta(pos)
local prevdye = meta:get_string("dye")