Tin is now in Minetest Game (#18)

This commit is contained in:
Thomas--S 2017-05-20 14:40:04 +02:00 committed by Hugo Locurcio
parent 0842b4fec4
commit 73e99e7d66
2 changed files with 52 additions and 35 deletions

View File

@ -10,6 +10,11 @@ Licensed under the zlib license. See LICENSE.md for more information.
moreores = {} moreores = {}
local default_tin = false
if minetest.registered_items["default:tin_ingot"] then
default_tin = true
end
local S local S
if minetest.get_modpath("intllib") then if minetest.get_modpath("intllib") then
S = intllib.Getter() S = intllib.Getter()
@ -266,17 +271,6 @@ local oredefs = {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = 6}, damage_groups = {fleshy = 6},
}, },
tin = {
description = "Tin",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size,
clust_num_ores = moreores.tin_ore_per_chunk,
clust_size = moreores.tin_chunk_size,
y_min = moreores.tin_min_depth,
y_max = moreores.tin_max_depth
},
tools = {},
},
mithril = { mithril = {
description = "Mithril", description = "Mithril",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
@ -311,6 +305,20 @@ local oredefs = {
} }
} }
if not default_tin then
oredefs.tin = {
description = "Tin",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size,
clust_num_ores = moreores.tin_ore_per_chunk,
clust_size = moreores.tin_chunk_size,
y_min = moreores.tin_min_depth,
y_max = moreores.tin_max_depth
},
tools = {},
}
end
for orename,def in pairs(oredefs) do for orename,def in pairs(oredefs) do
add_ore(modname, def.description, orename, def) add_ore(modname, def.description, orename, def)
end end
@ -325,16 +333,23 @@ minetest.register_craft({
} }
}) })
-- Bronze has some special cases, because it is made from copper and tin: if default_tin then
minetest.register_craft( { minetest.register_alias("moreores:mineral_tin", "default:stone_with_tin")
type = "shapeless", minetest.register_alias("moreores:tin_lump", "default:tin_lump")
output = "default:bronze_ingot 3", minetest.register_alias("moreores:tin_ingot", "default:tin_ingot")
recipe = { minetest.register_alias("moreores:tin_block", "default:tinblock")
"moreores:tin_ingot", else
"default:copper_ingot", -- Bronze has some special cases, because it is made from copper and tin:
"default:copper_ingot", minetest.register_craft( {
} type = "shapeless",
}) output = "default:bronze_ingot 3",
recipe = {
"moreores:tin_ingot",
"default:copper_ingot",
"default:copper_ingot",
}
})
end
-- Unique node: -- Unique node:
minetest.register_node("moreores:copper_rail", { minetest.register_node("moreores:copper_rail", {

30
mg.lua
View File

@ -5,20 +5,22 @@ Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information. Licensed under the zlib license. See LICENSE.md for more information.
--]] --]]
mg.register_ore({ if not minetest.registered_items["default:tin_ingot"] then
name = "moreores:mineral_tin", mg.register_ore({
wherein = "default:stone", name = "moreores:mineral_tin",
seeddiff = 8, wherein = "default:stone",
maxvdistance = 10.5, seeddiff = 8,
maxheight = 8, maxvdistance = 10.5,
seglenghtn = 15, maxheight = 8,
seglenghtdev = 6, seglenghtn = 15,
segincln = 0, seglenghtdev = 6,
segincldev = 0.6, segincln = 0,
turnangle = 57, segincldev = 0.6,
forkturnangle = 57, turnangle = 57,
numperblock = 2 forkturnangle = 57,
}) numperblock = 2
})
end
mg.register_ore({ mg.register_ore({
name = "moreores:mineral_silver", name = "moreores:mineral_silver",