Add more nodes
2
LICENSE
@ -3,6 +3,8 @@
|
|||||||
│ │
|
│ │
|
||||||
│ Code: BSD │
|
│ Code: BSD │
|
||||||
│ Textures: WTFPL (credits: Gambit, kilbith, Cisoun) │
|
│ Textures: WTFPL (credits: Gambit, kilbith, Cisoun) │
|
||||||
|
│ Textures (radio, speaker, hanging candle, rooster) by │
|
||||||
|
gigomaf <bartiko2@poczta.fm> (CC BY-NC 3.0) │
|
||||||
│ Sounds: │
|
│ Sounds: │
|
||||||
│ - xdecor_boiling_water.ogg - by Audionautics - CC BY-SA │
|
│ - xdecor_boiling_water.ogg - by Audionautics - CC BY-SA │
|
||||||
│ freesound.org/people/Audionautics/sounds/133901/ │
|
│ freesound.org/people/Audionautics/sounds/133901/ │
|
||||||
|
@ -143,7 +143,7 @@ xdecor.register("candle", {
|
|||||||
animation = {type="vertical_frames", length = 1.5}
|
animation = {type="vertical_frames", length = 1.5}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "xdecor_candle_floor.png",
|
name = "xdecor_candle_hanging.png",
|
||||||
animation = {type="vertical_frames", length = 1.5}
|
animation = {type="vertical_frames", length = 1.5}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -397,6 +397,15 @@ xdecor.register("ivy", {
|
|||||||
sounds = default.node_sound_leaves_defaults()
|
sounds = default.node_sound_leaves_defaults()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
xdecor.register("rooster", {
|
||||||
|
description = S("Rooster"),
|
||||||
|
drawtype = "torchlike",
|
||||||
|
inventory_image = "xdecor_rooster.png",
|
||||||
|
walkable = false,
|
||||||
|
groups = {snappy = 3, attached_node = 1},
|
||||||
|
tiles = {"xdecor_rooster.png"},
|
||||||
|
})
|
||||||
|
|
||||||
xdecor.register("lantern", {
|
xdecor.register("lantern", {
|
||||||
description = S("Lantern"),
|
description = S("Lantern"),
|
||||||
light_source = 13,
|
light_source = 13,
|
||||||
@ -418,6 +427,7 @@ xdecor.register("lantern", {
|
|||||||
local xdecor_lightbox = {
|
local xdecor_lightbox = {
|
||||||
iron = S("Iron Light Box"),
|
iron = S("Iron Light Box"),
|
||||||
wooden = S("Wooden Light Box"),
|
wooden = S("Wooden Light Box"),
|
||||||
|
wooden2 = S("Wooden Light Box 2"),
|
||||||
}
|
}
|
||||||
|
|
||||||
for l, desc in pairs(xdecor_lightbox) do
|
for l, desc in pairs(xdecor_lightbox) do
|
||||||
@ -609,3 +619,19 @@ xdecor.register("woodframed_glass", {
|
|||||||
groups = {cracky = 2, oddly_breakable_by_hand = 1},
|
groups = {cracky = 2, oddly_breakable_by_hand = 1},
|
||||||
sounds = default.node_sound_glass_defaults()
|
sounds = default.node_sound_glass_defaults()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for _, v in ipairs({"radio", "speaker"}) do
|
||||||
|
xdecor.register(v, {
|
||||||
|
description = v:gsub("^%l", string.upper),
|
||||||
|
on_rotate = screwdriver.rotate_simple,
|
||||||
|
tiles = {
|
||||||
|
"xdecor_" .. v .. "_top.png",
|
||||||
|
"xdecor_" .. v .. "_side.png",
|
||||||
|
"xdecor_" .. v .. "_side.png",
|
||||||
|
"xdecor_" .. v .. "_side.png",
|
||||||
|
"xdecor_" .. v .. "_back.png",
|
||||||
|
"xdecor_" .. v .. "_front.png",
|
||||||
|
},
|
||||||
|
groups = {cracky = 2, not_cuttable = 1},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
@ -180,6 +180,30 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "xdecor:radio",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {"xdecor:speaker", "xdecor:speaker"}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "xdecor:rooster",
|
||||||
|
recipe = {
|
||||||
|
{"default:gold_ingot", "", "default:gold_ingot"},
|
||||||
|
{"", "default:gold_ingot", ""},
|
||||||
|
{"default:gold_ingot", "", "default:gold_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "xdecor:speaker",
|
||||||
|
recipe = {
|
||||||
|
{"default:gold_ingot", "default:copper_ingot", "default:gold_ingot"},
|
||||||
|
{"default:copper_ingot", "", "default:copper_ingot"},
|
||||||
|
{"default:gold_ingot", "default:copper_ingot", "default:gold_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "xdecor:stone_tile 2",
|
output = "xdecor:stone_tile 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -267,3 +291,9 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "xdecor:wooden2_lightbox",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {"xdecor:wooden_lightbox"},
|
||||||
|
})
|
||||||
|
|
||||||
|
@ -1,37 +1,19 @@
|
|||||||
local workbench = {}
|
local workbench = {}
|
||||||
WB = {}
|
local nodes = {}
|
||||||
|
|
||||||
screwdriver = screwdriver or {}
|
screwdriver = screwdriver or {}
|
||||||
local min, ceil = math.min, math.ceil
|
local min, ceil = math.min, math.ceil
|
||||||
local registered_nodes = minetest.registered_nodes
|
|
||||||
local S = minetest.get_translator("xdecor")
|
local S = minetest.get_translator("xdecor")
|
||||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
-- Nodes allowed to be cut
|
-- Nodes allowed to be cut
|
||||||
-- Only the regular, solid blocks without metas or explosivity can be cut
|
-- Only the regular, solid blocks without metas or explosivity can be cut
|
||||||
local nodes = {}
|
for node, def in pairs(minetest.registered_nodes) do
|
||||||
for node, def in pairs(registered_nodes) do
|
|
||||||
if xdecor.stairs_valid_def(def) then
|
if xdecor.stairs_valid_def(def) then
|
||||||
nodes[#nodes + 1] = node
|
nodes[#nodes + 1] = node
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Optionally, you can register custom cuttable nodes in the workbench
|
|
||||||
WB.custom_nodes_register = {
|
|
||||||
-- "default:leaves",
|
|
||||||
}
|
|
||||||
|
|
||||||
setmetatable(nodes, {
|
|
||||||
__concat = function(t1, t2)
|
|
||||||
for i = 1, #t2 do
|
|
||||||
t1[#t1 + 1] = t2[i]
|
|
||||||
end
|
|
||||||
|
|
||||||
return t1
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
nodes = nodes .. WB.custom_nodes_register
|
|
||||||
|
|
||||||
-- Nodeboxes definitions
|
-- Nodeboxes definitions
|
||||||
workbench.defs = {
|
workbench.defs = {
|
||||||
-- Name YieldX YZ WH L
|
-- Name YieldX YZ WH L
|
||||||
@ -187,7 +169,7 @@ function workbench.allow_put(pos, listname, index, stack, player)
|
|||||||
local stackname = stack:get_name()
|
local stackname = stack:get_name()
|
||||||
if (listname == "tool" and stack:get_wear() > 0 and
|
if (listname == "tool" and stack:get_wear() > 0 and
|
||||||
workbench:repairable(stackname)) or
|
workbench:repairable(stackname)) or
|
||||||
(listname == "input" and registered_nodes[stackname .. "_cube"]) or
|
(listname == "input" and minetest.registered_nodes[stackname .. "_cube"]) or
|
||||||
(listname == "hammer" and stackname == "xdecor:hammer") or
|
(listname == "hammer" and stackname == "xdecor:hammer") or
|
||||||
listname == "storage" then
|
listname == "storage" then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
@ -232,7 +214,7 @@ function workbench.on_take(pos, listname, index, stack, player)
|
|||||||
local stackname = stack:get_name()
|
local stackname = stack:get_name()
|
||||||
|
|
||||||
if listname == "input" then
|
if listname == "input" then
|
||||||
if stackname == inputname and registered_nodes[inputname .. "_cube"] then
|
if stackname == inputname and minetest.registered_nodes[inputname .. "_cube"] then
|
||||||
workbench:get_output(inv, input, stackname)
|
workbench:get_output(inv, input, stackname)
|
||||||
else
|
else
|
||||||
inv:set_list("forms", {})
|
inv:set_list("forms", {})
|
||||||
@ -274,12 +256,11 @@ xdecor.register("workbench", {
|
|||||||
allow_metadata_inventory_move = workbench.allow_move
|
allow_metadata_inventory_move = workbench.allow_move
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_on_mods_loaded(function()
|
|
||||||
for _, d in ipairs(workbench.defs) do
|
for _, d in ipairs(workbench.defs) do
|
||||||
for i = 1, #nodes do
|
for i = 1, #nodes do
|
||||||
local node = nodes[i]
|
local node = nodes[i]
|
||||||
local mod_name, item_name = node:match("^(.-):(.*)")
|
local mod_name, item_name = node:match("^(.-):(.*)")
|
||||||
local def = registered_nodes[node]
|
local def = minetest.registered_nodes[node]
|
||||||
|
|
||||||
if item_name and d[3] then
|
if item_name and d[3] then
|
||||||
local groups = {}
|
local groups = {}
|
||||||
@ -303,7 +284,7 @@ minetest.register_on_mods_loaded(function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--TODO: Translation support for Stairs/Slab
|
--TODO: Translation support for Stairs/Slab
|
||||||
if not registered_nodes["stairs:slab_" .. item_name] then
|
if not minetest.registered_nodes["stairs:slab_" .. item_name] then
|
||||||
stairs.register_stair_and_slab(item_name, node,
|
stairs.register_stair_and_slab(item_name, node,
|
||||||
groups, tiles, def.description .. " Stair",
|
groups, tiles, def.description .. " Stair",
|
||||||
def.description .. " Slab", def.sounds)
|
def.description .. " Slab", def.sounds)
|
||||||
@ -336,7 +317,6 @@ minetest.register_on_mods_loaded(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
|
||||||
|
|
||||||
-- Craft items
|
-- Craft items
|
||||||
|
|
||||||
|
BIN
textures/xdecor_candle_hanging.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
textures/xdecor_radio_back.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/xdecor_radio_front.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/xdecor_radio_side.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
textures/xdecor_radio_top.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/xdecor_rooster.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
textures/xdecor_speaker_back.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/xdecor_speaker_front.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/xdecor_speaker_side.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/xdecor_speaker_top.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/xdecor_wooden2_lightbox.png
Normal file
After Width: | Height: | Size: 15 KiB |