2023-03-04 19:29:45 -06:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
|
|
|
local minetest, nodecore
|
|
|
|
= minetest, nodecore
|
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
-- ================================================================== --
|
|
|
|
local potsoil = "nc_tree_humus.png"
|
|
|
|
local ceramic = modname.. "_ceramic.png"
|
2024-09-12 11:55:22 -05:00
|
|
|
local earthen = "nc_concrete_adobe.png"
|
|
|
|
local stonwar = ceramic.. "^[colorize:black:128"
|
|
|
|
local porcela = "nc_concrete_cloudstone.png"
|
2023-03-04 19:29:45 -06:00
|
|
|
-- ================================================================== --
|
2024-09-12 11:55:22 -05:00
|
|
|
local function register_flowerpot(material, desc, texture)
|
2023-03-04 19:29:45 -06:00
|
|
|
------------------------------------------------------------------------
|
2024-09-12 11:55:22 -05:00
|
|
|
local ceraform = texture.. "^[mask:nc_api_storebox_frame.png"
|
|
|
|
local cerasoil = "(" ..potsoil.. ")^(" ..ceraform.. ")"
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
local glaze = modname.. "_glaze.png"
|
|
|
|
local glazpatt = modname.. "_glaze_pattern.png^[opacity:40"
|
|
|
|
local glazform = "nc_api_storebox_frame.png^[opacity:40"
|
|
|
|
local glazcera = "(" ..texture.. ")^(" ..glaze.. ")"
|
|
|
|
local glazside = "(" ..glazcera.. ")^(" ..glazpatt.. ")"
|
|
|
|
local glazetop = "(" ..glazcera.. ")^(" ..glazform.. ")^[mask:nc_api_storebox_frame.png"
|
|
|
|
local glazsoil = "(" ..potsoil.. ")^(" ..glazetop.. ")"
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
minetest.register_node(modname .. ":pottery_" ..material.. "_flowerpot", {
|
|
|
|
description = desc.. " Flowerpot",
|
|
|
|
tiles = {
|
|
|
|
cerasoil,
|
|
|
|
texture,
|
|
|
|
texture
|
|
|
|
},
|
|
|
|
selection_box = nodecore.fixedbox(),
|
|
|
|
collision_box = nodecore.fixedbox(),
|
|
|
|
groups = {
|
|
|
|
soil = 4,
|
|
|
|
cracky = 2,
|
|
|
|
totable = 1,
|
|
|
|
flowerpot = 1,
|
|
|
|
scaling_time = 150
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
sounds = nodecore.sounds("nc_optics_glassy")
|
|
|
|
})
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
minetest.register_node(modname .. ":pottery_" ..material.. "_flowerpot_glazed", {
|
|
|
|
description = "Glazed " ..desc.. " Flowerpot",
|
|
|
|
tiles = {
|
|
|
|
glazsoil,
|
|
|
|
glazcera,
|
|
|
|
glazside
|
|
|
|
},
|
|
|
|
selection_box = nodecore.fixedbox(),
|
|
|
|
collision_box = nodecore.fixedbox(),
|
|
|
|
groups = {
|
|
|
|
soil = 4,
|
|
|
|
cracky = 3,
|
|
|
|
totable = 1,
|
|
|
|
flowerpot = 1,
|
|
|
|
scaling_time = 200,
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
sounds = nodecore.sounds("nc_optics_glassy")
|
|
|
|
})
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
nodecore.register_craft({
|
|
|
|
label = "fill " ..material.. " pot with compost",
|
2023-03-04 19:29:45 -06:00
|
|
|
action = "stackapply",
|
2024-09-12 11:55:22 -05:00
|
|
|
indexkeys = {modname.. ":pottery_" ..material.. "_pot"},
|
2023-03-04 19:29:45 -06:00
|
|
|
wield = {groups = {humus = true}},
|
|
|
|
consumewield = 1,
|
|
|
|
nodes = {
|
|
|
|
{
|
2024-09-12 11:55:22 -05:00
|
|
|
match = {name = modname.. ":pottery_" ..material.. "_pot", empty = true},
|
|
|
|
replace = modname .. ":pottery_" ..material.. "_flowerpot"
|
2023-03-04 19:29:45 -06:00
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
------------------------------------------------------------------------
|
2024-09-12 11:55:22 -05:00
|
|
|
nodecore.register_craft({
|
|
|
|
label = "fill glazed " ..material.. " pot with compost",
|
2023-03-04 19:29:45 -06:00
|
|
|
action = "stackapply",
|
2024-09-12 11:55:22 -05:00
|
|
|
indexkeys = {modname.. ":pottery_" ..material.. "_pot_glazed"},
|
2023-03-04 19:29:45 -06:00
|
|
|
wield = {groups = {humus = true}},
|
|
|
|
consumewield = 1,
|
|
|
|
nodes = {
|
|
|
|
{
|
2024-09-12 11:55:22 -05:00
|
|
|
match = {name = modname.. ":pottery_" ..material.. "_pot_glazed", empty = true},
|
|
|
|
replace = modname .. ":pottery_" ..material.. "_flowerpot_glazed"
|
2023-03-04 19:29:45 -06:00
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
------------------------------------------------------------------------
|
2024-09-12 11:55:22 -05:00
|
|
|
nodecore.register_craft({
|
|
|
|
label = "empty " ..material.. " flowerpot",
|
|
|
|
action = "pummel",
|
|
|
|
indexkeys = {modname.. ":pottery_" ..material.. "_flowerpot"},
|
|
|
|
nodes = {
|
|
|
|
{match = {name = modname.. ":pottery_" ..material.. "_flowerpot"},
|
|
|
|
replace = modname.. ":pottery_" ..material.. "_pot"}
|
|
|
|
},
|
|
|
|
items = {
|
|
|
|
{name = "nc_terrain:dirt_loose", count = 1, scatter = 1},
|
|
|
|
},
|
|
|
|
toolgroups = {crumbly = 2},
|
|
|
|
itemscatter = 1
|
|
|
|
})
|
2023-03-04 19:29:45 -06:00
|
|
|
------------------------------------------------------------------------
|
2024-09-12 11:55:22 -05:00
|
|
|
nodecore.register_craft({
|
|
|
|
label = "empty glazed " ..material.. " flowerpot",
|
|
|
|
action = "pummel",
|
|
|
|
indexkeys = {modname.. ":pottery_" ..material.. "_flowerpot_glazed"},
|
|
|
|
nodes = {
|
|
|
|
{match = {name = modname.. ":pottery_" ..material.. "_flowerpot_glazed"},
|
|
|
|
replace = modname.. ":pottery_" ..material.. "_pot_glazed"}
|
|
|
|
},
|
|
|
|
items = {
|
|
|
|
{name = "nc_terrain:dirt_loose", count = 1, scatter = 1},
|
|
|
|
},
|
|
|
|
toolgroups = {crumbly = 2},
|
|
|
|
itemscatter = 1
|
|
|
|
})
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
end
|
|
|
|
-- ================================================================== --
|
2023-03-04 19:29:45 -06:00
|
|
|
nodecore.register_craft({
|
|
|
|
label = "break ceramic flowerpot apart",
|
|
|
|
action = "pummel",
|
|
|
|
indexkeys = {"group:flowerpot"},
|
|
|
|
nodes = {{match = {groups = {flowerpot = true}}, replace = "nc_tree:humus_loose"}},
|
|
|
|
items = {{name = modname .. ":chip", count = 8, scatter = 5}},
|
|
|
|
toolgroups = {cracky = 3, thumpy = 4},
|
|
|
|
itemscatter = 5
|
|
|
|
})
|
2024-09-12 11:55:22 -05:00
|
|
|
-- ================================================================== --
|
|
|
|
-- <>=====<> Material <>==========<> Description <>=====<> Texture <> --
|
|
|
|
register_flowerpot("clayware", "Clayware", ceramic)
|
|
|
|
register_flowerpot("earthenware", "Earthenware", earthen)
|
|
|
|
register_flowerpot("stoneware", "Stoneware", stonwar)
|
|
|
|
register_flowerpot("porcelain", "Porcelain", porcela)
|