I guess I use this thread to throw in some things I which I made in the past but were too lazy to put them into my own mod.
I start with two purely decorational nodes: a diamond cup and a golden cup.
. = nothing
. = nothing
Code: Select all
local cupnodebox = {
type = "fixed",
fixed = {
{-0.3,-0.5,-0.3,0.3,-0.4,0.3}, -- stand
{-0.1,-0.4,-0.1,0.1,0,0.1}, -- handle
{-0.3,0,-0.3,0.3,0.1,0.3}, -- cup (lower part)
-- the 4 sides of the upper part
{-0.2,0.1,-0.3,0.2,0.5,-0.2},
{-0.2,0.1,0.2,0.2,0.5,0.3},
{-0.3,0.1,-0.3,-0.2,0.5,0.3},
{0.2,0.1,-0.3,0.3,0.5,0.3},
}
}
local cupselbox = {
type = "fixed",
fixed = {
{-0.3,-0.5,-0.3,0.3,-0.4,0.3}, -- stand
{-0.1,-0.4,-0.1,0.1,0,0.1}, -- handle
{-0.3,0,-0.3,0.3,0.5,0.3}, -- upper part
}
}
minetest.register_node("community_mod:cup_gold", {
description = "golden cup",
tiles = { "community_mod_material_gold.png" },
paramtype = "light",
drawtype = "nodebox",
node_box = cupnodebox,
selection_box = cupselbox,
groups = { dig_immediate=3, falling_node=1, bendy=3 }
})
minetest.register_node("community_mod:cup_diamond", {
description = "diamond cup",
tiles = { "community_mod_material_diamond.png" },
paramtype = "light",
drawtype = "nodebox",
node_box = cupnodebox,
selection_box = cupselbox,
groups = { dig_immediate=3, falling_node=1 }
})
if(minetest.get_modpath("default") ~= nil) then
minetest.register_craft({
output = "community_mod:cup_gold 2",
recipe = {
{"default:gold_ingot", "", "default:gold_ingot"},
{"", "default:gold_ingot", ""},
{"", "default:gold_ingot", ""},
}
})
minetest.register_craft({
output = "community_mod:cup_diamond",
recipe = {
{"default:diamond", "", "default:diamond"},
{"", "default:diamond", ""},
{"", "default:diamond", ""},
}
})
end
Texture license: gold and diamond: CC-BY-SA 3.0, originally by Zeg9, modified by me (see attachment).