summaryrefslogtreecommitdiff
path: root/homedecor/handlers
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-22 22:28:28 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-22 22:28:28 -0400
commit9c9457e1f50ebdd943695a4cce6b88fa552370f3 (patch)
tree4f6002b266179e0dd1639affffd4f09a18dfcad5 /homedecor/handlers
parent3c47f229fcbdb7cad28bacbc579516bf3ecf6c03 (diff)
downloaddreambuilder_modpack-9c9457e1f50ebdd943695a4cce6b88fa552370f3.tar
dreambuilder_modpack-9c9457e1f50ebdd943695a4cce6b88fa552370f3.tar.gz
dreambuilder_modpack-9c9457e1f50ebdd943695a4cce6b88fa552370f3.tar.bz2
dreambuilder_modpack-9c9457e1f50ebdd943695a4cce6b88fa552370f3.tar.xz
dreambuilder_modpack-9c9457e1f50ebdd943695a4cce6b88fa552370f3.zip
update castles modpack, blox, bobblocks, coloredwood, technic,
gloopblocks, homedecor, ilights, led marquee, plasticbox, solidcolor, stained_glass, unified bricks, and unified dyes In most of these, the update is to shift over to the new "old" coloring paradigm in Unified Dyes. See its forum thread for details.
Diffstat (limited to 'homedecor/handlers')
-rw-r--r--homedecor/handlers/expansion.lua26
1 files changed, 9 insertions, 17 deletions
diff --git a/homedecor/handlers/expansion.lua b/homedecor/handlers/expansion.lua
index e9d2ec5..779e077 100644
--- a/homedecor/handlers/expansion.lua
+++ b/homedecor/handlers/expansion.lua
@@ -211,22 +211,21 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
local rightnode = minetest.get_node(rightpos)
local inv = placer:get_inventory()
- local lastdye = unifieddyes.last_used_dye[placer_name]
if leftnode.name == "homedecor:bed_regular" then
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
- local meta = minetest.get_meta(leftpos)
+ local meta = minetest.get_meta(pos)
+ local leftmeta = minetest.get_meta(leftpos)
+
minetest.set_node(pos, {name = "air"})
- minetest.set_node(leftpos, { name = newname, param2 = param2})
- meta:set_string("dye", lastdye)
- inv:add_item("main", lastdye)
+ minetest.swap_node(leftpos, { name = newname, param2 = param2})
elseif rightnode.name == "homedecor:bed_regular" then
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
- local meta = minetest.get_meta(rightpos)
+ local meta = minetest.get_meta(pos)
+ local rightmeta = minetest.get_meta(rightpos)
+
minetest.set_node(rightpos, {name = "air"})
- minetest.set_node(pos, { name = newname, param2 = param2})
- meta:set_string("dye", lastdye)
- inv:add_item("main", lastdye)
+ minetest.swap_node(pos, { name = newname, param2 = param2})
end
local toppos = {x=pos.x, y=pos.y+1.0, z=pos.z}
@@ -235,14 +234,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
if trybunks and is_buildable_to(placer_name, toppos, topposfwd) then
local newname = string.gsub(thisnode.name, "_regular", "_extended")
local newparam2 = param2 % 8
- if inv:contains_item("main", lastdye) then
- minetest.set_node(toppos, { name = thisnode.name, param2 = param2})
- if lastdye then inv:remove_item("main", lastdye.." 1") end
- else
- minetest.set_node(toppos, { name = thisnode.name, param2 = newparam2})
- minetest.chat_send_player(placer_name, "Ran out of "..lastdye..", using neutral color.")
- unifieddyes.last_used_dye[placer_name] = nil
- end
+ minetest.swap_node(toppos, { name = thisnode.name, param2 = param2})
minetest.swap_node(pos, { name = newname, param2 = param2})
itemstack:take_item()
end