From 2b5664c0004b2f4ed8c712b8b6f75d9d3294c829 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 26 Feb 2017 11:11:19 -0500 Subject: updated lots of mods: blox, bobblocks, homedecor, coloredwood, gloopblocks, moreblocks, plasticbox, replacer, solidcolor, stained_glass, technic, unifiedbricks, and unifieddyes (in most of these, it's to upgrade to the Unified Dyes "extended" palette) --- replacer/init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'replacer/init.lua') diff --git a/replacer/init.lua b/replacer/init.lua index 6b7732c..3ab8cce 100644 --- a/replacer/init.lua +++ b/replacer/init.lua @@ -89,17 +89,13 @@ minetest.register_tool( "replacer:replacer", local node = minetest.get_node_or_nil( pos ); --minetest.chat_send_player( name, " Target node: "..minetest.serialize( node ).." at pos "..minetest.serialize( pos ).."."); - - local item = itemstack:to_table(); - -- make sure metadata is always set + local metadata = "default:dirt 0 0"; if( node ~= nil and node.name ) then - item[ "metadata" ] = node.name..' '..node.param1..' '..node.param2; - else - item[ "metadata" ] = "default:dirt 0 0"; + metadata = node.name..' '..node.param1..' '..node.param2; end - itemstack:replace( item ); + itemstack:set_metadata( metadata ); - minetest.chat_send_player( name, "Node replacement tool set to: '"..item[ "metadata" ].."'."); + minetest.chat_send_player( name, "Node replacement tool set to: '"..metadata.."'."); return itemstack; -- nothing consumed but data changed end, -- cgit v1.2.3