tidy candle code, any colour can be dyed

This commit is contained in:
tenplus1 2021-09-28 07:49:00 +01:00
parent 4d60175462
commit cbcb0cd584

View File

@ -139,44 +139,6 @@ minetest.register_craft({
recipe = "ethereal:palmleaves" recipe = "ethereal:palmleaves"
}) })
-- Candle from Wax and String/Cotton
minetest.register_node("ethereal:candle", {
description = S("Candle"),
drawtype = "plantlike",
inventory_image = "ethereal_candle_static.png",
wield_image = "ethereal_candle_static.png",
tiles = {
{
name = "ethereal_candle.png",
animation = {
type="vertical_frames",
aspect_w = 32,
aspect_h = 32,
length = 1.0
}
}
},
paramtype = "light",
light_source = 11,
sunlight_propagates = true,
walkable = false,
groups = {dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
}
})
-- candle recipe
minetest.register_craft({
output = "ethereal:candle 2",
recipe = {
{"farming:string"},
{"ethereal:palm_wax"},
{"ethereal:palm_wax"}
}
})
local function add_candle(col, dcol) local function add_candle(col, dcol)
@ -207,7 +169,7 @@ minetest.register_node("ethereal:candle" .. col, {
light_source = 11, light_source = 11,
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
groups = {dig_immediate = 3, attached_node = 1}, groups = {candle = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -219,7 +181,7 @@ minetest.register_node("ethereal:candle" .. col, {
minetest.register_craft({ minetest.register_craft({
output = "ethereal:candle" .. col, output = "ethereal:candle" .. col,
recipe = { recipe = {
{"ethereal:candle", "dye:" .. rcol}, {"group:candle", "dye:" .. rcol},
} }
}) })
end end
@ -241,6 +203,23 @@ add_candle("red", "Red ")
add_candle("violet", "Violet ") add_candle("violet", "Violet ")
add_candle("yellow", "Yellow ") add_candle("yellow", "Yellow ")
-- white candle recipe
minetest.register_craft({
output = "ethereal:candle",
recipe = {
{"group:candle", "dye:white"}
}
})
-- candle recipe
minetest.register_craft({
output = "ethereal:candle 2",
recipe = {
{"farming:string"},
{"ethereal:palm_wax"},
{"ethereal:palm_wax"}
}
})
-- Wooden Bowl -- Wooden Bowl
minetest.register_craftitem("ethereal:bowl", { minetest.register_craftitem("ethereal:bowl", {