Add sulfur ore and update crafts in technic mod
parent
9ce47271ac
commit
de99bffce7
|
@ -65,11 +65,6 @@ minetest.register_craftitem("base:lead_lump", {
|
|||
inventory_image = "base_lead_lump.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("base:sulfur_lump", {
|
||||
description = "Sulfur Lump",
|
||||
inventory_image = "base_sulfur_lump.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("base:silver_lump", {
|
||||
description = "Silver Lump",
|
||||
inventory_image = "base_silver_lump.png",
|
||||
|
|
|
@ -705,14 +705,6 @@ minetest.register_node("base:leadblock", {
|
|||
sounds = base.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("base:stone_with_sulfur", {
|
||||
description = "Sulfur Ore",
|
||||
tiles = {"base_stone.png^base_mineral_sulfur.png" },
|
||||
groups = {cracky = 3},
|
||||
drop = "base:sulfur_lump",
|
||||
sounds = base.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("base:stone_with_silver", {
|
||||
description = "Silver Ore",
|
||||
tiles = {"base_stone.png^base_mineral_silver.png" },
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 237 B |
Binary file not shown.
Before Width: | Height: | Size: 172 B |
|
@ -196,3 +196,76 @@ minetest.register_craft({
|
|||
"group:sand",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craftitem("technic:brass_ingot", {
|
||||
description = "Brass Ingot",
|
||||
inventory_image = "technic_brass_ingot.png",
|
||||
})
|
||||
|
||||
minetest.register_alias("technic:wrought_iron_ingot", "base:steel_ingot")
|
||||
|
||||
minetest.override_item("base:steel_ingot", {
|
||||
description = "Wrought Iron Ingot",
|
||||
inventory_image = "technic_wrought_iron_ingot.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:cast_iron_ingot", {
|
||||
description = "Cast Iron Ingot",
|
||||
inventory_image = "technic_cast_iron_ingot.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:carbon_steel_ingot", {
|
||||
description = "Carbon Steel Ingot",
|
||||
inventory_image = "technic_carbon_steel_ingot.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:stainless_steel_ingot", {
|
||||
description = "Stainless Steel Ingot",
|
||||
inventory_image = "technic_stainless_steel_ingot.png",
|
||||
})
|
||||
|
||||
local function register_block(block, ingot)
|
||||
minetest.register_craft({
|
||||
output = block,
|
||||
recipe = {
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = ingot.." 9",
|
||||
recipe = {
|
||||
{block}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
register_block("technic:brass_block", "technic:brass_ingot")
|
||||
register_block("technic:cast_iron_block", "technic:cast_iron_ingot")
|
||||
register_block("technic:carbon_steel_block", "technic:carbon_steel_ingot")
|
||||
register_block("technic:stainless_steel_block", "technic:stainless_steel_ingot")
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
recipe = minetest.registered_aliases["technic:wrought_iron_ingot"],
|
||||
output = "technic:cast_iron_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
recipe = "technic:cast_iron_ingot",
|
||||
cooktime = 2,
|
||||
output = "technic:wrought_iron_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
recipe = "technic:carbon_steel_ingot",
|
||||
cooktime = 2,
|
||||
output = "technic:wrought_iron_ingot",
|
||||
})
|
||||
|
||||
|
|
|
@ -59,6 +59,24 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
|
||||
--[[
|
||||
Sulfur
|
||||
--]]
|
||||
|
||||
minetest.register_node("technic:stone_with_sulfur", {
|
||||
description = "Sulfur Ore",
|
||||
tiles = {"base_stone.png^technic_mineral_sulfur.png" },
|
||||
groups = {cracky=3},
|
||||
drop = "technic:sulfur_lump",
|
||||
sounds = base.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:sulfur_lump", {
|
||||
description = "Sulfur Lump",
|
||||
inventory_image = "technic_sulfur_lump.png",
|
||||
})
|
||||
|
||||
|
||||
--[[
|
||||
Uranium
|
||||
--]]
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
biome_lib
|
||||
base
|
||||
technic
|
||||
|
|
|
@ -182,6 +182,51 @@ minetest.register_ore({
|
|||
y_max = 31000,
|
||||
})
|
||||
|
||||
-- Sulfur
|
||||
local sulfur_buf = {}
|
||||
local sulfur_noise= nil
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local a = VoxelArea:new{
|
||||
MinEdge = {x = emin.x, y = emin.y, z = emin.z},
|
||||
MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
|
||||
}
|
||||
local data = vm:get_data(sulfur_buf)
|
||||
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
|
||||
sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100)
|
||||
|
||||
local c_lava = minetest.get_content_id("base:lava_source")
|
||||
local c_lava_flowing = minetest.get_content_id("base:lava_flowing")
|
||||
local c_stone = minetest.get_content_id("base:stone")
|
||||
local c_sulfur = minetest.get_content_id("technic:stone_with_sulfur")
|
||||
|
||||
local grid_size = 5
|
||||
for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
|
||||
for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
|
||||
for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
|
||||
local c = data[a:index(x, y, z)]
|
||||
if (c == c_lava or c == c_lava_flowing) and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then
|
||||
for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
|
||||
for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
|
||||
for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
|
||||
local i = a:index(xx, yy, zz)
|
||||
if data[i] == c_stone and pr:next(1, 10) <= 7 then
|
||||
data[i] = c_sulfur
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
vm:write_to_map(data)
|
||||
end)
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
Trees
|
||||
|
|
Loading…
Reference in New Issue