Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Illuna-Minetest/homedecor_modpack
1 result
Show changes
Commits on Source (147)
Showing
with 340 additions and 227 deletions
unused_args = false
allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest", "core",
"dump",
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"intllib",
"default",
"stairsplus",
"signs_lib",
"beds",
"technic",
"mesecon",
"unifieddyes",
"creative",
}
globals = {
"armor",
}
This is what I consider to be a fairly feature-filled home decor This is what I consider to be a fairly feature-filled home decor modpack.
modpack. As such, it comes in multiple parts: See the forum thread at
https://forum.minetest.net/viewtopic.php?f=11&t=2041 for details about
this modpack.
* The actual homedecor mod, which supplies a bunch of stuff found in Dependencies: unifieddyes and a Minetest engine build newer than 2017-01-23.
most homes (like flower pots, home electronics, brass and wrought-iron
tables, and a bunch of other things).
* A "3d extras" mod, which supplies things that re-define something in Recommends: signs_lib, windmill, moreblocks, unified_inventory.
some other mod (or in the default game) so that those objects become
fully 3d (instead of a flat cube), as well as things which are directly
related. This mod, for example, provides 3d bookshelves and their empty
and half-depth "open frame" counterparts.
* A signs library forked from the one that thexyz and PilzAdam first
made, which produces visible text on signs (and which has been extended
to put signs on fences, including the brass and wrought iron ones here
in homedecor).
* Sdzen's building_blocks mod, which is here to supply not only a few
blocks to build with, obviously, :-) but also to supply a number of
materials to craft other things in Homedecor with.
All items can be accessed either by crafting various other items
together, or with the usual /give commands. To get a list of the actual
node names, just go into the homedecor/ folder and run the listnodes.sh
Bash script. Note that a few of the listed nodes are kinda useless by
themselves (like the various parts of the folding doors).
All of the images used for the recipes in the forum post tracking this
mod are included in the crafting-guide/ folder.
Most stuff can be made from materials found through a game world. Some
stuff can only be crafted by using materials from another mod (look for
the orange highlights). Currently, this mod can use materials from
moreores, mesecons, wool, and unifieddyes if present. You can still use
the usual /give commands to get the items that depend on these mods if
you don't use them installed.
This mod is still a work-in-progress, but should be complete enough not
to irritate anyone. :-) Namely, many items can be used as fuel but the
burn times need tuning and I need to tune the cook time and fuel usage
on the four smelted items.
Much of the code (especially for the doors) plus the bucket were taken
from the files which come with Minetest and altered to suit. Many
thanks to Jeija for coming up with an elegant cylinder using nodeboxes;
see his 'irregular' mods). His code is used herein (you can guess where
:-) ).
Dependencies: none (just the game's default stuff)
Recommends: buckets, flowers, unifieddyes, junglegrass, moreores,
mesecons, wool
Skin credits:
Mammu by hansuke123
http://minetest.fensta.bplaced.net/#name=Mammu
BrightGirl by Malarif
http://minetest.fensta.bplaced.net/#name=BrightGirl
default default
moreblocks? homedecor_i18n
moreblocks
minetest.get_modpath("darkage") minetest.get_modpath("darkage")
minetest.get_modpath("moreblocks") minetest.get_modpath("moreblocks")
local S = homedecor_i18n.gettext
minetest.register_node("building_blocks:Adobe", { minetest.register_node("building_blocks:Adobe", {
tiles = {"building_blocks_Adobe.png"}, tiles = {"building_blocks_Adobe.png"},
description = "Adobe", description = S("Adobe"),
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
...@@ -11,7 +13,7 @@ minetest.register_node("building_blocks:Adobe", { ...@@ -11,7 +13,7 @@ minetest.register_node("building_blocks:Adobe", {
minetest.register_node("building_blocks:Roofing", { minetest.register_node("building_blocks:Roofing", {
tiles = {"building_blocks_Roofing.png"}, tiles = {"building_blocks_Roofing.png"},
is_ground_content = true, is_ground_content = true,
description = "Roof block", description = S("Roof block"),
groups = {snappy=3}, groups = {snappy=3},
}) })
minetest.register_craft({ minetest.register_craft({
...@@ -131,7 +133,7 @@ minetest.register_craft({ ...@@ -131,7 +133,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = 'building_blocks:tar_base 2', output = 'building_blocks:tar_base 4',
recipe = { recipe = {
{"default:coal_lump", "default:gravel"}, {"default:coal_lump", "default:gravel"},
{"default:gravel", "default:coal_lump"} {"default:gravel", "default:coal_lump"}
...@@ -139,7 +141,7 @@ minetest.register_craft({ ...@@ -139,7 +141,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = 'building_blocks:tar_base 2', output = 'building_blocks:tar_base 4',
recipe = { recipe = {
{"default:gravel", "default:coal_lump"}, {"default:gravel", "default:coal_lump"},
{"default:coal_lump", "default:gravel"} {"default:coal_lump", "default:gravel"}
...@@ -153,7 +155,7 @@ minetest.register_craft({ ...@@ -153,7 +155,7 @@ minetest.register_craft({
}) })
minetest.register_node("building_blocks:smoothglass", { minetest.register_node("building_blocks:smoothglass", {
drawtype = "glasslike", drawtype = "glasslike",
description = "Streak Free Glass", description = S("Streak Free Glass"),
tiles = {"building_blocks_sglass.png"}, tiles = {"building_blocks_sglass.png"},
inventory_image = minetest.inventorycube("building_blocks_sglass.png"), inventory_image = minetest.inventorycube("building_blocks_sglass.png"),
paramtype = "light", paramtype = "light",
...@@ -175,7 +177,7 @@ minetest.register_node("building_blocks:smoothglass", { ...@@ -175,7 +177,7 @@ minetest.register_node("building_blocks:smoothglass", {
minetest.register_node("building_blocks:grate", { minetest.register_node("building_blocks:grate", {
drawtype = "glasslike", drawtype = "glasslike",
description = "Grate", description = S("Grate"),
tiles = {"building_blocks_grate.png"}, tiles = {"building_blocks_grate.png"},
inventory_image = minetest.inventorycube("building_blocks_grate.png"), inventory_image = minetest.inventorycube("building_blocks_grate.png"),
paramtype = "light", paramtype = "light",
...@@ -185,7 +187,7 @@ minetest.register_node("building_blocks:grate", { ...@@ -185,7 +187,7 @@ minetest.register_node("building_blocks:grate", {
}) })
minetest.register_node("building_blocks:Fireplace", { minetest.register_node("building_blocks:Fireplace", {
description = "Fireplace", description = S("Fireplace"),
tiles = { tiles = {
"building_blocks_cast_iron.png", "building_blocks_cast_iron.png",
"building_blocks_cast_iron.png", "building_blocks_cast_iron.png",
...@@ -202,7 +204,7 @@ minetest.register_node("building_blocks:Fireplace", { ...@@ -202,7 +204,7 @@ minetest.register_node("building_blocks:Fireplace", {
minetest.register_node("building_blocks:woodglass", { minetest.register_node("building_blocks:woodglass", {
drawtype = "glasslike", drawtype = "glasslike",
description = "Wood Framed Glass", description = S("Wood Framed Glass"),
tiles = {"building_blocks_wglass.png"}, tiles = {"building_blocks_wglass.png"},
inventory_image = minetest.inventorycube("building_blocks_wglass.png"), inventory_image = minetest.inventorycube("building_blocks_wglass.png"),
paramtype = "light", paramtype = "light",
...@@ -213,7 +215,7 @@ minetest.register_node("building_blocks:woodglass", { ...@@ -213,7 +215,7 @@ minetest.register_node("building_blocks:woodglass", {
}) })
minetest.register_node("building_blocks:terrycloth_towel", { minetest.register_node("building_blocks:terrycloth_towel", {
drawtype = "raillike", drawtype = "raillike",
description = "Terrycloth towel", description = S("Terrycloth towel"),
tiles = {"building_blocks_towel.png"}, tiles = {"building_blocks_towel.png"},
inventory_image = "building_blocks_towel_inv.png", inventory_image = "building_blocks_towel_inv.png",
paramtype = "light", paramtype = "light",
...@@ -229,7 +231,7 @@ minetest.register_node("building_blocks:terrycloth_towel", { ...@@ -229,7 +231,7 @@ minetest.register_node("building_blocks:terrycloth_towel", {
}) })
minetest.register_node("building_blocks:Tarmac_spread", { minetest.register_node("building_blocks:Tarmac_spread", {
drawtype = "raillike", drawtype = "raillike",
description = "Tarmac Spread", description = S("Tarmac Spread"),
tiles = {"building_blocks_tar.png"}, tiles = {"building_blocks_tar.png"},
inventory_image = "building_blocks_tar_spread_inv.png", inventory_image = "building_blocks_tar_spread_inv.png",
paramtype = "light", paramtype = "light",
...@@ -246,7 +248,7 @@ minetest.register_node("building_blocks:Tarmac_spread", { ...@@ -246,7 +248,7 @@ minetest.register_node("building_blocks:Tarmac_spread", {
}) })
minetest.register_node("building_blocks:BWtile", { minetest.register_node("building_blocks:BWtile", {
drawtype = "raillike", drawtype = "raillike",
description = "Chess board tiling", description = S("Chess board tiling"),
tiles = {"building_blocks_BWtile.png"}, tiles = {"building_blocks_BWtile.png"},
inventory_image = "building_blocks_bwtile_inv.png", inventory_image = "building_blocks_bwtile_inv.png",
paramtype = "light", paramtype = "light",
...@@ -262,7 +264,9 @@ minetest.register_node("building_blocks:BWtile", { ...@@ -262,7 +264,9 @@ minetest.register_node("building_blocks:BWtile", {
}) })
minetest.register_node("building_blocks:brobble_spread", { minetest.register_node("building_blocks:brobble_spread", {
drawtype = "raillike", drawtype = "raillike",
description = "Brobble Spread", -- Translators: "Brobble" is a portmanteau of "Brick" and "Cobble".
-- Translate however you see fit.
description = S("Brobble Spread"),
tiles = {"building_blocks_brobble.png"}, tiles = {"building_blocks_brobble.png"},
inventory_image = "building_blocks_brobble_spread_inv.png", inventory_image = "building_blocks_brobble_spread_inv.png",
paramtype = "light", paramtype = "light",
...@@ -278,7 +282,7 @@ minetest.register_node("building_blocks:brobble_spread", { ...@@ -278,7 +282,7 @@ minetest.register_node("building_blocks:brobble_spread", {
}) })
minetest.register_node("building_blocks:gravel_spread", { minetest.register_node("building_blocks:gravel_spread", {
drawtype = "raillike", drawtype = "raillike",
description = "Gravel Spread", description = S("Gravel Spread"),
tiles = {"default_gravel.png"}, tiles = {"default_gravel.png"},
inventory_image = "building_blocks_gravel_spread_inv.png", inventory_image = "building_blocks_gravel_spread_inv.png",
paramtype = "light", paramtype = "light",
...@@ -299,7 +303,7 @@ minetest.register_node("building_blocks:gravel_spread", { ...@@ -299,7 +303,7 @@ minetest.register_node("building_blocks:gravel_spread", {
minetest.register_node("building_blocks:hardwood", { minetest.register_node("building_blocks:hardwood", {
tiles = {"building_blocks_hardwood.png"}, tiles = {"building_blocks_hardwood.png"},
is_ground_content = true, is_ground_content = true,
description = "Hardwood", description = S("Hardwood"),
groups = {choppy=1,flammable=1}, groups = {choppy=1,flammable=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
...@@ -330,6 +334,17 @@ if minetest.get_modpath("moreblocks") then ...@@ -330,6 +334,17 @@ if minetest.get_modpath("moreblocks") then
}), }),
} }
) )
for _, i in ipairs(stairsplus.shapes_list) do
local class = i[1]
local cut = i[2]
minetest.unregister_item("moreblocks:"..class.."tar"..cut)
minetest.register_alias("moreblocks:"..class.."tar"..cut, "building_blocks:"..class.."tar"..cut)
end
minetest.unregister_item("moreblocks:tar")
minetest.register_alias("moreblocks:tar", "building_blocks:Tar")
stairsplus:register_all( stairsplus:register_all(
"building_blocks", "building_blocks",
"tar", "tar",
...@@ -341,6 +356,7 @@ if minetest.get_modpath("moreblocks") then ...@@ -341,6 +356,7 @@ if minetest.get_modpath("moreblocks") then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
} }
) )
stairsplus:register_all( stairsplus:register_all(
"building_blocks", "building_blocks",
"grate", "grate",
...@@ -448,41 +464,48 @@ else ...@@ -448,41 +464,48 @@ else
bb_stairs.register_stair(subname, recipeitem, groups, images, desc_stair) bb_stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
bb_stairs.register_slab(subname, recipeitem, groups, images, desc_slab) bb_stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
end end
bb_stairs.register_stair_and_slab("marble","building_blocks:Marble",
{cracky=3},
{"building_blocks_marble.png"},
S("Marble stair"),
S("Marble slab")
)
bb_stairs.register_stair_and_slab("hardwood","building_blocks:hardwood", bb_stairs.register_stair_and_slab("hardwood","building_blocks:hardwood",
{choppy=1,flammable=1}, {choppy=1,flammable=1},
{"building_blocks_hardwood.png"}, {"building_blocks_hardwood.png"},
"Hardwood stair", S("Hardwood stair"),
"Hardwood slab" S("Hardwood slab")
) )
bb_stairs.register_stair_and_slab("fakegrass","building_blocks:fakegrass", bb_stairs.register_stair_and_slab("fakegrass","building_blocks:fakegrass",
{crumbly=3}, {crumbly=3},
{"default_grass.png"}, {"default_grass.png"},
"Grass stair", S("Grass stair"),
"Grass slab" S("Grass slab")
) )
bb_stairs.register_stair_and_slab("tar","building_blocks:Tar", bb_stairs.register_stair_and_slab("tar","building_blocks:Tar",
{crumbly=1}, {crumbly=1},
{"building_blocks_tar.png"}, {"building_blocks_tar.png"},
"Tar stair", S("Tar stair"),
"Tar slab" S("Tar slab")
) )
bb_stairs.register_stair_and_slab("grate","building_blocks:grate", bb_stairs.register_stair_and_slab("grate","building_blocks:grate",
{cracky=1}, {cracky=1},
{"building_blocks_grate.png"}, {"building_blocks_grate.png"},
"Grate Stair", S("Grate Stair"),
"Grate Slab" S("Grate Slab")
) )
bb_stairs.register_stair_and_slab("Adobe", "building_blocks:Adobe", bb_stairs.register_stair_and_slab("Adobe", "building_blocks:Adobe",
{crumbly=3}, {crumbly=3},
{"building_blocks_Adobe.png"}, {"building_blocks_Adobe.png"},
"Adobe stair", S("Adobe stair"),
"Adobe slab" S("Adobe slab")
) )
bb_stairs.register_stair_and_slab("Roofing", "building_blocks:Roofing", bb_stairs.register_stair_and_slab("Roofing", "building_blocks:Roofing",
{snappy=3}, {snappy=3},
{"building_blocks_Roofing.png"}, {"building_blocks_Roofing.png"},
"Roofing stair", S("Roofing stair"),
"Roofing slab" S("Roofing slab")
) )
end end
...@@ -495,7 +518,7 @@ minetest.register_craft({ ...@@ -495,7 +518,7 @@ minetest.register_craft({
minetest.register_node("building_blocks:fakegrass", { minetest.register_node("building_blocks:fakegrass", {
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
description = "Fake Grass", description = S("Fake Grass"),
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
...@@ -504,13 +527,13 @@ minetest.register_node("building_blocks:fakegrass", { ...@@ -504,13 +527,13 @@ minetest.register_node("building_blocks:fakegrass", {
}) })
minetest.register_craftitem("building_blocks:sticks", { minetest.register_craftitem("building_blocks:sticks", {
description = "Small bundle of sticks", description = S("Small bundle of sticks"),
image = "building_blocks_sticks.png", image = "building_blocks_sticks.png",
on_place_on_ground = minetest.craftitem_place_item, on_place_on_ground = minetest.craftitem_place_item,
}) })
minetest.register_craftitem("building_blocks:tar_base", { minetest.register_craftitem("building_blocks:tar_base", {
description = "Tar base", description = S("Tar base"),
image = "building_blocks_tar_base.png", image = "building_blocks_tar_base.png",
}) })
...@@ -533,7 +556,7 @@ minetest.register_alias("sticks", "building_blocks:sticks") ...@@ -533,7 +556,7 @@ minetest.register_alias("sticks", "building_blocks:sticks")
minetest.register_alias("building_blocks:faggot", "building_blocks:sticks") minetest.register_alias("building_blocks:faggot", "building_blocks:sticks")
minetest.register_node("building_blocks:Tar", { minetest.register_node("building_blocks:Tar", {
description = "Tar", description = S("Tar"),
tiles = {"building_blocks_tar.png"}, tiles = {"building_blocks_tar.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=1, tar_block = 1}, groups = {crumbly=1, tar_block = 1},
...@@ -564,13 +587,13 @@ minetest.register_craft({ ...@@ -564,13 +587,13 @@ minetest.register_craft({
}) })
minetest.register_tool("building_blocks:knife", { minetest.register_tool("building_blocks:knife", {
description = "Tar Knife", description = S("Tar Knife"),
inventory_image = "building_blocks_knife.png", inventory_image = "building_blocks_knife.png",
tool_capabilities = { tool_capabilities = {
max_drop_level=0, max_drop_level=0,
groupcaps={ groupcaps={
choppy={times={[2]=7.50, [3]=2.80}, maxwear=0.01, maxlevel=1}, choppy={times={[2]=7.50, [3]=2.80}, uses=100, maxlevel=1},
fleshy={times={[2]=5.50, [3]=2.80}, maxwear=0.01, maxlevel=1} fleshy={times={[2]=5.50, [3]=2.80}, uses=100, maxlevel=1}
} }
}, },
}) })
...@@ -584,14 +607,14 @@ minetest.register_craft({ ...@@ -584,14 +607,14 @@ minetest.register_craft({
} }
}) })
if not minetest.get_modpath("technic") then if not minetest.get_modpath("technic") then
minetest.register_node( ":technic:granite", { minetest.register_node( ":technic:granite", {
description = "Granite", description = S("Granite"),
tiles = { "technic_granite.png" }, tiles = { "technic_granite.png" },
is_ground_content = true, is_ground_content = true,
groups = {cracky=1}, groups = {cracky=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "technic:granite 9", output = "technic:granite 9",
...@@ -604,7 +627,7 @@ if not minetest.get_modpath("technic") then ...@@ -604,7 +627,7 @@ if not minetest.get_modpath("technic") then
if minetest.get_modpath("moreblocks") then if minetest.get_modpath("moreblocks") then
stairsplus:register_all("technic", "granite", "technic:granite", { stairsplus:register_all("technic", "granite", "technic:granite", {
description="Granite", description=S("Granite"),
groups={cracky=1, not_in_creative_inventory=1}, groups={cracky=1, not_in_creative_inventory=1},
tiles={"technic_granite.png"}, tiles={"technic_granite.png"},
}) })
......
default default
\ No newline at end of file homedecor
local S = homedecor_i18n.gettext
local chains_sbox = { local chains_sbox = {
type = "fixed", type = "fixed",
fixed = { -0.1, -0.625, -0.1, 0.1, 0.5, 0.1 } fixed = { -0.1, -0.625, -0.1, 0.1, 0.5, 0.1 }
...@@ -12,7 +15,7 @@ local topchains_sbox = { ...@@ -12,7 +15,7 @@ local topchains_sbox = {
} }
minetest.register_node("chains:chain", { minetest.register_node("chains:chain", {
description = "Hanging chain (wrought iron)", description = S("Hanging chain (wrought iron)"),
drawtype = "mesh", drawtype = "mesh",
mesh = "chains.obj", mesh = "chains.obj",
tiles = {"chains_wrought_iron.png"}, tiles = {"chains_wrought_iron.png"},
...@@ -26,7 +29,7 @@ minetest.register_node("chains:chain", { ...@@ -26,7 +29,7 @@ minetest.register_node("chains:chain", {
}) })
minetest.register_node("chains:chain_brass", { minetest.register_node("chains:chain_brass", {
description = "Hanging chain (brass)", description = S("Hanging chain (brass)"),
drawtype = "mesh", drawtype = "mesh",
mesh = "chains.obj", mesh = "chains.obj",
tiles = {"chains_brass.png"}, tiles = {"chains_brass.png"},
...@@ -40,7 +43,7 @@ minetest.register_node("chains:chain_brass", { ...@@ -40,7 +43,7 @@ minetest.register_node("chains:chain_brass", {
}) })
minetest.register_node("chains:chain_top", { minetest.register_node("chains:chain_top", {
description = "Hanging chain (ceiling mount, wrought iron)", description = S("Hanging chain (ceiling mount, wrought iron)"),
drawtype = "mesh", drawtype = "mesh",
mesh = "top_chains.obj", mesh = "top_chains.obj",
tiles = {"chains_wrought_iron.png"}, tiles = {"chains_wrought_iron.png"},
...@@ -54,7 +57,7 @@ minetest.register_node("chains:chain_top", { ...@@ -54,7 +57,7 @@ minetest.register_node("chains:chain_top", {
}) })
minetest.register_node("chains:chain_top_brass", { minetest.register_node("chains:chain_top_brass", {
description = "Hanging chain (ceiling mount, brass)", description = S("Hanging chain (ceiling mount, brass)"),
drawtype = "mesh", drawtype = "mesh",
mesh = "top_chains.obj", mesh = "top_chains.obj",
tiles = {"chains_brass.png"}, tiles = {"chains_brass.png"},
...@@ -68,13 +71,12 @@ minetest.register_node("chains:chain_top_brass", { ...@@ -68,13 +71,12 @@ minetest.register_node("chains:chain_top_brass", {
}) })
minetest.register_node("chains:chandelier", { minetest.register_node("chains:chandelier", {
description = "Chandelier (wrought iron)", description = S("Chandelier (wrought iron)"),
paramtype = "light", paramtype = "light",
light_source = default.LIGHT_MAX-2, light_source = default.LIGHT_MAX-2,
walkable = false, walkable = false,
climbable = true, climbable = true,
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light",
tiles = { tiles = {
"chains_wrought_iron.png", "chains_wrought_iron.png",
"chains_candle.png", "chains_candle.png",
...@@ -95,13 +97,12 @@ minetest.register_node("chains:chandelier", { ...@@ -95,13 +97,12 @@ minetest.register_node("chains:chandelier", {
}) })
minetest.register_node("chains:chandelier_brass", { minetest.register_node("chains:chandelier_brass", {
description = "Chandelier (brass)", description = S("Chandelier (brass)"),
paramtype = "light", paramtype = "light",
light_source = default.LIGHT_MAX-2, light_source = default.LIGHT_MAX-2,
walkable = false, walkable = false,
climbable = true, climbable = true,
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light",
tiles = { tiles = {
"chains_brass.png", "chains_brass.png",
"chains_candle.png", "chains_candle.png",
......
local S = homedecor_i18n.gettext
-- Amiga 500 lookalike -- Amiga 500 lookalike
computer.register("computer:shefriendSOO", { computer.register("computer:shefriendSOO", {
description = "SheFriendSOO", description = "SheFriendSOO",
...@@ -150,6 +153,19 @@ computer.register("computer:admiral128", { ...@@ -150,6 +153,19 @@ computer.register("computer:admiral128", {
}) })
}) })
-- XBox lookalike
computer.register("computer:hueg_box", {
description = "HUEG Box",
tiles_off = { },
node_box = computer.pixelnodebox(16, {
-- X Y Z W H L
{ 0, 0, 7, 16, 6, 9 }, -- Console
{ 2, 0, 1, 11, 3, 6 }, -- Controller
{ 2, 0, 0, 2, 3, 1 },
{ 11, 0, 0, 2, 3, 1 },
})
})
-- Generic Flat Screen LCD (16x9) with keyboard -- Generic Flat Screen LCD (16x9) with keyboard
local mo_sbox = { local mo_sbox = {
type = "fixed", type = "fixed",
...@@ -157,7 +173,7 @@ local mo_sbox = { ...@@ -157,7 +173,7 @@ local mo_sbox = {
} }
minetest.register_node("computer:monitor", { minetest.register_node("computer:monitor", {
description = "Monitor and keyboard", description = S("Monitor and keyboard"),
inventory_image = "computer_monitor_inv.png", inventory_image = "computer_monitor_inv.png",
drawtype = "mesh", drawtype = "mesh",
mesh = "computer_monitor.obj", mesh = "computer_monitor.obj",
...@@ -175,7 +191,6 @@ minetest.register_node("computer:monitor", { ...@@ -175,7 +191,6 @@ minetest.register_node("computer:monitor", {
}) })
minetest.register_node("computer:monitor_on", { minetest.register_node("computer:monitor_on", {
description = "Monitor and keyboard",
drawtype = "mesh", drawtype = "mesh",
mesh = "computer_monitor.obj", mesh = "computer_monitor.obj",
tiles = {"monitor_display.png^[transformFX", "monitor_plastic.png", "computer_black.png", "monitor_plastic.png"}, tiles = {"monitor_display.png^[transformFX", "monitor_plastic.png", "computer_black.png", "monitor_plastic.png"},
...@@ -200,7 +215,7 @@ minetest.register_alias("computer:monitor_desktop", "computer:monitor") ...@@ -200,7 +215,7 @@ minetest.register_alias("computer:monitor_desktop", "computer:monitor")
--WIFI Router (linksys look-a-like) --WIFI Router (linksys look-a-like)
minetest.register_node("computer:router", { minetest.register_node("computer:router", {
description = "WIFI Router", description = S("WIFI Router"),
inventory_image = "computer_router_inv.png", inventory_image = "computer_router_inv.png",
tiles = {"computer_router_t.png","computer_router_bt.png","computer_router_l.png","computer_router_r.png","computer_router_b.png", tiles = {"computer_router_t.png","computer_router_bt.png","computer_router_l.png","computer_router_r.png","computer_router_b.png",
{name="computer_router_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"computer_router_f.png"}, {name="computer_router_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"computer_router_f.png"},
...@@ -228,7 +243,7 @@ local pct_cbox = { ...@@ -228,7 +243,7 @@ local pct_cbox = {
--Modern PC Tower --Modern PC Tower
minetest.register_node("computer:tower", { minetest.register_node("computer:tower", {
description = "Computer Tower", description = S("Computer Tower"),
inventory_image = "computer_tower_inv.png", inventory_image = "computer_tower_inv.png",
drawtype = "mesh", drawtype = "mesh",
mesh = "computer_tower.obj", mesh = "computer_tower.obj",
...@@ -245,7 +260,7 @@ minetest.register_alias("computer:tower_on", "computer:tower") ...@@ -245,7 +260,7 @@ minetest.register_alias("computer:tower_on", "computer:tower")
-- Printer/scaner combo -- Printer/scaner combo
minetest.register_node("computer:printer", { minetest.register_node("computer:printer", {
description = "Printer Scaner Combo", description = S("Printer-Scanner Combo"),
inventory_image = "computer_printer_inv.png", inventory_image = "computer_printer_inv.png",
tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png", tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png",
"computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"}, "computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
...@@ -273,7 +288,7 @@ minetest.register_node("computer:printer", { ...@@ -273,7 +288,7 @@ minetest.register_node("computer:printer", {
--Rack Server --Rack Server
minetest.register_node("computer:server", { minetest.register_node("computer:server", {
drawtype = "nodebox", drawtype = "nodebox",
description = "Rack Server", description = S("Rack Server"),
tiles = { tiles = {
'computer_server_t.png', 'computer_server_t.png',
'computer_server_bt.png', 'computer_server_bt.png',
...@@ -303,7 +318,8 @@ minetest.register_node("computer:server", { ...@@ -303,7 +318,8 @@ minetest.register_node("computer:server", {
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" ) minetest.chat_send_player( placer:get_player_name(),
S("Not enough vertical space to place a server!" ))
return itemstack return itemstack
end end
return minetest.item_place(itemstack, placer, pointed_thing) return minetest.item_place(itemstack, placer, pointed_thing)
...@@ -312,12 +328,11 @@ minetest.register_node("computer:server", { ...@@ -312,12 +328,11 @@ minetest.register_node("computer:server", {
minetest.register_node("computer:server_on", { minetest.register_node("computer:server_on", {
drawtype = "nodebox", drawtype = "nodebox",
description = "Rack Server",
tiles = { tiles = {
'computer_server_t.png', 'computer_server_t.png',
'computer_server_bt.png', 'computer_server_bt.png',
'computer_server_r.png',
'computer_server_l.png', 'computer_server_l.png',
'computer_server_r.png',
'computer_server_bt.png', 'computer_server_bt.png',
'computer_server_f_on.png', 'computer_server_f_on.png',
}, },
......
default default
intllib? homedecor_i18n
...@@ -2,19 +2,18 @@ computer = {} ...@@ -2,19 +2,18 @@ computer = {}
screwdriver = screwdriver or {} screwdriver = screwdriver or {}
computer.register = function (name, def) computer.register = function (name, def)
local nodename = name
if (name:sub(1, 1) == ":") then name = name:sub(2) end if (name:sub(1, 1) == ":") then name = name:sub(2) end
local modname, basename = name:match("^([^:]+):(.*)") local modname, basename = name:match("^([^:]+):(.*)")
local TEXPFX = modname.."_"..basename.."_" local TEXPFX = modname.."_"..basename.."_"
local ONSTATE = modname..":"..basename local ONSTATE = modname..":"..basename
local OFFSTATE = modname..":"..basename.."_off" local OFFSTATE = modname..":"..basename.."_off"
local def = def local cdef = table.copy(def)
minetest.register_node(ONSTATE, { minetest.register_node(ONSTATE, {
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
description = def.description, description = cdef.description,
inventory_image = def.inventory_image, inventory_image = cdef.inventory_image,
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
tiles = { tiles = {
TEXPFX.."tp.png", TEXPFX.."tp.png",
...@@ -24,10 +23,10 @@ computer.register = function (name, def) ...@@ -24,10 +23,10 @@ computer.register = function (name, def)
TEXPFX.."bk.png", TEXPFX.."bk.png",
TEXPFX.."ft.png" TEXPFX.."ft.png"
}, },
node_box = def.node_box, node_box = cdef.node_box,
selection_box = def.node_box, selection_box = cdef.node_box,
on_rightclick = function (pos, node, clicker, itemstack) on_rightclick = function (pos, node, clicker, itemstack)
if def.on_turn_off and def.on_turn_off(pos, node, clicker, itemstack) then if cdef.on_turn_off and cdef.on_turn_off(pos, node, clicker, itemstack) then
return itemstack return itemstack
end end
node.name = OFFSTATE node.name = OFFSTATE
...@@ -41,17 +40,17 @@ computer.register = function (name, def) ...@@ -41,17 +40,17 @@ computer.register = function (name, def)
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
tiles = { tiles = {
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"), (TEXPFX.."tp"..(cdef.tiles_off.top and "_off" or "")..".png"),
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"), (TEXPFX.."bt"..(cdef.tiles_off.bottom and "_off" or "")..".png"),
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"), (TEXPFX.."rt"..(cdef.tiles_off.right and "_off" or "")..".png"),
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"), (TEXPFX.."lt"..(cdef.tiles_off.left and "_off" or "")..".png"),
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"), (TEXPFX.."bk"..(cdef.tiles_off.back and "_off" or "")..".png"),
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png") (TEXPFX.."ft"..(cdef.tiles_off.front and "_off" or "")..".png")
}, },
node_box = def.node_box_off or def.node_box, node_box = cdef.node_box_off or cdef.node_box,
selection_box = def.node_box_off or def.node_box, selection_box = cdef.node_box_off or cdef.node_box,
on_rightclick = function (pos, node, clicker, itemstack) on_rightclick = function (pos, node, clicker, itemstack)
if def.on_turn_on and def.on_turn_on(pos, node, clicker, itemstack) then if cdef.on_turn_on and cdef.on_turn_on(pos, node, clicker, itemstack) then
return itemstack return itemstack
end end
node.name = ONSTATE node.name = ONSTATE
...@@ -63,13 +62,10 @@ computer.register = function (name, def) ...@@ -63,13 +62,10 @@ computer.register = function (name, def)
end end
computer.register_handheld = function (name, def) computer.register_handheld = function (name, def)
local nodename = name
if (name:sub(1, 1) == ":") then name = name:sub(2) end if (name:sub(1, 1) == ":") then name = name:sub(2) end
local modname, basename = name:match("^([^:]+):(.*)") local modname, basename = name:match("^([^:]+):(.*)")
local TEXPFX = modname.."_"..basename.."_inv" local TEXPFX = modname.."_"..basename.."_inv"
local ONSTATE = modname..":"..basename local ONSTATE = modname..":"..basename
local OFFSTATE = modname..":"..basename.."_off"
local on_use = def.on_use
minetest.register_craftitem(ONSTATE, { minetest.register_craftitem(ONSTATE, {
description = def.description, description = def.description,
inventory_image = TEXPFX..".png", inventory_image = TEXPFX..".png",
...@@ -79,8 +75,7 @@ end ...@@ -79,8 +75,7 @@ end
computer.pixelnodebox = function (size, boxes) computer.pixelnodebox = function (size, boxes)
local fixed = { } local fixed = { }
local i, box for _, box in ipairs(boxes) do
for i, box in ipairs(boxes) do
local x, y, z, w, h, l = unpack(box) local x, y, z, w, h, l = unpack(box)
fixed[#fixed + 1] = { fixed[#fixed + 1] = {
(x / size) - 0.5, (x / size) - 0.5,
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
-- This file defines some items in order to not have to depend on other mods. -- This file defines some items in order to not have to depend on other mods.
-- Boilerplate to support localized strings if intllib mod is installed. local S = homedecor_i18n.gettext
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
if (not minetest.get_modpath("homedecor")) then if (not minetest.get_modpath("homedecor")) then
......
local S = homedecor_i18n.gettext
local shapes = { local shapes = {
{ { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } }, { { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } },
{ { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} }, { { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} },
{ x = {0, 1, 2, 3}, y = {1, 1, 1, 1} } }, { x = {0, 1, 2, 3}, y = {1, 1, 1, 1} } },
...@@ -35,7 +38,7 @@ local buttons = "button[3,4.5;0.6,0.6;left;<]" ...@@ -35,7 +38,7 @@ local buttons = "button[3,4.5;0.6,0.6;left;<]"
.."button[4.2,5.3;0.6,0.6;drop;V]" .."button[4.2,5.3;0.6,0.6;drop;V]"
.."button[4.8,4.5;0.6,0.6;rotateright;R]" .."button[4.8,4.5;0.6,0.6;rotateright;R]"
.."button[5.4,4.5;0.6,0.6;right;>]" .."button[5.4,4.5;0.6,0.6;right;>]"
.."button[3.5,3;2,2;new;New Game]" .."button[3.5,3;2,2;new;"..minetest.formspec_escape(S("New Game")).."]"
local formsize = "size[5.9,5.7]" local formsize = "size[5.9,5.7]"
local boardx, boardy = 0, 0 local boardx, boardy = 0, 0
...@@ -70,8 +73,8 @@ end ...@@ -70,8 +73,8 @@ end
local function step(pos, fields) local function step(pos, fields)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local t = minetest.deserialize(meta:get_string("tetris")) local t = minetest.deserialize(meta:get_string("tetris"))
local function new_game(pos) local function new_game(p)
local nex = math.random(7) local nex = math.random(7)
t = { t = {
...@@ -81,10 +84,10 @@ local function step(pos, fields) ...@@ -81,10 +84,10 @@ local function step(pos, fields)
score = 0, score = 0,
cur = math.random(7), cur = math.random(7),
nex = nex, nex = nex,
x=4, y=0, rot=1 x=4, y=0, rot=1
} }
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(p)
timer:set(0.3, 0) timer:set(0.3, 0)
end end
...@@ -99,7 +102,7 @@ local function step(pos, fields) ...@@ -99,7 +102,7 @@ local function step(pos, fields)
i*sizey+boardy, semi, i*sizey+boardy, semi,
size, comma, size, semi, size, comma, size, semi,
colors[tile[2]], close } colors[tile[2]], close }
ins = ins + 1 ins = ins + 1
scr[ins] = concat(tmp) scr[ins] = concat(tmp)
end end
...@@ -138,9 +141,9 @@ local function step(pos, fields) ...@@ -138,9 +141,9 @@ local function step(pos, fields)
for i=1,4 do for i=1,4 do
local cx, cy = d.x[i]+x, d.y[i]+y local cx, cy = d.x[i]+x, d.y[i]+y
if cx < 0 or cx > 9 or cy < 0 or cy > 19 then if cx < 0 or cx > 9 or cy < 0 or cy > 19 then
return false return false
end end
for _, tile in pairs(t.board[ cy ] or {}) do for _, tile in pairs(t.board[ cy ] or {}) do
...@@ -157,7 +160,7 @@ local function step(pos, fields) ...@@ -157,7 +160,7 @@ local function step(pos, fields)
end end
local function tick() local function tick()
if stuck() then if stuck() then
if t.y <= 0 then if t.y <= 0 then
return false end return false end
add() add()
...@@ -170,7 +173,7 @@ local function step(pos, fields) ...@@ -170,7 +173,7 @@ local function step(pos, fields)
t.y = t.y + 1 t.y = t.y + 1
end end
return true return true
end end
local function move(dx, dy) local function move(dx, dy)
local newx, newy = t.x+dx, t.y+dy local newx, newy = t.x+dx, t.y+dy
...@@ -225,10 +228,10 @@ local function step(pos, fields) ...@@ -225,10 +228,10 @@ local function step(pos, fields)
end end
if t then if t then
local scr = { formsize, background, local scr = { formsize, background,
t.boardstring, t.previewstring, t.boardstring, t.previewstring,
draw_shape(t.cur, t.x, t.y, t.rot, boardx, boardy), draw_shape(t.cur, t.x, t.y, t.rot, boardx, boardy),
"label[3.8,0.1;Next...]label[3.8,2.7;Score: ", "label[3.8,0.1;Next...]label[3.8,2.7;Score: ",
t.score, close, buttons } t.score, close, buttons }
...@@ -241,7 +244,7 @@ local function step(pos, fields) ...@@ -241,7 +244,7 @@ local function step(pos, fields)
end end
minetest.register_node("computer:tetris_arcade", { minetest.register_node("computer:tetris_arcade", {
description="Tetris Arcade", description=S("Tetris Arcade"),
drawtype = "mesh", drawtype = "mesh",
mesh = "tetris_arcade.obj", mesh = "tetris_arcade.obj",
tiles = {"tetris_arcade.png"}, tiles = {"tetris_arcade.png"},
...@@ -259,7 +262,8 @@ minetest.register_node("computer:tetris_arcade", { ...@@ -259,7 +262,8 @@ minetest.register_node("computer:tetris_arcade", {
}, },
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", formsize.."button[2,2.5;2,2;new;New Game]" meta:set_string("formspec", formsize
.."button[2,2.5;2,2;new;"..minetest.formspec_escape(S("New Game")).."]"
..default.gui_bg..default.gui_bg_img..default.gui_slots) ..default.gui_bg..default.gui_bg_img..default.gui_slots)
end, end,
on_timer = function(pos) on_timer = function(pos)
...@@ -275,7 +279,7 @@ minetest.register_node("computer:tetris_arcade", { ...@@ -275,7 +279,7 @@ minetest.register_node("computer:tetris_arcade", {
return itemstack return itemstack
end end
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player(placer:get_player_name(), "No room for place the Arcade!") minetest.chat_send_player(placer:get_player_name(), S("No room for place the Arcade!"))
return itemstack return itemstack
end end
local dir = placer:get_look_dir() local dir = placer:get_look_dir()
......
computer/textures/computer_hueg_box_bk.png

88 B

computer/textures/computer_hueg_box_bt.png

108 B

computer/textures/computer_hueg_box_ft.png

130 B

computer/textures/computer_hueg_box_lt.png

100 B

computer/textures/computer_hueg_box_rt.png

97 B

computer/textures/computer_hueg_box_tp.png

220 B

default default
homedecor
local S = homedecor_i18n.gettext
screwdriver = screwdriver or {} screwdriver = screwdriver or {}
local function start_smoke(pos, node, clicker, chimney) local function start_smoke(pos, node, clicker, chimney)
...@@ -8,8 +11,8 @@ local function start_smoke(pos, node, clicker, chimney) ...@@ -8,8 +11,8 @@ local function start_smoke(pos, node, clicker, chimney)
if id ~= 0 then if id ~= 0 then
if s_handle then if s_handle then
minetest.after(0, function(s_handle) minetest.after(0, function(handle)
minetest.sound_stop(s_handle) minetest.sound_stop(handle)
end, s_handle) end, s_handle)
end end
minetest.delete_particlespawner(id) minetest.delete_particlespawner(id)
...@@ -30,19 +33,18 @@ local function start_smoke(pos, node, clicker, chimney) ...@@ -30,19 +33,18 @@ local function start_smoke(pos, node, clicker, chimney)
texture = "smoke_particle.png", texture = "smoke_particle.png",
}) })
if chimney == 1 then if chimney == 1 then
s_handle = nil
this_spawner_meta:set_int("smoky", id) this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", nil) this_spawner_meta:set_int("sound", nil)
else else
s_handle = minetest.sound_play("fire_small", { s_handle = minetest.sound_play("fire_small", {
pos = pos, pos = pos,
max_hear_distance = 5, max_hear_distance = 5,
loop = true loop = true
}) })
this_spawner_meta:set_int("smoky", id) this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", s_handle) this_spawner_meta:set_int("sound", s_handle)
end end
return end end
end end
local function stop_smoke(pos) local function stop_smoke(pos)
...@@ -55,8 +57,8 @@ local function stop_smoke(pos) ...@@ -55,8 +57,8 @@ local function stop_smoke(pos)
end end
if s_handle then if s_handle then
minetest.after(0, function(s_handle) minetest.after(0, function(handle)
minetest.sound_stop(s_handle) minetest.sound_stop(handle)
end, s_handle) end, s_handle)
end end
...@@ -65,12 +67,16 @@ local function stop_smoke(pos) ...@@ -65,12 +67,16 @@ local function stop_smoke(pos)
end end
-- FLAME TYPES -- FLAME TYPES
local flame_types = {"fake", "ice"} local flame_types = {
{ "fake", S("Fake fire") },
{ "ice", S("Ice fire") },
}
for _, f in ipairs(flame_types) do for _, f in ipairs(flame_types) do
minetest.register_node("fake_fire:"..f.."_fire", { local name, desc = unpack(f)
inventory_image = f.."_fire_inv.png", minetest.register_node("fake_fire:"..name.."_fire", {
description = f.." fire", inventory_image = name.."_fire_inv.png",
description = desc,
drawtype = "plantlike", drawtype = "plantlike",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
...@@ -81,7 +87,7 @@ for _, f in ipairs(flame_types) do ...@@ -81,7 +87,7 @@ for _, f in ipairs(flame_types) do
light_source = 14, light_source = 14,
waving = 1, waving = 1,
tiles = { tiles = {
{name=f.."_fire_animated.png", animation={type="vertical_frames", {name=name.."_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}}, aspect_w=16, aspect_h=16, length=1.5}},
}, },
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
...@@ -100,7 +106,7 @@ end ...@@ -100,7 +106,7 @@ end
minetest.register_node("fake_fire:fancy_fire", { minetest.register_node("fake_fire:fancy_fire", {
inventory_image = "fancy_fire_inv.png", inventory_image = "fancy_fire_inv.png",
description = "Fancy Fire", description = S("Fancy Fire"),
drawtype = "mesh", drawtype = "mesh",
mesh = "fancy_fire.obj", mesh = "fancy_fire.obj",
paramtype = "light", paramtype = "light",
...@@ -112,7 +118,7 @@ minetest.register_node("fake_fire:fancy_fire", { ...@@ -112,7 +118,7 @@ minetest.register_node("fake_fire:fancy_fire", {
damage_per_second = 4, damage_per_second = 4,
on_rotate = screwdriver.rotate_simple, on_rotate = screwdriver.rotate_simple,
tiles = { tiles = {
{name="fake_fire_animated.png", {name="fake_fire_animated.png",
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}}, animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
start_smoke(pos, node, clicker) start_smoke(pos, node, clicker)
...@@ -137,7 +143,7 @@ minetest.register_node("fake_fire:fancy_fire", { ...@@ -137,7 +143,7 @@ minetest.register_node("fake_fire:fancy_fire", {
-- EMBERS -- EMBERS
minetest.register_node("fake_fire:embers", { minetest.register_node("fake_fire:embers", {
description = "Glowing Embers", description = S("Glowing Embers"),
tiles = { tiles = {
{name="embers_animated.png", animation={type="vertical_frames", {name="embers_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2}}, aspect_w=16, aspect_h=16, length=2}},
...@@ -149,12 +155,16 @@ minetest.register_node("fake_fire:embers", { ...@@ -149,12 +155,16 @@ minetest.register_node("fake_fire:embers", {
}) })
-- CHIMNEYS -- CHIMNEYS
local materials = {"stone", "sandstone"} local materials = {
{ "stone", S("Stone chimney top") },
for _, m in ipairs(materials) do { "sandstone", S("Sandstone chimney top") },
minetest.register_node("fake_fire:chimney_top_"..m, { }
description = "Chimney Top - "..m,
tiles = {"default_"..m..".png^chimney_top.png", "default_"..m..".png"}, for _, mat in ipairs(materials) do
local name, desc = unpack(mat)
minetest.register_node("fake_fire:chimney_top_"..name, {
description = desc,
tiles = {"default_"..name..".png^chimney_top.png", "default_"..name..".png"},
groups = {snappy=3}, groups = {snappy=3},
paramtype = "light", paramtype = "light",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
...@@ -172,17 +182,22 @@ for _, m in ipairs(materials) do ...@@ -172,17 +182,22 @@ for _, m in ipairs(materials) do
stop_smoke(pos) stop_smoke(pos)
end end
}) })
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "stairs:slab_"..name}
})
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = 'fake_fire:chimney_top_'..m, output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "stairs:slab_"..m} recipe = {"default:torch", "moreblocks:slab_"..name}
}) })
end end
-- FLINT and STEEL -- FLINT and STEEL
minetest.register_tool("fake_fire:flint_and_steel", { minetest.register_tool("fake_fire:flint_and_steel", {
description = "Flint and steel", description = S("Flint and steel"),
inventory_image = "flint_and_steel.png", inventory_image = "flint_and_steel.png",
liquids_pointable = false, liquids_pointable = false,
stack_max = 1, stack_max = 1,
...@@ -200,7 +215,7 @@ minetest.register_tool("fake_fire:flint_and_steel", { ...@@ -200,7 +215,7 @@ minetest.register_tool("fake_fire:flint_and_steel", {
minetest.set_node(pointed_thing.above, {name="fake_fire:fake_fire"}) minetest.set_node(pointed_thing.above, {name="fake_fire:fake_fire"})
end end
else else
minetest.chat_send_player(user:get_player_name(), "This area is protected!") minetest.chat_send_player(user:get_player_name(), S("This area is protected!"))
end end
else else
return return
......
local S = homedecor.gettext
local bathroom_tile_colors = {
{ "1", "white/grey", "#c0c0c0:200" },
{ "2", "white/dark grey", "#404040:150" },
{ "3", "white/black", "#000000:200" },
{ "4", "black/dark grey", "" },
{ "red", "white/red", "#d00000:150" },
{ "green", "white/green", "#00d000:150" },
{ "blue", "white/blue", "#0000d0:150" },
{ "yellow", "white/yellow", "#ffff00:150" },
{ "tan", "white/tan", "#ceaf42:150" }
}
for i in ipairs(bathroom_tile_colors) do local S = homedecor_i18n.gettext
local color = bathroom_tile_colors[i][1]
local shade = bathroom_tile_colors[i][2]
local hue = bathroom_tile_colors[i][3]
local coloredtile = "homedecor_bathroom_tiles_bg.png^(homedecor_bathroom_tiles_fg.png^[colorize:"..hue..")" minetest.register_node("homedecor:bathroom_tiles_dark", {
description = S("Bathroom/kitchen tiles (dark)"),
tiles = {
"homedecor_bathroom_tiles_bg.png"
},
overlay_tiles = {
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xff606060 },
},
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
if color == "4" then minetest.register_node("homedecor:bathroom_tiles_medium", {
coloredtile = "(homedecor_bathroom_tiles_bg.png^[colorize:#000000:75)".. description = S("Bathroom/kitchen tiles (medium)"),
"^(homedecor_bathroom_tiles_fg.png^[colorize:#000000:200)" tiles = {
end "homedecor_bathroom_tiles_bg.png"
},
overlay_tiles = {
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffc0c0c0 },
},
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("homedecor:tiles_"..color, { minetest.register_node("homedecor:bathroom_tiles_light", {
description = "Bathroom/kitchen tiles ("..shade..")", description = S("Bathroom/kitchen tiles (light)"),
tiles = { tiles = {
coloredtile, "homedecor_bathroom_tiles_bg.png"
coloredtile, },
coloredtile, overlay_tiles = {
coloredtile, { name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff },
"("..coloredtile..")^[transformR90", },
"("..coloredtile..")^[transformR90" paramtype = "light",
}, paramtype2 = "color",
groups = {cracky=3}, palette = "unifieddyes_palette_extended.png",
paramtype = "light", place_param2 = 240,
sounds = default.node_sound_stone_defaults(), groups = {cracky=3, ud_param2_colorable = 1},
}) sounds = default.node_sound_stone_defaults(),
end on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
local tr_cbox = { local tr_cbox = {
type = "fixed", type = "fixed",
...@@ -46,7 +64,7 @@ local tr_cbox = { ...@@ -46,7 +64,7 @@ local tr_cbox = {
} }
homedecor.register("towel_rod", { homedecor.register("towel_rod", {
description = "Towel rod with towel", description = S("Towel rod with towel"),
mesh = "homedecor_towel_rod.obj", mesh = "homedecor_towel_rod.obj",
tiles = { tiles = {
"homedecor_generic_terrycloth.png", "homedecor_generic_terrycloth.png",
...@@ -60,7 +78,7 @@ homedecor.register("towel_rod", { ...@@ -60,7 +78,7 @@ homedecor.register("towel_rod", {
}) })
homedecor.register("medicine_cabinet", { homedecor.register("medicine_cabinet", {
description = S("Medicine Cabinet"), description = S("Medicine cabinet"),
mesh = "homedecor_medicine_cabinet.obj", mesh = "homedecor_medicine_cabinet.obj",
tiles = { tiles = {
'default_wood.png', 'default_wood.png',
...@@ -104,3 +122,72 @@ homedecor.register("medicine_cabinet_open", { ...@@ -104,3 +122,72 @@ homedecor.register("medicine_cabinet_open", {
end, end,
}) })
-- convert old static nodes
homedecor.old_static_bathroom_tiles = {
"homedecor:tiles_1",
"homedecor:tiles_2",
"homedecor:tiles_3",
"homedecor:tiles_4",
"homedecor:tiles_red",
"homedecor:tiles_tan",
"homedecor:tiles_yellow",
"homedecor:tiles_green",
"homedecor:tiles_blue"
}
local old_to_color = {
"light_grey",
"grey",
"black",
"black"
}
minetest.register_lbm({
name = "homedecor:convert_bathroom_tiles",
label = "Convert bathroom tiles to use param2 color",
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 = string.find(name, "_")
local color = string.sub(name, a + 1)
if color == "tan" then
color = "yellow_s50"
elseif color == "1" or color == "2" or color == "3" or color == "4" then
if color == "4" then
newname = "homedecor:bathroom_tiles_medium"
end
color = old_to_color[tonumber(color)]
elseif color ~= "yellow" then
color = color.."_s50"
end
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = newname, param2 = paletteidx })
local meta = minetest.get_meta(pos)
meta:set_string("dye", "unifieddyes:"..color)
meta:set_string("palette", "ext")
end
})
minetest.register_lbm({
name = "homedecor:recolor_bathroom_tiles",
label = "Convert bathroom tiles to use UD extended palette",
run_at_every_load = false,
nodenames = {
"homedecor:bathroom_tiles_light",
"homedecor:bathroom_tiles_medium",
"homedecor:bathroom_tiles_dark",
},
action = function(pos, node)
local meta = minetest.get_meta(pos)
if meta:get_string("palette") ~= "ext" then
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
meta:set_string("palette", "ext")
end
end
})