59 lines
2.0 KiB
Lua
59 lines
2.0 KiB
Lua
PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max, scarcity, count, btype, oconf, bconf)
|
|
local oid = id.."_ore"
|
|
local iid = id.."_"..ifix
|
|
local block_type = btype ~= nil and btype or PyuTestCore.BLOCK_BREAKABLE_LONG
|
|
|
|
minetest.register_node(oid, PyuTestCore.util.tableconcat({
|
|
description = Translate(desc .. " Ore"),
|
|
groups = {block = block_type},
|
|
tiles = {btxt},
|
|
drop = iid .. " " .. tostring(count or 1),
|
|
sounds = PyuTestCore.make_node_sounds(),
|
|
light_source = 3.9, -- Make ores emit little light
|
|
}, oconf or {}))
|
|
|
|
minetest.register_craftitem(iid, {
|
|
description = Translate(desc .. " " .. idfix),
|
|
inventory_image = itxt,
|
|
wield_image = itxt,
|
|
color = color
|
|
})
|
|
|
|
minetest.register_ore({
|
|
ore_type = "scatter",
|
|
ore = oid,
|
|
wherein = "pyutest_core:stone_block",
|
|
clust_scarcity = scarcity * scarcity * scarcity,
|
|
clust_num_ores = 5,
|
|
clust_size = 3,
|
|
y_max = y_max,
|
|
y_min = PyuTestCore_WorldBottom,
|
|
biomes = PyuTestCore.BIOMES,
|
|
})
|
|
|
|
PyuTestCore.make_building_blocks(id, desc, {"metal.png"}, color, {block = block_type}, bconf or {})
|
|
|
|
local bid = id.."_block"
|
|
minetest.register_craft({
|
|
output = bid,
|
|
recipe = {
|
|
{iid, iid},
|
|
{iid, iid}
|
|
}
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = iid .. " 4",
|
|
recipe = {
|
|
bid
|
|
},
|
|
type = "shapeless"
|
|
})
|
|
end
|
|
|
|
PyuTestCore.make_ore("pyutest_core:coal", "Coal", "lump", "Lump", "ore-coal.png", "lump.png", {r = 32, g = 32, b = 32}, 48, 8, 2, PyuTestCore.BLOCK_BREAKABLE_MIDDLE)
|
|
PyuTestCore.make_ore("pyutest_core:iron", "Iron", "ingot", "Ingot", "ore-iron.png", "ingot.png", nil, 21, 13, 1)
|
|
PyuTestCore.make_ore("pyutest_core:gold", "Gold", "ingot", "Ingot", "ore-gold.png", "ingot.png", "gold", -75, 15.5, 1)
|
|
PyuTestCore.make_ore("pyutest_core:diamond", "Diamond", "shard", "Shard", "ore-diamond.png", "shard.png", "cyan", -90, 16.7, 1)
|
|
PyuTestCore.make_ore("pyutest_core:emerald", "Emerald", "shard", "Shard", "ore-emerald.png", "shard.png", "seagreen", -120, 18.3, 1)
|