summaryrefslogtreecommitdiff
path: root/homedecor
diff options
context:
space:
mode:
Diffstat (limited to 'homedecor')
-rw-r--r--homedecor/bathroom_furniture.lua6
-rw-r--r--homedecor/bedroom.lua6
-rw-r--r--homedecor/books.lua4
-rw-r--r--homedecor/crafts.lua12
-rw-r--r--homedecor/fences.lua2
-rw-r--r--homedecor/furniture.lua15
-rw-r--r--homedecor/handlers/expansion.lua9
-rw-r--r--homedecor/lighting.lua14
-rw-r--r--homedecor/shutters.lua2
-rw-r--r--homedecor/tables.lua2
-rw-r--r--homedecor/window_treatments.lua21
11 files changed, 23 insertions, 70 deletions
diff --git a/homedecor/bathroom_furniture.lua b/homedecor/bathroom_furniture.lua
index 585327b..0e839fd 100644
--- a/homedecor/bathroom_furniture.lua
+++ b/homedecor/bathroom_furniture.lua
@@ -137,13 +137,13 @@ local old_to_color = {
minetest.register_lbm({
name = "homedecor:convert_bathroom_tiles",
label = "Convert bathroom tiles to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_bathroom_tiles,
action = function(pos, node)
local name = node.name
local newname = "homedecor:bathroom_tiles_light"
- local a,b = string.find(node.name, "_")
- local color = string.sub(node.name, a + 1)
+ local a = string.find(name, "_")
+ local color = string.sub(name, a + 1)
if color == "tan" then
color = "yellow_s50"
diff --git a/homedecor/bedroom.lua b/homedecor/bedroom.lua
index 8e29ee3..1a7e42f 100644
--- a/homedecor/bedroom.lua
+++ b/homedecor/bedroom.lua
@@ -228,12 +228,14 @@ end
minetest.register_lbm({
name = "homedecor:convert_beds",
label = "Convert homedecor static bed nodes to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_bed_nodes,
action = function(pos, node)
local name = node.name
local color = string.sub(name, string.find(name, "_") + 1)
- local color = string.sub(color, 1, string.find(color, "_", -10) - 1) -- -10 puts us near the end of the color field
+
+ -- -10 puts us near the end of the color field
+ color = string.sub(color, 1, string.find(color, "_", -10) - 1)
if color == "darkgrey" then
color = "dark_grey"
diff --git a/homedecor/books.lua b/homedecor/books.lua
index 27127e3..a2213ac 100644
--- a/homedecor/books.lua
+++ b/homedecor/books.lua
@@ -1,8 +1,6 @@
local S = homedecor_i18n.gettext
-local function N_(x) return x end
-
local BOOK_FORMNAME = "homedecor:book_form"
local player_current_book = { }
@@ -189,7 +187,7 @@ end
minetest.register_lbm({
name = "homedecor:convert_books",
label = "Convert homedecor books to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_books,
action = function(pos, node)
local name = node.name
diff --git a/homedecor/crafts.lua b/homedecor/crafts.lua
index 9877f84..e2570cb 100644
--- a/homedecor/crafts.lua
+++ b/homedecor/crafts.lua
@@ -2476,18 +2476,6 @@ minetest.register_craft( {
},
})
-local bedcolors = {
- { "red", "red"},
- { "orange", "orange" },
- { "yellow", "yellow"},
- { "green", "dark_green"},
- { "blue", "blue"},
- { "violet", "violet"},
- { "pink", "pink"},
- { "darkgrey", "dark_grey"},
- { "brown", "brown" },
-}
-
minetest.register_craft( {
output = "homedecor:bed_regular",
recipe = {
diff --git a/homedecor/fences.lua b/homedecor/fences.lua
index 642b7c9..3affefe 100644
--- a/homedecor/fences.lua
+++ b/homedecor/fences.lua
@@ -16,8 +16,6 @@ end
local S = homedecor_i18n.gettext
-local function N_(x) return x end
-
local materials = {
{ S("brass"), "brass" },
{ S("wrought iron"), "wrought_iron" },
diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua
index d1e24a9..30e8e06 100644
--- a/homedecor/furniture.lua
+++ b/homedecor/furniture.lua
@@ -32,16 +32,6 @@ for _, t in ipairs(table_colors) do
})
end
-local chaircolors = {
- { "", S("plain") },
- { "black", S("black") },
- { "red", S("red") },
- { "pink", S("pink") },
- { "violet", S("violet") },
- { "blue", S("blue") },
- { "dark_green", S("dark green") },
-}
-
local kc_cbox = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125 },
@@ -93,7 +83,6 @@ homedecor.register("kitchen_chair_padded", {
after_place_node = homedecor.fix_rotation_nsew,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- local itemname = itemstack:get_name()
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
@@ -179,7 +168,7 @@ table.insert(homedecor.old_static_chairs, "homedecor:chair")
minetest.register_lbm({
name = "homedecor:convert_chairs",
label = "Convert homedecor chairs to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_chairs,
action = function(pos, node)
local name = node.name
@@ -200,7 +189,7 @@ minetest.register_lbm({
color = "dark_grey"
end
- paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
+ paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
end
local old_fdir = math.floor(node.param2 % 32)
diff --git a/homedecor/handlers/expansion.lua b/homedecor/handlers/expansion.lua
index 13c69f9..17d6d31 100644
--- a/homedecor/handlers/expansion.lua
+++ b/homedecor/handlers/expansion.lua
@@ -230,18 +230,9 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
end
local toppos = {x=pos.x, y=pos.y+1.0, z=pos.z}
- local botpos = {x=pos.x, y=pos.y-1.0, z=pos.z}
-
local topposfwd = {x=toppos.x+fxd, y=toppos.y, z=toppos.z+fzd}
- local topnodefwd = minetest.get_node(topposfwd)
-
- local topnode = minetest.get_node(toppos)
- local bottomnode = minetest.get_node(botpos)
-
- print(topnode.name, thisnode.name, bottomnode.name, itemstack:get_name(), dump(trybunks))
if trybunks and is_buildable_to(placer_name, toppos, topposfwd) then
- print("want to stack beds, top seems to be clear")
local newname = string.gsub(thisnode.name, "_regular", "_extended")
minetest.set_node(toppos, { name = thisnode.name, param2 = fdir})
minetest.set_node(pos, { name = newname, param2 = fdir})
diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua
index f7314d0..62a88a9 100644
--- a/homedecor/lighting.lua
+++ b/homedecor/lighting.lua
@@ -1,13 +1,7 @@
-- This file supplies glowlights
-local dirs2 = { 9, 18, 7, 12 }
-
local S = homedecor_i18n.gettext
-local function N_(x) return x end
-
-local colors = { N_("yellow"), N_("white") }
-
local glowlight_nodebox = {
half = homedecor.nodebox.slab_y(1/2),
quarter = homedecor.nodebox.slab_y(1/4),
@@ -563,7 +557,7 @@ end
minetest.register_lbm({
name = "homedecor:convert_lighting",
label = "Convert homedecor glowlights, table lamps, and standing lamps to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_nodes,
action = function(pos, node)
local name = node.name
@@ -579,7 +573,7 @@ minetest.register_lbm({
end
local lampname
- if string.find(name, "standing_lamp") then
+ if string.find(name, "standing_lamp") then
lampname = "homedecor:standing_lamp"
elseif string.find(name, "table_lamp") then
lampname = "homedecor:table_lamp"
@@ -617,7 +611,6 @@ minetest.register_lbm({
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, false)
- local old_node = node.name
local old_fdir
local new_node = newname
local new_fdir = 1
@@ -664,11 +657,10 @@ homedecor.old_static_desk_lamps = {
minetest.register_lbm({
name = "homedecor:convert_desk_lamps",
label = "Convert homedecor desk lamps to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_desk_lamps,
action = function(pos, node)
local name = node.name
- local newname
local color = string.sub(name, string.find(name, "_", -8) + 1)
if color == "green" then
diff --git a/homedecor/shutters.lua b/homedecor/shutters.lua
index 8feb0e7..ab1321d 100644
--- a/homedecor/shutters.lua
+++ b/homedecor/shutters.lua
@@ -73,7 +73,7 @@ end
minetest.register_lbm({
name = "homedecor:convert_shutters",
label = "Convert shutter static nodes to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_shutter_nodes,
action = function(pos, node)
local name = node.name
diff --git a/homedecor/tables.lua b/homedecor/tables.lua
index d0aa812..70ced41 100644
--- a/homedecor/tables.lua
+++ b/homedecor/tables.lua
@@ -4,7 +4,7 @@ local S = homedecor_i18n.gettext
-- Various kinds of tables
local materials = {
- { "glass",
+ { "glass",
S("Small square glass table"),
S("Small round glass table"),
S("Large glass table piece"),
diff --git a/homedecor/window_treatments.lua b/homedecor/window_treatments.lua
index 3b98123..06328d3 100644
--- a/homedecor/window_treatments.lua
+++ b/homedecor/window_treatments.lua
@@ -1,8 +1,6 @@
local S = homedecor_i18n.gettext
-local function N_(x) return x end
-
homedecor.register("window_quartered", {
description = S("Window (quartered)"),
tiles = {
@@ -117,7 +115,6 @@ minetest.register_node("homedecor:curtain_closed", {
after_dig_node = unifieddyes.after_dig_node,
after_place_node = homedecor.fix_rotation,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- local itemname = itemstack:get_name()
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Open the curtains
@@ -144,7 +141,6 @@ minetest.register_node("homedecor:curtain_open", {
after_dig_node = unifieddyes.after_dig_node,
after_place_node = homedecor.fix_rotation,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- local itemname = itemstack:get_name()
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Close the curtains
@@ -216,18 +212,17 @@ homedecor.register("stained_glass", {
-- Convert old curtain nodes to param2-colorization
local curtaincolors = {
- { N_("red"), "ad2323" },
- { N_("green"), "27a927" },
- { N_("blue"), "2626c6" },
- { N_("white"), "ffffff" },
- { N_("pink"), "ff8fb7" },
- { N_("violet"), "7f29d7" },
+ "red",
+ "green",
+ "blue",
+ "white",
+ "pink",
+ "violet",
}
homedecor.old_static_curtain_nodes = {}
-for _, i in ipairs(curtaincolors) do
- local color,hue = unpack(i)
+for _, color in ipairs(curtaincolors) do
table.insert(homedecor.old_static_curtain_nodes, "homedecor:curtain_"..color)
table.insert(homedecor.old_static_curtain_nodes, "homedecor:curtain_open_"..color)
end
@@ -235,7 +230,7 @@ end
minetest.register_lbm({
name = "homedecor:convert_curtains",
label = "Convert static curtain nodes to use param2 color",
- run_at_every_load = true,
+ run_at_every_load = false,
nodenames = homedecor.old_static_curtain_nodes,
action = function(pos, node)
local name = node.name