2018-06-18 07:09:43 +00:00
|
|
|
|
|
|
|
----------------------
|
|
|
|
-- Ground materials --
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
elepd.registered_dusts = {}
|
|
|
|
|
|
|
|
function elepd.register_dust(mat, data)
|
|
|
|
local mod = minetest.get_current_modname()
|
|
|
|
local itemname = mod..":"..mat.."_dust"
|
|
|
|
|
|
|
|
data.item = itemname
|
|
|
|
elepd.registered_dusts[mat] = data
|
|
|
|
|
2018-06-18 11:43:40 +00:00
|
|
|
-- Make descriptions overridable
|
|
|
|
local description = "Pulverized " .. data.description
|
|
|
|
if data.force_description then
|
|
|
|
description = data.description
|
|
|
|
end
|
|
|
|
|
2018-06-18 07:09:43 +00:00
|
|
|
minetest.register_craftitem(itemname, {
|
2018-06-18 11:43:40 +00:00
|
|
|
description = description,
|
2018-06-18 07:09:43 +00:00
|
|
|
inventory_image = "elepower_dust.png^[multiply:" .. data.color,
|
2018-06-18 11:43:40 +00:00
|
|
|
groups = {
|
|
|
|
["dust_" .. mat] = 1,
|
|
|
|
dust = 1
|
|
|
|
}
|
2018-06-18 07:09:43 +00:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Default dust list
|
|
|
|
|
|
|
|
elepd.register_dust("bronze", {
|
|
|
|
description = "Bronze",
|
|
|
|
color = "#fa7b26"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("copper", {
|
|
|
|
description = "Copper",
|
|
|
|
color = "#fcb15f"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("gold", {
|
|
|
|
description = "Gold",
|
|
|
|
color = "#ffff47"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("steel", {
|
|
|
|
description = "Steel",
|
|
|
|
color = "#ffffff"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("tin", {
|
|
|
|
description = "Tin",
|
|
|
|
color = "#c1c1c1"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("mithril", {
|
|
|
|
description = "Mithril",
|
|
|
|
color = "#8686df"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("silver", {
|
|
|
|
description = "Silver",
|
|
|
|
color = "#d7e2e8"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("lead", {
|
|
|
|
description = "Lead",
|
|
|
|
color = "#aeaedc"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("iron", {
|
|
|
|
description = "Iron",
|
|
|
|
color = "#dddddd"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("coal", {
|
|
|
|
description = "Coal",
|
|
|
|
color = "#222222"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("diamond", {
|
|
|
|
description = "Diamond",
|
|
|
|
color = "#02c1e8"
|
|
|
|
})
|
|
|
|
|
|
|
|
elepd.register_dust("energium", {
|
|
|
|
description = "Energium",
|
|
|
|
color = "#ff1111"
|
|
|
|
})
|
2018-06-18 11:43:40 +00:00
|
|
|
|
|
|
|
elepd.register_dust("wood", {
|
|
|
|
description = "Wood Shavings",
|
|
|
|
force_description = true,
|
|
|
|
color = "#847454"
|
|
|
|
})
|