From e76f4155d52e7f79fd40e4f9ac0b9321c1ab9706 Mon Sep 17 00:00:00 2001
From: Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net>
Date: Sat, 28 May 2011 02:17:19 +0200
Subject: [PATCH] + sandstone

---
 .hgtags            |   5 -----
 data/sandstone.png | Bin 0 -> 772 bytes
 src/mapnode.cpp    |   8 ++++++++
 src/mapnode.h      |   1 +
 src/materials.cpp  |   1 +
 src/server.cpp     |  16 ++++++++++++++++
 src/tile.cpp       |   1 +
 7 files changed, 27 insertions(+), 5 deletions(-)
 create mode 100644 data/sandstone.png

diff --git a/.hgtags b/.hgtags
index f59575790..95bda33a8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -1,6 +1 @@
 c37bcfd89dd627fdb131ae3f77fcaab02721bf76 working
-69547bd6be420eb40f55524fd2131cbbaa2e0e29 110107195706-exp
-e3c3c8e27bbc8c9b61710517a78944deb1c61696 110211211322
-23880c78e40c50ad54fcd8844510f7a423b37f2a 110212200513
-20c49c98c92a62df457b773c562df41d4167492b 110214175330
-10be2b71f965585af90af96903e83b4ddff52bf9 20110424_0
diff --git a/data/sandstone.png b/data/sandstone.png
new file mode 100644
index 0000000000000000000000000000000000000000..c4759b4d0289346f97ba69c44230d34b409c2a1d
GIT binary patch
literal 772
zcmV+f1N;1mP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00001b5ch_0Itp)
z=>Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1sfMI6;LOBPXGV{mPtfGR4C5{
z!E18bH~;`(OP2f$et=CNWJ^K{G-;>P8}#>{aZl6C<OEGS+nJ_m00Z?qU<*r@rG6jy
ze*a&Zro;2|VHiF<Jd7q6ZQB9`00^ZNQ52b`>3N>(IRF3nVOcihLMV#DDE)GOzgR96
zDKXX{1ZkQ;sD@!ko5u4zP1AxPXifw{MXBn#s%u866e3O%+qP%3SzZ)U%BE??<MB3%
zOv^HKy(nMRe?Nav0GM7~X}Z2yZxlr$ga{!W=ab1qg)m9eARK=C`sldsY<3M1#t;CE
zkQ72HQa4OOh^ngBvl*!g0ALt~PftH*Z*NFlS5*yN&&#vya5xAdT*uKhEQAn3lx1lc
zI)tz&ihjQz$FbwO04VTyJbwK2X}{a^t{acX7-K?6RaIG*<wXHibr1x1x3_1uz1wc9
z;}Kz1eSCb>5F*V<g|H&^<;5i0M#J;-XtSAIPU1L8<HYm4(P(ry9+7Tn^Z89fsc9I|
zX2UwBfNrt4p^V{C$UBzh$=&UHO6fL=gp`o6Hc3+*YgJY8PE4o&Twh(S)@uNP<MgsL
zTP_#7-R^KWoH@N-uLmimwq>qXD_u7XL*GW*G)peVV~p`?wWf@&*Xz5x_pe1+Rh5cV
z#Jg_4j}b<;WpeHU)lsA<53dkHP19P&eBb~5`+4zhxmvx@hQcrm!XWS*=jYQe#uz)D
zo}ZpCFD{i%wu}khA%tAV$@6^BA7ojITGnDsGjx402yEMWdHLn}ZXCxdQu~&lw7kp<
zLQaE0KpQ%JGlh&X!!!`a^@;5Fe_Gz1**!vt>$nIZ+qPTIgD{-W=f3Yp+X$Mb>GYiD
zbmA?~i@dHYP1D-8MHu<MFQpuYA?Lg-%Q%iL%lZp;Nqn((SZQ+r0000<MNUMnLSTZ+
C`dSqL

literal 0
HcmV?d00001

diff --git a/src/mapnode.cpp b/src/mapnode.cpp
index ca36697ef..c006b8222 100644
--- a/src/mapnode.cpp
+++ b/src/mapnode.cpp
@@ -181,6 +181,14 @@ void init_mapnode()
 	f->is_ground_content = true;
 	f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
 	
+	i = CONTENT_SANDSTONE;
+	f = &g_content_features[i];
+	f->setAllTextures("sandstone.png");
+	f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
+	f->param_type = CPT_MINERAL;
+	f->is_ground_content = true;
+	f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1";
+	
 	i = CONTENT_TREE;
 	f = &g_content_features[i];
 	f->setAllTextures("tree.png");
diff --git a/src/mapnode.h b/src/mapnode.h
index 57382aa2b..ad256585f 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -101,6 +101,7 @@ void init_content_inventory_texture_paths();
 #define CONTENT_STEEL 19
 #define CONTENT_GLASS 20
 #define CONTENT_FENCE 21
+#define CONTENT_SANDSTONE 22
 
 /*
 	Content feature list
diff --git a/src/materials.cpp b/src/materials.cpp
index 841f1d655..60c1894bf 100644
--- a/src/materials.cpp
+++ b/src/materials.cpp
@@ -59,6 +59,7 @@ void initializeMaterialProperties()
 	*/
 
 	setStoneLikeDiggingProperties(CONTENT_STONE, 1.0);
+	setStoneLikeDiggingProperties(CONTENT_SANDSTONE, 1.0);
 	setStoneLikeDiggingProperties(CONTENT_MESE, 0.5);
 	setStoneLikeDiggingProperties(CONTENT_COALSTONE, 1.5);
 	setStoneLikeDiggingProperties(CONTENT_FURNACE, 3.0);
diff --git a/src/server.cpp b/src/server.cpp
index 9248e6298..c7b64f413 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -3972,6 +3972,21 @@ void Server::UpdateCrafting(u16 peer_id)
 					found = true;
 				}
 			}
+
+			// Sandstone
+			if(!found)
+			{
+				ItemSpec specs[9];
+				specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
+				specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
+				specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
+				specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
+				if(checkItemCombination(items, specs))
+				{
+					rlist->addItem(new MaterialItem(CONTENT_SANDSTONE, 1));
+					found = true;
+				}
+			}
 		}
 	
 	} // if creative_mode == false
@@ -4060,6 +4075,7 @@ void setCreativeInventory(Player *player)
 		CONTENT_MUD,
 		CONTENT_STONE,
 		CONTENT_SAND,
+		CONTENT_SANDSTONE,
 		CONTENT_TREE,
 		CONTENT_LEAVES,
 		CONTENT_GLASS,
diff --git a/src/tile.cpp b/src/tile.cpp
index dabc1dcf3..8b0c3f2ea 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -506,6 +506,7 @@ void TextureSource::buildMainAtlas()
 	sourcelist.push_back("stone.png");
 	sourcelist.push_back("mud.png");
 	sourcelist.push_back("sand.png");
+	sourcelist.push_back("sandstone.png");
 	sourcelist.push_back("grass.png");
 	sourcelist.push_back("grass_footsteps.png");
 	sourcelist.push_back("tree.png");
-- 
GitLab