From 26686196383df71e5634ee4c5af479668d83ee7e Mon Sep 17 00:00:00 2001
From: paramat <mat.gregory@virginmedia.com>
Date: Wed, 19 Apr 2017 02:48:00 +0100
Subject: [PATCH] Ores: Add tin ore, lump, ingot and block

Use Calinou's textures from moreores mod.
Craft bronze from tin and copper instead of steel and copper.
Match ore density to the moreores mod but start ore at a depth of
y = -32 to be part of the depth progression of other ores.
---
 mods/default/README.txt                       |   4 ++
 mods/default/crafting.lua                     |  37 +++++++++++++++---
 mods/default/craftitems.lua                   |  10 +++++
 mods/default/mapgen.lua                       |  35 +++++++++++++++++
 mods/default/nodes.lua                        |  22 +++++++++++
 mods/default/textures/default_mineral_tin.png | Bin 0 -> 171 bytes
 mods/default/textures/default_tin_block.png   | Bin 0 -> 274 bytes
 mods/default/textures/default_tin_ingot.png   | Bin 0 -> 198 bytes
 mods/default/textures/default_tin_lump.png    | Bin 0 -> 166 bytes
 9 files changed, 102 insertions(+), 6 deletions(-)
 create mode 100644 mods/default/textures/default_mineral_tin.png
 create mode 100644 mods/default/textures/default_tin_block.png
 create mode 100644 mods/default/textures/default_tin_ingot.png
 create mode 100644 mods/default/textures/default_tin_lump.png

diff --git a/mods/default/README.txt b/mods/default/README.txt
index fc6def98..3c104a00 100644
--- a/mods/default/README.txt
+++ b/mods/default/README.txt
@@ -53,6 +53,10 @@ Calinou (CC BY-SA 3.0):
   default_papyrus.png
   default_mineral_copper.png
   default_glass_detail.png
+  default_mineral_tin.png
+  default_tin_block.png
+  default_tin_ingot.png
+  default_tin_lump.png
 
 MirceaKitsune (CC BY-SA 3.0):
   character.x
diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua
index 721f4132..50ffb1ae 100644
--- a/mods/default/crafting.lua
+++ b/mods/default/crafting.lua
@@ -392,12 +392,6 @@ minetest.register_craft({
 	}
 })
 
-minetest.register_craft({
-	type = "shapeless",
-	output = "default:bronze_ingot",
-	recipe = {"default:steel_ingot", "default:copper_ingot"},
-})
-
 minetest.register_craft({
 	output = 'default:coalblock',
 	recipe = {
@@ -446,6 +440,31 @@ minetest.register_craft({
 	}
 })
 
+minetest.register_craft({
+	output = "default:tinblock",
+	recipe = {
+		{"default:tin_ingot", "default:tin_ingot", "default:tin_ingot"},
+		{"default:tin_ingot", "default:tin_ingot", "default:tin_ingot"},
+		{"default:tin_ingot", "default:tin_ingot", "default:tin_ingot"},
+	}
+})
+
+minetest.register_craft({
+	output = "default:tin_ingot 9",
+	recipe = {
+		{"default:tinblock"},
+	}
+})
+
+minetest.register_craft({
+	output = "default:bronze_ingot 9",
+	recipe = {
+		{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
+		{"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"},
+		{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
+	}
+})
+
 minetest.register_craft({
 	output = 'default:bronzeblock',
 	recipe = {
@@ -849,6 +868,12 @@ minetest.register_craft({
 	recipe = "default:copper_lump",
 })
 
+minetest.register_craft({
+	type = "cooking",
+	output = "default:tin_ingot",
+	recipe = "default:tin_lump",
+})
+
 minetest.register_craft({
 	type = "cooking",
 	output = "default:gold_ingot",
diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua
index a0db6554..0c42fc37 100644
--- a/mods/default/craftitems.lua
+++ b/mods/default/craftitems.lua
@@ -258,6 +258,11 @@ minetest.register_craftitem("default:copper_lump", {
 	inventory_image = "default_copper_lump.png",
 })
 
+minetest.register_craftitem("default:tin_lump", {
+	description = "Tin Lump",
+	inventory_image = "default_tin_lump.png",
+})
+
 minetest.register_craftitem("default:mese_crystal", {
 	description = "Mese Crystal",
 	inventory_image = "default_mese_crystal.png",
@@ -288,6 +293,11 @@ minetest.register_craftitem("default:copper_ingot", {
 	inventory_image = "default_copper_ingot.png",
 })
 
+minetest.register_craftitem("default:tin_ingot", {
+	description = "Tin Ingot",
+	inventory_image = "default_tin_ingot.png",
+})
+
 minetest.register_craftitem("default:bronze_ingot", {
 	description = "Bronze Ingot",
 	inventory_image = "default_bronze_ingot.png",
diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua
index 9e359a33..fff889fa 100644
--- a/mods/default/mapgen.lua
+++ b/mods/default/mapgen.lua
@@ -357,6 +357,41 @@ function default.register_ores()
 		y_max          = -64,
 	})
 
+	-- Tin
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_tin",
+		wherein        = "default:stone",
+		clust_scarcity = 10 * 10 * 10,
+		clust_num_ores = 9,
+		clust_size     = 3,
+		y_min          = 1025,
+		y_max          = 31000,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_tin",
+		wherein        = "default:stone",
+		clust_scarcity = 13 * 13 * 13,
+		clust_num_ores = 7,
+		clust_size     = 3,
+		y_min          = -31000,
+		y_max          = -32,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_tin",
+		wherein        = "default:stone",
+		clust_scarcity = 10 * 10 * 10,
+		clust_num_ores = 9,
+		clust_size     = 3,
+		y_min          = -31000,
+		y_max          = -128,
+	})
+
 	-- Gold
 
 	minetest.register_ore({
diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua
index b7309e12..facb28e0 100644
--- a/mods/default/nodes.lua
+++ b/mods/default/nodes.lua
@@ -107,6 +107,10 @@ default:steelblock
 
 default:stone_with_copper
 default:copperblock
+
+default:stone_with_tin
+default:tinblock
+
 default:bronzeblock
 
 default:stone_with_gold
@@ -1046,6 +1050,24 @@ minetest.register_node("default:copperblock", {
 	sounds = default.node_sound_metal_defaults(),
 })
 
+
+minetest.register_node("default:stone_with_tin", {
+	description = "Tin Ore",
+	tiles = {"default_stone.png^default_mineral_tin.png"},
+	groups = {cracky = 2},
+	drop = "default:tin_lump",
+	sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_node("default:tinblock", {
+	description = "Tin Block",
+	tiles = {"default_tin_block.png"},
+	is_ground_content = false,
+	groups = {cracky = 1, level = 2},
+	sounds = default.node_sound_metal_defaults(),
+})
+
+
 minetest.register_node("default:bronzeblock", {
 	description = "Bronze Block",
 	tiles = {"default_bronze_block.png"},
diff --git a/mods/default/textures/default_mineral_tin.png b/mods/default/textures/default_mineral_tin.png
new file mode 100644
index 0000000000000000000000000000000000000000..232d4b537c1d5e93736577096f23f8d558bb4387
GIT binary patch
literal 171
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX1=6QZow{)0!nuoQjvhaK
z{J^mThxT8;ar4BXlLwC<6JPN=8mNM?B*-tA!Qt7BG$6;?)5S4_<9f0KQxk{UVumSU
z2~3?<Ogm>Z<T7~#FIX^Pl9ET<QI61AfdLJTf@xcJY+~pN<@AsV<7Sa&_<WstM(sJ}
Q6reE-p00i_>zopr04g>;umAu6

literal 0
HcmV?d00001

diff --git a/mods/default/textures/default_tin_block.png b/mods/default/textures/default_tin_block.png
new file mode 100644
index 0000000000000000000000000000000000000000..72759b0456246db5be2a6938ac2a20a356ee006d
GIT binary patch
literal 274
zcmV+t0qy>YP)<h;3K|Lk000e1NJLTq000mG000mO0{{R3C@l|D0000sP)t-sprE0e
znwprHn4h1Ym6es8ot%b-hIn{*iHeDSetx8+ql1HkbaZs2prD<bo}QeVk&%#&j*fI$
z>pB1c0GCNbK~xyiC5;IV#2^d<?VMcgw*UX^CaPtGF+;#UC(oEUPv*=q5DT~#$Q!M|
z0k9U7j@HD$(t^rhIdLj}QUxWjtM;$>so6wUy0y<BMK(qyZ^TuE3{35YdM%2(Bqj|g
zTG>l>5$pl|UfpaXw8q0pr;FLZ#(jC;KVqf83l|Z4hSk<Y;>S*}S$~_@5wT;$j4Y4%
Y112E^EmuPPX#fBK07*qoM6N<$f_89pc>n+a

literal 0
HcmV?d00001

diff --git a/mods/default/textures/default_tin_ingot.png b/mods/default/textures/default_tin_ingot.png
new file mode 100644
index 0000000000000000000000000000000000000000..eed536105bf934d6274d31c28e6e98360f1cc5c1
GIT binary patch
literal 198
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF4e$wZ1=8W+;Rg>MoHc#ws^v?z
zY~HwU@1BbClEn+=B_zb}*uJH%rYa*NZQA7izV7y#*&j9lH87S0`2{mLJiCzw<hXmf
zIEHXsPd>mW!Mb3}ghdQ3VL?or4s5v>!f3EIPAcidff>ad9_G?U9XhA)aV=q$Xz`uq
s%XrCQ>mjvZJ*N_G=|g9PQx5PmT*&2Jw`WP+Dxi@Jp00i_>zopr0IQlvvH$=8

literal 0
HcmV?d00001

diff --git a/mods/default/textures/default_tin_lump.png b/mods/default/textures/default_tin_lump.png
new file mode 100644
index 0000000000000000000000000000000000000000..72bd339bf6247bebfc74f1a4385136509acd557d
GIT binary patch
literal 166
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU1=0%_F5I$Z%gU82=ggV2
zVZ(;QhYue(aNu;f!eXEtV@Z%-FoVOh8)-m}ji-xa2*>qg1wjL8X=e$yl`Gj27=ueo
zT@9RlHA5pAP9%tM1qqcf7)7v5m1RBH<;ue9dVt4G(DBbRW`<B5mQU>8nU4a^VeoYI
Kb6Mw<&;$SvKr+h!

literal 0
HcmV?d00001

-- 
GitLab