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
modpack. As such, it comes in multiple parts:
This is what I consider to be a fairly feature-filled home decor modpack.
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
most homes (like flower pots, home electronics, brass and wrought-iron
tables, and a bunch of other things).
Dependencies: unifieddyes and a Minetest engine build newer than 2017-01-23.
* A "3d extras" mod, which supplies things that re-define something in
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
Recommends: signs_lib, windmill, moreblocks, unified_inventory.
default
moreblocks?
homedecor_i18n
moreblocks
minetest.get_modpath("darkage")
minetest.get_modpath("moreblocks")
local S = homedecor_i18n.gettext
minetest.register_node("building_blocks:Adobe", {
tiles = {"building_blocks_Adobe.png"},
description = "Adobe",
description = S("Adobe"),
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_stone_defaults(),
......@@ -11,7 +13,7 @@ minetest.register_node("building_blocks:Adobe", {
minetest.register_node("building_blocks:Roofing", {
tiles = {"building_blocks_Roofing.png"},
is_ground_content = true,
description = "Roof block",
description = S("Roof block"),
groups = {snappy=3},
})
minetest.register_craft({
......@@ -131,7 +133,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'building_blocks:tar_base 2',
output = 'building_blocks:tar_base 4',
recipe = {
{"default:coal_lump", "default:gravel"},
{"default:gravel", "default:coal_lump"}
......@@ -139,7 +141,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'building_blocks:tar_base 2',
output = 'building_blocks:tar_base 4',
recipe = {
{"default:gravel", "default:coal_lump"},
{"default:coal_lump", "default:gravel"}
......@@ -153,7 +155,7 @@ minetest.register_craft({
})
minetest.register_node("building_blocks:smoothglass", {
drawtype = "glasslike",
description = "Streak Free Glass",
description = S("Streak Free Glass"),
tiles = {"building_blocks_sglass.png"},
inventory_image = minetest.inventorycube("building_blocks_sglass.png"),
paramtype = "light",
......@@ -175,7 +177,7 @@ minetest.register_node("building_blocks:smoothglass", {
minetest.register_node("building_blocks:grate", {
drawtype = "glasslike",
description = "Grate",
description = S("Grate"),
tiles = {"building_blocks_grate.png"},
inventory_image = minetest.inventorycube("building_blocks_grate.png"),
paramtype = "light",
......@@ -185,7 +187,7 @@ minetest.register_node("building_blocks:grate", {
})
minetest.register_node("building_blocks:Fireplace", {
description = "Fireplace",
description = S("Fireplace"),
tiles = {
"building_blocks_cast_iron.png",
"building_blocks_cast_iron.png",
......@@ -202,7 +204,7 @@ minetest.register_node("building_blocks:Fireplace", {
minetest.register_node("building_blocks:woodglass", {
drawtype = "glasslike",
description = "Wood Framed Glass",
description = S("Wood Framed Glass"),
tiles = {"building_blocks_wglass.png"},
inventory_image = minetest.inventorycube("building_blocks_wglass.png"),
paramtype = "light",
......@@ -213,7 +215,7 @@ minetest.register_node("building_blocks:woodglass", {
})
minetest.register_node("building_blocks:terrycloth_towel", {
drawtype = "raillike",
description = "Terrycloth towel",
description = S("Terrycloth towel"),
tiles = {"building_blocks_towel.png"},
inventory_image = "building_blocks_towel_inv.png",
paramtype = "light",
......@@ -229,7 +231,7 @@ minetest.register_node("building_blocks:terrycloth_towel", {
})
minetest.register_node("building_blocks:Tarmac_spread", {
drawtype = "raillike",
description = "Tarmac Spread",
description = S("Tarmac Spread"),
tiles = {"building_blocks_tar.png"},
inventory_image = "building_blocks_tar_spread_inv.png",
paramtype = "light",
......@@ -246,7 +248,7 @@ minetest.register_node("building_blocks:Tarmac_spread", {
})
minetest.register_node("building_blocks:BWtile", {
drawtype = "raillike",
description = "Chess board tiling",
description = S("Chess board tiling"),
tiles = {"building_blocks_BWtile.png"},
inventory_image = "building_blocks_bwtile_inv.png",
paramtype = "light",
......@@ -262,7 +264,9 @@ minetest.register_node("building_blocks:BWtile", {
})
minetest.register_node("building_blocks:brobble_spread", {
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"},
inventory_image = "building_blocks_brobble_spread_inv.png",
paramtype = "light",
......@@ -278,7 +282,7 @@ minetest.register_node("building_blocks:brobble_spread", {
})
minetest.register_node("building_blocks:gravel_spread", {
drawtype = "raillike",
description = "Gravel Spread",
description = S("Gravel Spread"),
tiles = {"default_gravel.png"},
inventory_image = "building_blocks_gravel_spread_inv.png",
paramtype = "light",
......@@ -299,7 +303,7 @@ minetest.register_node("building_blocks:gravel_spread", {
minetest.register_node("building_blocks:hardwood", {
tiles = {"building_blocks_hardwood.png"},
is_ground_content = true,
description = "Hardwood",
description = S("Hardwood"),
groups = {choppy=1,flammable=1},
sounds = default.node_sound_wood_defaults(),
})
......@@ -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(
"building_blocks",
"tar",
......@@ -341,6 +356,7 @@ if minetest.get_modpath("moreblocks") then
sounds = default.node_sound_stone_defaults(),
}
)
stairsplus:register_all(
"building_blocks",
"grate",
......@@ -448,41 +464,48 @@ else
bb_stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
bb_stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
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",
{choppy=1,flammable=1},
{"building_blocks_hardwood.png"},
"Hardwood stair",
"Hardwood slab"
S("Hardwood stair"),
S("Hardwood slab")
)
bb_stairs.register_stair_and_slab("fakegrass","building_blocks:fakegrass",
{crumbly=3},
{"default_grass.png"},
"Grass stair",
"Grass slab"
S("Grass stair"),
S("Grass slab")
)
bb_stairs.register_stair_and_slab("tar","building_blocks:Tar",
{crumbly=1},
{"building_blocks_tar.png"},
"Tar stair",
"Tar slab"
S("Tar stair"),
S("Tar slab")
)
bb_stairs.register_stair_and_slab("grate","building_blocks:grate",
{cracky=1},
{"building_blocks_grate.png"},
"Grate Stair",
"Grate Slab"
S("Grate Stair"),
S("Grate Slab")
)
bb_stairs.register_stair_and_slab("Adobe", "building_blocks:Adobe",
{crumbly=3},
{"building_blocks_Adobe.png"},
"Adobe stair",
"Adobe slab"
S("Adobe stair"),
S("Adobe slab")
)
bb_stairs.register_stair_and_slab("Roofing", "building_blocks:Roofing",
{snappy=3},
{"building_blocks_Roofing.png"},
"Roofing stair",
"Roofing slab"
S("Roofing stair"),
S("Roofing slab")
)
end
......@@ -495,7 +518,7 @@ minetest.register_craft({
minetest.register_node("building_blocks:fakegrass", {
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,
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({
......@@ -504,13 +527,13 @@ minetest.register_node("building_blocks:fakegrass", {
})
minetest.register_craftitem("building_blocks:sticks", {
description = "Small bundle of sticks",
description = S("Small bundle of sticks"),
image = "building_blocks_sticks.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem("building_blocks:tar_base", {
description = "Tar base",
description = S("Tar base"),
image = "building_blocks_tar_base.png",
})
......@@ -533,7 +556,7 @@ minetest.register_alias("sticks", "building_blocks:sticks")
minetest.register_alias("building_blocks:faggot", "building_blocks:sticks")
minetest.register_node("building_blocks:Tar", {
description = "Tar",
description = S("Tar"),
tiles = {"building_blocks_tar.png"},
is_ground_content = true,
groups = {crumbly=1, tar_block = 1},
......@@ -564,13 +587,13 @@ minetest.register_craft({
})
minetest.register_tool("building_blocks:knife", {
description = "Tar Knife",
description = S("Tar Knife"),
inventory_image = "building_blocks_knife.png",
tool_capabilities = {
max_drop_level=0,
groupcaps={
choppy={times={[2]=7.50, [3]=2.80}, maxwear=0.01, maxlevel=1},
fleshy={times={[2]=5.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}, uses=100, maxlevel=1}
}
},
})
......@@ -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", {
description = "Granite",
description = S("Granite"),
tiles = { "technic_granite.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
})
minetest.register_craft({
output = "technic:granite 9",
......@@ -604,7 +627,7 @@ if not minetest.get_modpath("technic") then
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("technic", "granite", "technic:granite", {
description="Granite",
description=S("Granite"),
groups={cracky=1, not_in_creative_inventory=1},
tiles={"technic_granite.png"},
})
......
default
\ No newline at end of file
default
homedecor
local S = homedecor_i18n.gettext
local chains_sbox = {
type = "fixed",
fixed = { -0.1, -0.625, -0.1, 0.1, 0.5, 0.1 }
......@@ -12,7 +15,7 @@ local topchains_sbox = {
}
minetest.register_node("chains:chain", {
description = "Hanging chain (wrought iron)",
description = S("Hanging chain (wrought iron)"),
drawtype = "mesh",
mesh = "chains.obj",
tiles = {"chains_wrought_iron.png"},
......@@ -26,7 +29,7 @@ minetest.register_node("chains:chain", {
})
minetest.register_node("chains:chain_brass", {
description = "Hanging chain (brass)",
description = S("Hanging chain (brass)"),
drawtype = "mesh",
mesh = "chains.obj",
tiles = {"chains_brass.png"},
......@@ -40,7 +43,7 @@ minetest.register_node("chains:chain_brass", {
})
minetest.register_node("chains:chain_top", {
description = "Hanging chain (ceiling mount, wrought iron)",
description = S("Hanging chain (ceiling mount, wrought iron)"),
drawtype = "mesh",
mesh = "top_chains.obj",
tiles = {"chains_wrought_iron.png"},
......@@ -54,7 +57,7 @@ minetest.register_node("chains:chain_top", {
})
minetest.register_node("chains:chain_top_brass", {
description = "Hanging chain (ceiling mount, brass)",
description = S("Hanging chain (ceiling mount, brass)"),
drawtype = "mesh",
mesh = "top_chains.obj",
tiles = {"chains_brass.png"},
......@@ -68,13 +71,12 @@ minetest.register_node("chains:chain_top_brass", {
})
minetest.register_node("chains:chandelier", {
description = "Chandelier (wrought iron)",
description = S("Chandelier (wrought iron)"),
paramtype = "light",
light_source = default.LIGHT_MAX-2,
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
tiles = {
"chains_wrought_iron.png",
"chains_candle.png",
......@@ -95,13 +97,12 @@ minetest.register_node("chains:chandelier", {
})
minetest.register_node("chains:chandelier_brass", {
description = "Chandelier (brass)",
description = S("Chandelier (brass)"),
paramtype = "light",
light_source = default.LIGHT_MAX-2,
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
tiles = {
"chains_brass.png",
"chains_candle.png",
......
local S = homedecor_i18n.gettext
-- Amiga 500 lookalike
computer.register("computer:shefriendSOO", {
description = "SheFriendSOO",
......@@ -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
local mo_sbox = {
type = "fixed",
......@@ -157,7 +173,7 @@ local mo_sbox = {
}
minetest.register_node("computer:monitor", {
description = "Monitor and keyboard",
description = S("Monitor and keyboard"),
inventory_image = "computer_monitor_inv.png",
drawtype = "mesh",
mesh = "computer_monitor.obj",
......@@ -175,7 +191,6 @@ minetest.register_node("computer:monitor", {
})
minetest.register_node("computer:monitor_on", {
description = "Monitor and keyboard",
drawtype = "mesh",
mesh = "computer_monitor.obj",
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")
--WIFI Router (linksys look-a-like)
minetest.register_node("computer:router", {
description = "WIFI Router",
description = S("WIFI Router"),
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",
{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 = {
--Modern PC Tower
minetest.register_node("computer:tower", {
description = "Computer Tower",
description = S("Computer Tower"),
inventory_image = "computer_tower_inv.png",
drawtype = "mesh",
mesh = "computer_tower.obj",
......@@ -245,7 +260,7 @@ minetest.register_alias("computer:tower_on", "computer:tower")
-- Printer/scaner combo
minetest.register_node("computer:printer", {
description = "Printer Scaner Combo",
description = S("Printer-Scanner Combo"),
inventory_image = "computer_printer_inv.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"},
......@@ -273,7 +288,7 @@ minetest.register_node("computer:printer", {
--Rack Server
minetest.register_node("computer:server", {
drawtype = "nodebox",
description = "Rack Server",
description = S("Rack Server"),
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
......@@ -303,7 +318,8 @@ minetest.register_node("computer:server", {
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
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
end
return minetest.item_place(itemstack, placer, pointed_thing)
......@@ -312,12 +328,11 @@ minetest.register_node("computer:server", {
minetest.register_node("computer:server_on", {
drawtype = "nodebox",
description = "Rack Server",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_r.png',
'computer_server_l.png',
'computer_server_r.png',
'computer_server_bt.png',
'computer_server_f_on.png',
},
......
default
intllib?
homedecor_i18n
......@@ -2,19 +2,18 @@ computer = {}
screwdriver = screwdriver or {}
computer.register = function (name, def)
local nodename = name
if (name:sub(1, 1) == ":") then name = name:sub(2) end
local modname, basename = name:match("^([^:]+):(.*)")
local TEXPFX = modname.."_"..basename.."_"
local ONSTATE = modname..":"..basename
local OFFSTATE = modname..":"..basename.."_off"
local def = def
local cdef = table.copy(def)
minetest.register_node(ONSTATE, {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = def.description,
inventory_image = def.inventory_image,
description = cdef.description,
inventory_image = cdef.inventory_image,
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
tiles = {
TEXPFX.."tp.png",
......@@ -24,10 +23,10 @@ computer.register = function (name, def)
TEXPFX.."bk.png",
TEXPFX.."ft.png"
},
node_box = def.node_box,
selection_box = def.node_box,
node_box = cdef.node_box,
selection_box = cdef.node_box,
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
end
node.name = OFFSTATE
......@@ -41,17 +40,17 @@ computer.register = function (name, def)
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
tiles = {
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png")
(TEXPFX.."tp"..(cdef.tiles_off.top and "_off" or "")..".png"),
(TEXPFX.."bt"..(cdef.tiles_off.bottom and "_off" or "")..".png"),
(TEXPFX.."rt"..(cdef.tiles_off.right and "_off" or "")..".png"),
(TEXPFX.."lt"..(cdef.tiles_off.left and "_off" or "")..".png"),
(TEXPFX.."bk"..(cdef.tiles_off.back and "_off" or "")..".png"),
(TEXPFX.."ft"..(cdef.tiles_off.front and "_off" or "")..".png")
},
node_box = def.node_box_off or def.node_box,
selection_box = def.node_box_off or def.node_box,
node_box = cdef.node_box_off or cdef.node_box,
selection_box = cdef.node_box_off or cdef.node_box,
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
end
node.name = ONSTATE
......@@ -63,13 +62,10 @@ computer.register = function (name, def)
end
computer.register_handheld = function (name, def)
local nodename = name
if (name:sub(1, 1) == ":") then name = name:sub(2) end
local modname, basename = name:match("^([^:]+):(.*)")
local TEXPFX = modname.."_"..basename.."_inv"
local ONSTATE = modname..":"..basename
local OFFSTATE = modname..":"..basename.."_off"
local on_use = def.on_use
minetest.register_craftitem(ONSTATE, {
description = def.description,
inventory_image = TEXPFX..".png",
......@@ -79,8 +75,7 @@ end
computer.pixelnodebox = function (size, boxes)
local fixed = { }
local i, box
for i, box in ipairs(boxes) do
for _, box in ipairs(boxes) do
local x, y, z, w, h, l = unpack(box)
fixed[#fixed + 1] = {
(x / size) - 0.5,
......
......@@ -4,8 +4,7 @@
-- 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 = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local S = homedecor_i18n.gettext
if (not minetest.get_modpath("homedecor")) then
......
local S = homedecor_i18n.gettext
local shapes = {
{ { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } },
{ { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} },
{ 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;<]"
.."button[4.2,5.3;0.6,0.6;drop;V]"
.."button[4.8,4.5;0.6,0.6;rotateright;R]"
.."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 boardx, boardy = 0, 0
......@@ -70,8 +73,8 @@ end
local function step(pos, fields)
local meta = minetest.get_meta(pos)
local t = minetest.deserialize(meta:get_string("tetris"))
local function new_game(pos)
local function new_game(p)
local nex = math.random(7)
t = {
......@@ -81,10 +84,10 @@ local function step(pos, fields)
score = 0,
cur = math.random(7),
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)
end
......@@ -99,7 +102,7 @@ local function step(pos, fields)
i*sizey+boardy, semi,
size, comma, size, semi,
colors[tile[2]], close }
ins = ins + 1
scr[ins] = concat(tmp)
end
......@@ -138,9 +141,9 @@ local function step(pos, fields)
for i=1,4 do
local cx, cy = d.x[i]+x, d.y[i]+y
if cx < 0 or cx > 9 or cy < 0 or cy > 19 then
return false
return false
end
for _, tile in pairs(t.board[ cy ] or {}) do
......@@ -157,7 +160,7 @@ local function step(pos, fields)
end
local function tick()
if stuck() then
if stuck() then
if t.y <= 0 then
return false end
add()
......@@ -170,7 +173,7 @@ local function step(pos, fields)
t.y = t.y + 1
end
return true
end
end
local function move(dx, dy)
local newx, newy = t.x+dx, t.y+dy
......@@ -225,10 +228,10 @@ local function step(pos, fields)
end
if t then
local scr = { formsize, background,
local scr = { formsize, background,
t.boardstring, t.previewstring,
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 }
......@@ -241,7 +244,7 @@ local function step(pos, fields)
end
minetest.register_node("computer:tetris_arcade", {
description="Tetris Arcade",
description=S("Tetris Arcade"),
drawtype = "mesh",
mesh = "tetris_arcade.obj",
tiles = {"tetris_arcade.png"},
......@@ -259,7 +262,8 @@ minetest.register_node("computer:tetris_arcade", {
},
on_construct = function(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)
end,
on_timer = function(pos)
......@@ -275,7 +279,7 @@ minetest.register_node("computer:tetris_arcade", {
return itemstack
end
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
end
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
homedecor
local S = homedecor_i18n.gettext
screwdriver = screwdriver or {}
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 s_handle then
minetest.after(0, function(s_handle)
minetest.sound_stop(s_handle)
minetest.after(0, function(handle)
minetest.sound_stop(handle)
end, s_handle)
end
minetest.delete_particlespawner(id)
......@@ -30,19 +33,18 @@ local function start_smoke(pos, node, clicker, chimney)
texture = "smoke_particle.png",
})
if chimney == 1 then
s_handle = nil
this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", nil)
else
s_handle = minetest.sound_play("fire_small", {
pos = pos,
max_hear_distance = 5,
loop = true
})
this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", s_handle)
s_handle = minetest.sound_play("fire_small", {
pos = pos,
max_hear_distance = 5,
loop = true
})
this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", s_handle)
end
return end
end
end
local function stop_smoke(pos)
......@@ -55,8 +57,8 @@ local function stop_smoke(pos)
end
if s_handle then
minetest.after(0, function(s_handle)
minetest.sound_stop(s_handle)
minetest.after(0, function(handle)
minetest.sound_stop(handle)
end, s_handle)
end
......@@ -65,12 +67,16 @@ local function stop_smoke(pos)
end
-- 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
minetest.register_node("fake_fire:"..f.."_fire", {
inventory_image = f.."_fire_inv.png",
description = f.." fire",
local name, desc = unpack(f)
minetest.register_node("fake_fire:"..name.."_fire", {
inventory_image = name.."_fire_inv.png",
description = desc,
drawtype = "plantlike",
paramtype = "light",
paramtype2 = "facedir",
......@@ -81,7 +87,7 @@ for _, f in ipairs(flame_types) do
light_source = 14,
waving = 1,
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}},
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
......@@ -100,7 +106,7 @@ end
minetest.register_node("fake_fire:fancy_fire", {
inventory_image = "fancy_fire_inv.png",
description = "Fancy Fire",
description = S("Fancy Fire"),
drawtype = "mesh",
mesh = "fancy_fire.obj",
paramtype = "light",
......@@ -112,7 +118,7 @@ minetest.register_node("fake_fire:fancy_fire", {
damage_per_second = 4,
on_rotate = screwdriver.rotate_simple,
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'}},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
start_smoke(pos, node, clicker)
......@@ -137,7 +143,7 @@ minetest.register_node("fake_fire:fancy_fire", {
-- EMBERS
minetest.register_node("fake_fire:embers", {
description = "Glowing Embers",
description = S("Glowing Embers"),
tiles = {
{name="embers_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2}},
......@@ -149,12 +155,16 @@ minetest.register_node("fake_fire:embers", {
})
-- CHIMNEYS
local materials = {"stone", "sandstone"}
for _, m in ipairs(materials) do
minetest.register_node("fake_fire:chimney_top_"..m, {
description = "Chimney Top - "..m,
tiles = {"default_"..m..".png^chimney_top.png", "default_"..m..".png"},
local materials = {
{ "stone", S("Stone chimney top") },
{ "sandstone", S("Sandstone chimney top") },
}
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},
paramtype = "light",
sounds = default.node_sound_stone_defaults(),
......@@ -172,17 +182,22 @@ for _, m in ipairs(materials) do
stop_smoke(pos)
end
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "stairs:slab_"..name}
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:chimney_top_'..m,
recipe = {"default:torch", "stairs:slab_"..m}
output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "moreblocks:slab_"..name}
})
end
-- 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",
liquids_pointable = false,
stack_max = 1,
......@@ -200,7 +215,7 @@ minetest.register_tool("fake_fire:flint_and_steel", {
minetest.set_node(pointed_thing.above, {name="fake_fire:fake_fire"})
end
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
else
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 color = bathroom_tile_colors[i][1]
local shade = bathroom_tile_colors[i][2]
local hue = bathroom_tile_colors[i][3]
local S = homedecor_i18n.gettext
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
coloredtile = "(homedecor_bathroom_tiles_bg.png^[colorize:#000000:75)"..
"^(homedecor_bathroom_tiles_fg.png^[colorize:#000000:200)"
end
minetest.register_node("homedecor:bathroom_tiles_medium", {
description = S("Bathroom/kitchen tiles (medium)"),
tiles = {
"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, {
description = "Bathroom/kitchen tiles ("..shade..")",
tiles = {
coloredtile,
coloredtile,
coloredtile,
coloredtile,
"("..coloredtile..")^[transformR90",
"("..coloredtile..")^[transformR90"
},
groups = {cracky=3},
paramtype = "light",
sounds = default.node_sound_stone_defaults(),
})
end
minetest.register_node("homedecor:bathroom_tiles_light", {
description = S("Bathroom/kitchen tiles (light)"),
tiles = {
"homedecor_bathroom_tiles_bg.png"
},
overlay_tiles = {
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff },
},
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
})
local tr_cbox = {
type = "fixed",
......@@ -46,7 +64,7 @@ local tr_cbox = {
}
homedecor.register("towel_rod", {
description = "Towel rod with towel",
description = S("Towel rod with towel"),
mesh = "homedecor_towel_rod.obj",
tiles = {
"homedecor_generic_terrycloth.png",
......@@ -60,7 +78,7 @@ homedecor.register("towel_rod", {
})
homedecor.register("medicine_cabinet", {
description = S("Medicine Cabinet"),
description = S("Medicine cabinet"),
mesh = "homedecor_medicine_cabinet.obj",
tiles = {
'default_wood.png',
......@@ -104,3 +122,72 @@ homedecor.register("medicine_cabinet_open", {
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
})