2024-06-15 19:35:23 -06:00

36 lines
1.3 KiB
Lua

PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, scarcity, count)
local oid = "pyutest_core:"..id.."_ore"
local iid = "pyutest_core:"..id.."_"..ifix
minetest.register_node(oid, {
description = Translate(desc .. " Ore"),
groups = {block = PyuTestCore.BLOCK_BREAKABLE_LONG},
tiles = {btxt},
drop = iid .. " " .. tostring(count or 1),
sounds = PyuTestCore.make_node_sounds()
})
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, -- I spent 1 hour debugging this just because I mispelled scarcity as scarity :sob:
clust_num_ores = 5,
clust_size = 3,
y_max = 32,
y_min = PyuTestCore_WorldBottom,
biomes = PyuTestCore.BIOMES,
})
end
PyuTestCore.make_ore("coal", "Coal", "lump", "Lump", "ore-coal.png", "lump.png", {r = 32, g = 32, b = 32}, 8, 5)
PyuTestCore.make_ore("iron", "Iron", "ingot", "Ingot", "ore-iron.png", "ingot.png", nil, 8, 4)
PyuTestCore.make_ore("gold", "Gold", "ingot", "Ingot", "ore-gold.png", "ingot.png", "gold", 13.5, 2)