From 4c0a057ac41e86ec32b0641e468aeb9062e316dc Mon Sep 17 00:00:00 2001 From: darkrose Date: Sat, 20 Sep 2014 02:36:05 +1000 Subject: [PATCH] add home flags --- data/textures/flag.png | Bin 0 -> 313 bytes data/textures/flag_black.png | Bin 0 -> 309 bytes data/textures/flag_black_end.png | Bin 0 -> 276 bytes data/textures/flag_blue.png | Bin 0 -> 302 bytes data/textures/flag_blue_end.png | Bin 0 -> 277 bytes data/textures/flag_end.png | Bin 0 -> 276 bytes data/textures/flag_green.png | Bin 0 -> 311 bytes data/textures/flag_green_end.png | Bin 0 -> 276 bytes data/textures/flag_orange.png | Bin 0 -> 315 bytes data/textures/flag_orange_end.png | Bin 0 -> 274 bytes data/textures/flag_post.png | Bin 0 -> 260 bytes data/textures/flag_purple.png | Bin 0 -> 318 bytes data/textures/flag_purple_end.png | Bin 0 -> 279 bytes data/textures/flag_red.png | Bin 0 -> 303 bytes data/textures/flag_red_end.png | Bin 0 -> 276 bytes data/textures/flag_yellow.png | Bin 0 -> 310 bytes data/textures/flag_yellow_end.png | Bin 0 -> 276 bytes src/CMakeLists.txt | 2 + src/content_mapnode.cpp | 2380 ----------------------------- src/content_mapnode.h | 10 + src/content_mapnode_plants.cpp | 907 +++++++++++ src/content_mapnode_special.cpp | 1788 ++++++++++++++++++++++ src/content_nodebox.cpp | 10 + src/content_nodebox.h | 1 + src/content_nodemeta.cpp | 36 + src/content_nodemeta.h | 19 + src/game.cpp | 4 +- src/mapnode.cpp | 5 + src/mapnode.h | 5 + src/player.cpp | 24 +- src/player.h | 6 + src/server.cpp | 24 +- 32 files changed, 2836 insertions(+), 2385 deletions(-) create mode 100644 data/textures/flag.png create mode 100644 data/textures/flag_black.png create mode 100644 data/textures/flag_black_end.png create mode 100644 data/textures/flag_blue.png create mode 100644 data/textures/flag_blue_end.png create mode 100644 data/textures/flag_end.png create mode 100644 data/textures/flag_green.png create mode 100644 data/textures/flag_green_end.png create mode 100644 data/textures/flag_orange.png create mode 100644 data/textures/flag_orange_end.png create mode 100644 data/textures/flag_post.png create mode 100644 data/textures/flag_purple.png create mode 100644 data/textures/flag_purple_end.png create mode 100644 data/textures/flag_red.png create mode 100644 data/textures/flag_red_end.png create mode 100644 data/textures/flag_yellow.png create mode 100644 data/textures/flag_yellow_end.png create mode 100644 src/content_mapnode_plants.cpp create mode 100644 src/content_mapnode_special.cpp diff --git a/data/textures/flag.png b/data/textures/flag.png new file mode 100644 index 0000000000000000000000000000000000000000..07ff5489fb1ff8e8e8218e3f21228cd18ba64b68 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*bMDMQE4AC!SYr#)R9Lo80uopd{p*^tMz|B0`egX9($ zc&IV?!_ZY#o+1c=d#Wz Gp$PyW&Usn@ literal 0 HcmV?d00001 diff --git a/data/textures/flag_black.png b/data/textures/flag_black.png new file mode 100644 index 0000000000000000000000000000000000000000..81c8b6615f7ee2c59de45e45737718f74e3e4b9c GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(R+)P|ZmmF}#Ar`0SPC6-g$biRn{u76YT?^EI zEfBo5Kzr7MBMB;n3BGS;9(j>+_Jw`+Po^U;Hz<22Ek5_JVwtK{!<%DgTjSPfbab4L zc6r6H+2>nJyZEE{ix%tw4878wJ-fw^zUMpklObXH@`#;b&t@NxQ5`(9!pUXO@geCx( CjCC&n literal 0 HcmV?d00001 diff --git a/data/textures/flag_black_end.png b/data/textures/flag_black_end.png new file mode 100644 index 0000000000000000000000000000000000000000..c99dae7620a94b997da960134ea371c2318c462f GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(9{%ovJwiaCWu7jMAr_~XUfRoh$brY<;q%>p7?V>} ztIQmd_*Kjnq-xA);(D4iTPZ|C=|o}iB;DGhFFSWz#}`|F6*-wRd857k57W%NNFU3X zcP|#`oYh$n#jqjCP~oQmqZrGVNW0_VJPRhjTw7*%AT?^a)$xXH*$gM99%1m5UUyv1 zoWE|7_NxcGctSqQ_K2)D*eEffMq%>Bi;rbz+}y>NwRNiOj^oxDw|x9Qg|p``RCZ<0 Ty76i;(8Ua%u6{1-oD!M`sfJx*Z(HY3gN5}iPy1D-C9Ar_~XPC8iVWGLW#f1Q2Jq$v|; zU1IOOz!n01RHtC#JDBk^VS=7VJN6)7n=TK`{^*|$eTSmZ} ztogZ(9bTc1D~}c2vz*Ur(=Wmm)O{!V{{x1N>pc!xmc(V<<&kNax{>4Hm#Yh();5~7 z`_u&HwXJ)bX5U=7RmCJ&E&I-&Bl`sfJx*Z(ZuV2J7Ci?FE%$VB46!)9^wM75Lk>I+51;S;!htqx?nkxeIwrM)GDmBTNtKYm7K4;#J-JeajU!JBkv()I@bN2mezPjC- z?WbkmPTe_^C4`$HOovV7z59Wt2D{VGe{?aH811{N#EHhJ=&s|Tg$$GEa* T9@NSNI+?-K)z4*}Q$iB}&BSOs literal 0 HcmV?d00001 diff --git a/data/textures/flag_end.png b/data/textures/flag_end.png new file mode 100644 index 0000000000000000000000000000000000000000..de0cf0db94726b90fe768c3a4c531a5cb55771b0 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*bMHZi6?2~nWXGEW!B5R21GFYV<$Ue!Mu@4)mm}c0;iofmT`!7aTMK|lj0p;SoP@Lx$AfQqPtSAoxCw${?9CvtvbtO z^vbt{KT8t|&}E3&C^2D=JR>*LFP-_1wb?G5{1G-=;(^h+;JL{Tw@n$IcqKI~5xxGH z&z!$*k@l+xR{SBCWqCwa8-TQ_Pri8YvFwbSoA|P}w#x1}Zk=(<$L~`(d;aWmuI%1v SlV<^4%;4$j=d#Wzp$Pz=>tt{M literal 0 HcmV?d00001 diff --git a/data/textures/flag_green.png b/data/textures/flag_green.png new file mode 100644 index 0000000000000000000000000000000000000000..8db6377763720b7b1e6ad8fe7c0eddc6747c52f5 GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(4wi~@3+4fZPI|gHhFF|lI?1t!$&iO7dQ+n3r|v%~ z?_)k6y;Ip3e@MN^D^aDeVO7ql-5c60BSU9xG?7{;aKGJumCC)VKX1vubYxqRHz!8o z$gRG@PkP);X;WWu^5>s?>c^|maIDki=-u1T3K!1fx^aH$nm_0Ct@NrFFuZB$wS3b5 zbKNHg1s6r8yG#Brd3i4NUNeuun{6}rm*~7bpS@1uS6jD`T2KS zYfrbmdcj%8L+AbquQ|=Q{#iqM(FNrVvO=Cq&mQE8VVEEu8FiBDEXbb>p00i_>zopr E0PEa+K>z>% literal 0 HcmV?d00001 diff --git a/data/textures/flag_green_end.png b/data/textures/flag_green_end.png new file mode 100644 index 0000000000000000000000000000000000000000..42a093b45e4f76cf3ee186445f33af9a7354ddbb GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(P7A+XZzF(0%RF5iLo7}&y|kD2kOPmy!{@vIFeazS zYgMHs@TV9batwRpeyO_T6vKujLxrCPjAATbBJGZc^DLPBa&4L6fz+twR>vE*Wiyx Tw{iw6(8Ua%u6{1-oD!M`sfJx*Z(b|LO2PM`?GSx*N%xg0 zSsD#tE3|w+95j&d{K=5^vC4S2Tl}@2cN^uxll*1Q-xu+$S@n5x{mV|q1v?5$6}uhR zaX&HGm;9gqz?uM?hYx#ygqoaX6mfX$wdlb+-;bM{GvgTFl!$9jziGLA5!(U38#4}n zFpV}buV&>4>~Jt&DYW;T&Dqte&+dwS_K{lhv+}B_i+w@hp~b8J7Ir2^I7D2K=9j;t zVfWzCd&YNm9yiwRZw|GKVA1)RAZYNsS?_?E`XsN%&88pO4GPox&BVQKfqdra>gTe~ HDWM4fKp1zh literal 0 HcmV?d00001 diff --git a/data/textures/flag_orange_end.png b/data/textures/flag_orange_end.png new file mode 100644 index 0000000000000000000000000000000000000000..845133cf4cd0678de1d1ffb55f08f1152783cff2 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(F8yaN)-gb#C7v#hAr_~XUfRoh$brY<;q%>p4oO6I z&XT>+EUO{Owah_8L;SYLLMK7TzS)y=UTXXK-?{s9*6Yj#9%<8i4*xv2-qZVZ(y5L6 z7cSmp*4>cBc%bWO!;{B65ds(7f6BxgHuyc;e(N~H^vb!fWSDQQV^jziVpjPYGmkk> z?vG3Om4l_SE2de`&`sfJx*bM7Sl=hxt{`srg^$JhFF}wJLw=VlOYew@v=Ud05;u= z9JLqNeFItbODu1T9B^FnA$h-c@0+V0X=?FByXRyi$(UHgzt68-I9cqRkdx^BH@g|W zyKyTU9b=fq-6pv4@5(a$3KJ!!r`sfJx*Z(c7uD5Je~lBE_k{)hFF}QJLz=pVFR8v`yjtL+kQWp z7rCoJoO1%>CU3vU70Z>lPRf1SqIw{#Qi$>2{2xD3ABfz3I9sRFzx3R1W!;O6Ddu{5 zUy@u8Hs1YgTd<1xjL}VDxwww|u9syT7)|t4jNZkG*jvqbrrhxN&XH63rRP?zVAvoS z_UuA!Xm{4;eg;J@!53P+F7J)~KVKC3eOBu8yepm`KQGemsC%%e#Xb1#ze>L zJGBL>)$QH?`3pWf9$NQSR_D_}orH7jn;T~F&tiCOH!*}uUZ>OEs4aEXzDXx@fPQ1} MboFyt=akR{0PO61-~a#s literal 0 HcmV?d00001 diff --git a/data/textures/flag_purple_end.png b/data/textures/flag_purple_end.png new file mode 100644 index 0000000000000000000000000000000000000000..244488530638d824adff644af382b0c595a89eaf GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(E{V9G^MZjwD?MEtLo7}&y|kD2kOPmy!{@vIFeYCx z=2Z?*-pDRw%Wc5NZNMse>ZqCPiU5}hkDsYT|LVFdTwcEKS=p^1mCb&~{{4AyeaXsH z!>4sS7wt7NpWKkec%bWO!;`-p5ds&|f6BxgHuxRee(MOs^uoEXWSDQQV^jziVpdsu zLzaI>`sfJx*Z(Hu)S4mp?$EgPtyqAr_~XPP$mgWGLW#e;t3HN^C$d z*FwQp3$$iE&~A>*ty4H4(Pw@cn{`% z`{|>wC@3^wmE^h3&+{9ePjqrT)%GW6?*Ya~0TWw3fBrDnY+@tx1|u;=iG6aDK23F) z<*c?(quhCWS+Q1g;Z_xsAhzthd0)Ao$)A`LQg(BH+YCpQ6qUUe-ygVKZSZ-|8B-;& vypDZy)q(oz1J<@Lgd+M{A6@&Bz*ooU${wvO(rge1^bCWitDnm{r-UW|MILfo literal 0 HcmV?d00001 diff --git a/data/textures/flag_red_end.png b/data/textures/flag_red_end.png new file mode 100644 index 0000000000000000000000000000000000000000..d01b73be3d25759fdf59af589b2f773a7e0b39a5 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(ZW)LEY;K^?GEW!B5R21GFYV<$n>QZ!~XaXn3%trVi6bfU0$l5XwMmz}$<p9H zyB7;|&gv|PV%U&msPNN(QHkQ%kz>UhJpY=#q4k1%*juRAVh z&R@4k`_+S8JRzTDdqh?nY?PQ#qcHj6#mBNUZtmjC+B#Ks$8qb7TRwiD!rAlZ$GEcd T&2#(=bTNactDnm{r-UW|BF|y} literal 0 HcmV?d00001 diff --git a/data/textures/flag_yellow.png b/data/textures/flag_yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..8970b209ad8b9b18966781ab8f5bbba9bcb69038 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(Hs1LYO}7ArPI$UFhFF}QJL#n0Ap;)Q`A-}ob}dko zTFC!vf!3@CM~+N9!YJV(qh@FoY5ePa)IJx1>6aUII_Fv)|2%b82E!)lx!h|b0u?@0 zy8mIAk-ACUW{*I9_c6-`ri>C5qjzy4`>iFOGdJ9wm-N)m@_9rE!wnAY;*4*TU4u9C zGbnNizR==zxo_P6`JmA4vr?a@UGez%d69NUUSZ&&#jF0F7dpJ5VZ#EmIJ*}o?>%_* zpK+d@M@0PngG%yen4Z-baL@SUD4K9rZIai+X4Q`j-u@ZloQt;k0{z6`>FVdQ&MBb@ E011tBkN^Mx literal 0 HcmV?d00001 diff --git a/data/textures/flag_yellow_end.png b/data/textures/flag_yellow_end.png new file mode 100644 index 0000000000000000000000000000000000000000..991b2c8cffa7ae7b28c8d8723f4e9cc2c1ace92e GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJx*Z(ZvFr9T(Ur+Wu7jMAr_~XUfRoh$brY<;q%>p7?V>} zv%(zSG)6Q|TA0A4HKjYZD_~)V!tt}7+rEe{SAX}e=Iq-m!77`5kNx}e;QErCsfJGr zb}nw-WU{#-i}66$(S|37St0~3r2mwOH*D}*w*A&ohUuAeU&%1vTF0mmF2t;oyF;$} zj?ItGbt{@*8wH##HwapD=tz>or$!$)_x|#PwAWTEu7;I8kbA!%)7bK4yzCyvxl>)) U8|TQo16|DE>FVdQ&MBb@0C&e~G5`Po literal 0 HcmV?d00001 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42469f0..698e38c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -146,6 +146,8 @@ set(common_SRCS content_mapnode_furniture.cpp content_mapnode_stair.cpp content_mapnode_slab.cpp + content_mapnode_special.cpp + content_mapnode_plants.cpp content_mapnode_util.cpp content_list.cpp content_nodebox.cpp diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index b41ce3e..0f53f03 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -180,7 +180,6 @@ void content_mapnode_init(bool repeat) { // Read some settings bool new_style_water = g_settings->getBool("new_style_water"); - bool new_style_leaves = g_settings->getBool("new_style_leaves"); bool invisible_stone = g_settings->getBool("invisible_stone"); #ifndef SERVER bool opaque_water = g_settings->getBool("opaque_water"); @@ -672,621 +671,6 @@ void content_mapnode_init(bool repeat) lists::add("craftguide",i); lists::add("creative",i); - i = CONTENT_TREE; - f = &content_features(i); - f->description = std::string("Tree"); - f->setAllTextures("tree.png"); - f->setTexture(0, "tree_top.png"); - f->setTexture(1, "tree_top.png"); - f->setInventoryTextureCube("tree_top.png", "tree.png", "tree.png"); - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->flammable = 2; // can be set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->cook_result = std::string("CraftItem lump_of_charcoal 1"); - f->fuel_time = 30; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_APPLE_TREE; - f = &content_features(i); - f->description = std::string("Apple Tree"); - f->setAllTextures("apple_tree.png"); - f->setTexture(0, "apple_tree_top.png"); - f->setTexture(1, "apple_tree_top.png"); - f->setInventoryTextureCube("apple_tree_top.png", "apple_tree.png", "apple_tree.png"); - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->flammable = 2; // can be set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->cook_result = std::string("CraftItem lump_of_charcoal 1"); - f->fuel_time = 30; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_JUNGLETREE; - f = &content_features(i); - f->description = std::string("Jungle Tree"); - f->setAllTextures("jungletree.png"); - f->setTexture(0, "jungletree_top.png"); - f->setTexture(1, "jungletree_top.png"); - f->setInventoryTextureCube("jungletree_top.png", "jungletree.png", "jungletree.png"); - f->draw_type = CDT_CUBELIKE; - //f->is_ground_content = true; - f->flammable = 2; // can be set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->fuel_time = 30; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - - i = CONTENT_CONIFER_TREE; - f = &content_features(i); - f->description = std::string("Conifer Tree"); - f->setAllTextures("conifer_tree.png"); - f->setTexture(0, "conifer_tree_top.png"); - f->setTexture(1, "conifer_tree_top.png"); - f->is_ground_content = true; - f->flammable = 2; // can be set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->cook_result = std::string("CraftItem lump_of_charcoal 1"); - f->fuel_time = 30; - f->draw_type = CDT_NODEBOX; - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->is_ground_content = true; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 0; - f->fuel_time = 25; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->setNodeBox(core::aabbox3d( - -0.4375*BS, - -0.5*BS, - -0.4375*BS, - 0.4375*BS, - 0.5*BS, - 0.4375*BS - )); - f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png"); - f->type = CMT_WOOD; - f->hardness = 0.8; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_YOUNG_TREE; - f = &content_features(i); - f->description = std::string("Young Tree"); - f->setAllTextures("tree.png"); - f->setTexture(0, "tree_top.png"); - f->setTexture(1, "tree_top.png"); - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->param_type = CPT_LIGHT; - content_nodebox_youngtree(f); - f->setInventoryTextureNodeBox(i,"tree_top.png", "tree.png", "tree.png"); - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->special_alternate_node = CONTENT_LEAVES; - f->fuel_time = 20; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - - i = CONTENT_YOUNG_JUNGLETREE; - f = &content_features(i); - f->description = std::string("Young Jungle Tree"); - f->setAllTextures("jungletree.png"); - f->setTexture(0, "jungletree_top.png"); - f->setTexture(1, "jungletree_top.png"); - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->param_type = CPT_LIGHT; - content_nodebox_youngtree(f); - f->setInventoryTextureNodeBox(i,"jungletree_top.png", "jungletree.png", "jungletree.png"); - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->special_alternate_node = CONTENT_JUNGLELEAVES; - f->fuel_time = 20; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - - i = CONTENT_YOUNG_APPLE_TREE; - f = &content_features(i); - f->description = std::string("Young Apple Tree"); - f->setAllTextures("apple_tree.png"); - f->setTexture(0, "apple_tree_top.png"); - f->setTexture(1, "apple_tree_top.png"); - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->param_type = CPT_LIGHT; - content_nodebox_youngtree(f); - f->setInventoryTextureNodeBox(i,"apple_tree_top.png", "apple_tree.png", "apple_tree.png"); - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->special_alternate_node = CONTENT_APPLE_LEAVES; - f->fuel_time = 20; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - - i = CONTENT_YOUNG_CONIFER_TREE; - f = &content_features(i); - f->description = std::string("Young Conifer Tree"); - f->setAllTextures("conifer_tree.png"); - f->setTexture(0, "conifer_tree_top.png"); - f->setTexture(1, "conifer_tree_top.png"); - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->param_type = CPT_LIGHT; - content_nodebox_youngtree(f); - f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png"); - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->special_alternate_node = CONTENT_CONIFER_LEAVES; - f->fuel_time = 20; - f->type = CMT_WOOD; - f->hardness = 1.0; - lists::add("creative",i); - - i = CONTENT_JUNGLEGRASS; - f = &content_features(i); - f->description = std::string("Jungle Grass"); - f->setInventoryTexture("junglegrass.png"); - f->setAllTextures("junglegrass.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE_LGE; - //f->is_ground_content = true; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_LEAVES; - f = &content_features(i); - f->description = std::string("Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - //f->is_ground_content = true; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1"; - f->extra_dug_item_rarity = 20; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("decrafting",i); - lists::add("cooking",i); - - i = CONTENT_APPLE_LEAVES; - f = &content_features(i); - f->description = std::string("Apple Tree Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - //f->is_ground_content = true; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("apple_leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:apple_leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_SAPLING)+" 1"; - f->extra_dug_item_rarity = 20; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("decrafting",i); - lists::add("cooking",i); - - i = CONTENT_JUNGLELEAVES; - f = &content_features(i); - f->description = std::string("Jungle Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - //f->is_ground_content = true; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("jungleleaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:jungleleaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_JUNGLESAPLING)+" 1"; - f->extra_dug_item_rarity = 20; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("decrafting",i); - lists::add("cooking",i); - - i = CONTENT_CONIFER_LEAVES; - f = &content_features(i); - f->description = std::string("Conifer Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - //f->is_ground_content = true; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("conifer_leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:conifer_leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CONIFER_SAPLING)+" 1"; - f->extra_dug_item_rarity = 20; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("decrafting",i); - lists::add("cooking",i); - - i = CONTENT_TRIMMED_LEAVES; - f = &content_features(i); - f->description = std::string("Trimmed Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_TRIMMED_APPLE_LEAVES; - f = &content_features(i); - f->description = std::string("Trimmed Apple Tree Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("apple_leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:apple_leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_TRIMMED_JUNGLE_LEAVES; - f = &content_features(i); - f->description = std::string("Trimmed Jungle Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("jungleleaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:jungleleaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_TRIMMED_CONIFER_LEAVES; - f = &content_features(i); - f->description = std::string("Trimmed Conifer Leaves"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("conifer_leaves.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:conifer_leaves.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->cook_result = std::string("CraftItem lump_of_resin 1"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - lists::add("cooking",i); - - i = CONTENT_APPLE_BLOSSOM; - f = &content_features(i); - f->description = std::string("Apple Tree Blossom"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - //f->is_ground_content = true; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("apple_leaves.png^apple_blossom.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->extra_dug_item = std::string("CraftItem apple_blossom 1"); - f->extra_dug_item_rarity = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_LEAVES)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("decrafting",i); - - i = CONTENT_TRIMMED_APPLE_BLOSSOM; - f = &content_features(i); - f->description = std::string("Trimmed Apple Tree Blossom"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - if (new_style_leaves) { - f->draw_type = CDT_GLASSLIKE; - f->solidness = 0; // drawn separately, makes no faces - f->visual_solidness = 1; - f->setAllTextures("apple_leaves.png^apple_blossom.png"); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); -#endif - f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png"); - }else{ - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png"); - } - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_PLANT; - f->hardness = 0.15; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_CACTUS_BLOSSOM; - f = &content_features(i); - f->description = std::string("Cactus Blossom"); - f->setInventoryTexture("cactus_blossom.png"); - f->setAllTextures("cactus_blossom.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_CACTUS_FLOWER; - f = &content_features(i); - f->description = std::string("Cactus Flower"); - f->setInventoryTexture("cactus_flower.png"); - f->setAllTextures("cactus_flower.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CACTUS_BLOSSOM)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - lists::add("decrafting",i); - - i = CONTENT_CACTUS_FRUIT; - f = &content_features(i); - f->description = std::string("Cactus Berry"); - f->setInventoryTexture("cactus_fruit.png"); - f->setAllTextures("cactus_fruit.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("CraftItem cactus_fruit 1"); - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_CACTUS; - f = &content_features(i); - f->description = std::string("Cactus"); - f->setAllTextures("cactus_side.png"); - f->setTexture(0, "cactus_top.png"); - f->setTexture(1, "cactus_top.png"); - f->draw_type = CDT_NODEBOX; - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->is_ground_content = true; - f->damage_per_second = 2; - f->solidness = 0; // drawn separately, makes no faces - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/4; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->setNodeBox(core::aabbox3d( - -0.4375*BS, - -0.5*BS, - -0.4375*BS, - 0.4375*BS, - 0.5*BS, - 0.4375*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - 0.3125*BS, - -0.5*BS, - -0.4375*BS, - 0.375*BS, - -0.4375*BS - )); - f->addNodeBox(core::aabbox3d( - 0.4375*BS, - 0.125*BS, - 0.4375*BS, - 0.5*BS, - 0.1875*BS, - 0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.4375*BS, - -0.1875*BS, - -0.5*BS, - 0.5*BS, - -0.125*BS, - -0.4375*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - -0.375*BS, - 0.4375*BS, - -0.4375*BS, - -0.3125*BS, - 0.5*BS - )); - f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png"); - f->type = CMT_WOOD; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_PAPYRUS; - f = &content_features(i); - f->description = std::string("Papyrus"); - f->setInventoryTexture("papyrus.png"); - f->setAllTextures("papyrus.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->type = CMT_WOOD; - f->hardness = 0.25; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - i = CONTENT_GLASS; f = &content_features(i); f->description = std::string("Glass"); @@ -1755,529 +1139,6 @@ void content_mapnode_init(bool repeat) lists::add("craftguide",i); lists::add("creative",i); - i = CONTENT_FENCE; - f = &content_features(i); - f->description = std::string("Fence"); - f->setAllTextures("fence.png"); - f->setTexture(0,"fence_top.png"); - f->setTexture(1,"fence_top.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_FENCELIKE; - f->is_ground_content = true; - f->jumpable = false; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 15; - f->special_alternate_node = CONTENT_WOOD; - f->type = CMT_WOOD; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_fence_inv(f); - content_nodebox_fence(f); - f->setInventoryTextureNodeBox(i,"fence.png","fence_top.png","fence.png"); - crafting::setWallRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_FENCE); - crafting::setWallRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_FENCE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_RAIL; - f = &content_features(i); - f->description = std::string("Rail"); - f->setAllTextures("rail.png"); - f->setTexture(0,"track_tie.png"); - f->setTexture(1,"track_rail.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_RAILLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - f->type = CMT_DIRT; - f->hardness = 0.75; - { - u16 r[9] = { - CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_CRAFTITEM_WOOD_PLANK, CONTENT_CRAFTITEM_STEEL_INGOT, - CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_IGNORE, CONTENT_CRAFTITEM_STEEL_INGOT, - CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_CRAFTITEM_WOOD_PLANK, CONTENT_CRAFTITEM_STEEL_INGOT - }; - crafting::setRecipe(r,CONTENT_RAIL,15); - r[1] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[7] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - crafting::setRecipe(r,CONTENT_RAIL,15); - } - f->setNodeBox(core::aabbox3d( - -0.5*BS,-0.5*BS,-0.5*BS,0.5*BS,-0.375*BS,0.5*BS - )); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_TERRACOTTA; - f = &content_features(i); - f->description = std::string("Terracotta Roof Tile"); - f->setAllTextures("rooftile_terracotta.png"); - f->setAllTextureFlags(0); - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA,CONTENT_ROOFTILE_TERRACOTTA); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_WOOD; - f = &content_features(i); - f->description = std::string("Wood Roof Tile"); - f->setAllTextures("rooftile_wood.png"); - f->setAllTextureFlags(0); - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_WOOD,CONTENT_WOOD,CONTENT_ROOFTILE_WOOD); - crafting::set1over4Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLEWOOD,CONTENT_ROOFTILE_WOOD); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_ASPHALT; - f = &content_features(i); - f->description = std::string("Asphalt Roof Tile"); - f->setAllTextures("rooftile_asphalt.png"); - f->setAllTextureFlags(0); - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - { - u16 r[9] = { - CONTENT_SAND, CONTENT_CRAFTITEM_PAPER, CONTENT_IGNORE, - CONTENT_CRAFTITEM_PAPER, CONTENT_CRAFTITEM_DYE_BLACK, CONTENT_IGNORE, - CONTENT_IGNORE, CONTENT_IGNORE, CONTENT_IGNORE, - }; - crafting::setRecipe(r,CONTENT_ROOFTILE_ASPHALT,4); - } - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_STONE; - f = &content_features(i); - f->description = std::string("Stone Roof Tile"); - f->setAllTextures("rooftile_stone.png"); - f->setAllTextureFlags(0); - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE,CONTENT_ROOFTILE_STONE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS; - f = &content_features(i); - f->description = std::string("Glass Roof Tile"); - f->setAllTextures("glass.png"); - f->setTexture(1,"glass_slab.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS,CONTENT_GLASS,CONTENT_ROOFTILE_GLASS); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_BLUE; - f = &content_features(i); - f->description = std::string("Blue Glass Roof Tile"); - f->setAllTextures("glass_blue.png"); - f->setTexture(1,"glass_slab_blue.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_BLUE,CONTENT_GLASS_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_GREEN; - f = &content_features(i); - f->description = std::string("Green Glass Roof Tile"); - f->setAllTextures("glass_green.png"); - f->setTexture(1,"glass_slab_green.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_GREEN,CONTENT_GLASS_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_ORANGE; - f = &content_features(i); - f->description = std::string("Orange Glass Roof Tile"); - f->setAllTextures("glass_orange.png"); - f->setTexture(1,"glass_slab_orange.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_ORANGE,CONTENT_GLASS_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_PURPLE; - f = &content_features(i); - f->description = std::string("Purple Glass Roof Tile"); - f->setAllTextures("glass_purple.png"); - f->setTexture(1,"glass_slab_purple.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_PURPLE,CONTENT_GLASS_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_RED; - f = &content_features(i); - f->description = std::string("Red Glass Roof Tile"); - f->setAllTextures("glass_red.png"); - f->setTexture(1,"glass_slab_red.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_RED,CONTENT_GLASS_RED,CONTENT_ROOFTILE_GLASS_RED); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_RED,CONTENT_ROOFTILE_GLASS_RED); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_YELLOW; - f = &content_features(i); - f->description = std::string("Yellow Glass Roof Tile"); - f->setAllTextures("glass_yellow.png"); - f->setTexture(1,"glass_slab_yellow.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_YELLOW,CONTENT_GLASS_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_GLASS_BLACK; - f = &content_features(i); - f->description = std::string("Black Glass Roof Tile"); - f->setAllTextures("glass_black.png"); - f->setTexture(1,"glass_slab_black.png"); // special texture for top sections - f->setAllTextureFlags(0); -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); -#endif - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_GLASS_BLACK,CONTENT_GLASS_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); - crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROOFTILE_THATCH; - f = &content_features(i); - f->description = std::string("Thatch Roof Tile"); - f->setAllTextures("rooftile_thatch.png"); - f->setAllTextureFlags(0); - f->draw_type = CDT_ROOFLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->type = CMT_DIRT; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_roofcollide(f); - crafting::set1over4Recipe(CONTENT_DEADGRASS,CONTENT_DEADGRASS,CONTENT_ROOFTILE_THATCH); - crafting::set1over4Recipe(CONTENT_WILDGRASS_SHORT,CONTENT_WILDGRASS_SHORT,CONTENT_ROOFTILE_THATCH); - crafting::set1over4Recipe(CONTENT_JUNGLEGRASS,CONTENT_JUNGLEGRASS,CONTENT_ROOFTILE_THATCH); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_LADDER_LEGACY; - f = &content_features(i); - f->description = std::string("Ladder"); - f->setAllTextures("ladder.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_NODEBOX; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; - f->solidness = 0; - f->floormount_alternate_node = CONTENT_LADDER_FLOOR; - f->wallmount_alternate_node = CONTENT_LADDER_WALL; - f->roofmount_alternate_node = CONTENT_LADDER_ROOF; - f->rotate_tile_with_nodebox = true; - f->climbable = true; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->type = CMT_WOOD; - f->hardness = 0.5; - f->pressure_type = CST_CRUSHABLE; - f->setNodeBox(core::aabbox3d( - -0.4375*BS,-0.5*BS,0.3125*BS,-0.3125*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3125*BS,-0.5*BS,0.3125*BS,0.4375*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,-0.25*BS,0.375*BS,0.3125*BS,-0.1875*BS,0.4375*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,0.25*BS,0.375*BS,0.3125*BS,0.3125*BS,0.4375*BS - )); - f->setInventoryTextureNodeBox(i,"ladder.png","ladder.png","ladder.png"); - - i = CONTENT_LADDER_WALL; - f = &content_features(i); - f->description = std::string("Ladder"); - f->setAllTextures("ladder.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_NODEBOX; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; - f->solidness = 0; - f->floormount_alternate_node = CONTENT_LADDER_FLOOR; - f->roofmount_alternate_node = CONTENT_LADDER_ROOF; - f->rotate_tile_with_nodebox = true; - f->climbable = true; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->type = CMT_WOOD; - f->hardness = 0.5; - f->pressure_type = CST_CRUSHABLE; - f->setNodeBox(core::aabbox3d( - -0.4375*BS,-0.5*BS,0.3125*BS,-0.3125*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3125*BS,-0.5*BS,0.3125*BS,0.4375*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,-0.25*BS,0.375*BS,0.3125*BS,-0.1875*BS,0.4375*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,0.25*BS,0.375*BS,0.3125*BS,0.3125*BS,0.4375*BS - )); - f->setInventoryTextureNodeBox(i,"ladder.png","ladder.png","ladder.png"); - { - u16 r[9] = { - CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK, - CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK, - CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK - }; - crafting::setRecipe(r,CONTENT_LADDER_WALL,4); - r[0] = CONTENT_CRAFTITEM_WOOD_PLANK; - r[2] = CONTENT_CRAFTITEM_WOOD_PLANK; - r[3] = CONTENT_CRAFTITEM_WOOD_PLANK; - r[5] = CONTENT_CRAFTITEM_WOOD_PLANK; - r[6] = CONTENT_CRAFTITEM_WOOD_PLANK; - r[8] = CONTENT_CRAFTITEM_WOOD_PLANK; - crafting::setRecipe(r,CONTENT_LADDER_WALL,4); - r[0] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[2] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[3] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[5] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[6] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - r[8] = CONTENT_CRAFTITEM_JUNGLE_PLANK; - crafting::setRecipe(r,CONTENT_LADDER_WALL,4); - } - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_LADDER_FLOOR; - f = &content_features(i); - f->description = std::string("Ladder"); - f->setAllTextures("ladder.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; - f->solidness = 0; - f->wallmount_alternate_node = CONTENT_LADDER_WALL; - f->roofmount_alternate_node = CONTENT_LADDER_ROOF; - f->rotate_tile_with_nodebox = true; - f->climbable = true; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->type = CMT_WOOD; - f->hardness = 0.5; - f->pressure_type = CST_CRUSHABLE; - f->setNodeBox(core::aabbox3d( - -0.4375*BS,-0.5*BS,-0.5*BS,-0.3125*BS,-0.3125*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3125*BS,-0.5*BS,-0.5*BS,0.4375*BS,-0.3125*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,-0.4375*BS,-0.3125*BS,0.3125*BS,-0.375*BS,-0.25*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,-0.4375*BS,0.1875*BS,0.3125*BS,-0.375*BS,0.25*BS - )); - - i = CONTENT_LADDER_ROOF; - f = &content_features(i); - f->description = std::string("Ladder"); - f->setAllTextures("ladder.png"); - f->light_propagates = true; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; - f->solidness = 0; - f->floormount_alternate_node = CONTENT_LADDER_FLOOR; - f->wallmount_alternate_node = CONTENT_LADDER_WALL; - f->rotate_tile_with_nodebox = true; - f->climbable = true; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/16; - f->type = CMT_WOOD; - f->hardness = 0.5; - f->pressure_type = CST_CRUSHABLE; - f->setNodeBox(core::aabbox3d( - -0.4375*BS,0.3125*BS,-0.5*BS,-0.3125*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3125*BS,0.3125*BS,-0.5*BS,0.4375*BS,0.5*BS,0.5*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,0.375*BS,-0.3125*BS,0.3125*BS,0.4375*BS,-0.25*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3125*BS,0.375*BS,0.1875*BS,0.3125*BS,0.4375*BS,0.25*BS - )); - - i = CONTENT_BORDERSTONE; - f = &content_features(i); - f->description = std::string("Border Stone"); - f->setAllTextures("borderstone.png"); - f->setInventoryTextureCube("borderstone.png", "borderstone.png", "borderstone.png"); - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new BorderStoneNodeMetadata(); - f->type = CMT_STONE; - f->hardness = 2.0; - f->pressure_type = CST_SOLID; - crafting::setFilledRoundRecipe(CONTENT_STONE,CONTENT_MESE,CONTENT_BORDERSTONE); - { - u16 r[9] = { - CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT, - CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, - CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT - }; - crafting::setRecipe(r,CONTENT_BORDERSTONE,1); - } - lists::add("craftguide",i); - lists::add("player-creative",i); - lists::add("creative",i); - i = CONTENT_WOOD; f = &content_features(i); f->description = std::string("Wood"); @@ -2781,295 +1642,6 @@ void content_mapnode_init(bool repeat) lists::add("creative",i); lists::add("decrafting",i); - i = CONTENT_BOOK; - f = &content_features(i); - f->description = std::string("Book"); - f->setTexture(0, "book_cover.png"); - f->setTexture(1, "book_cover.png^[transformFX"); - f->setTexture(2, "book_side.png^[transformFY"); - f->setTexture(3, "book_side.png"); - f->setTexture(4, "book_end.png"); - f->setTexture(5, "book_end.png^[transformFX"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_BOOK_OPEN; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; - content_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_cover.png", "book_end.png^[transformFX", "book_side.png^[transformFY"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,i); - lists::add("craftguide",i); - lists::add("creative",i); - if (f->initial_metadata == NULL) - f->initial_metadata = new ClosedBookNodeMetadata(); - - i = CONTENT_COOK_BOOK; - f = &content_features(i); - f->description = std::string("Cook Book"); - f->setTexture(0, "book_cook_cover.png"); - f->setTexture(1, "book_cook_cover.png^[transformFX"); - f->setTexture(2, "book_cook_side.png^[transformFY"); - f->setTexture(3, "book_cook_side.png"); - f->setTexture(4, "book_cook_end.png"); - f->setTexture(5, "book_cook_end.png^[transformFX"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_COOK_BOOK_OPEN; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; - content_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_cook_cover.png", "book_cook_end.png^[transformFX", "book_cook_side.png^[transformFY"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_COAL,i); - crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_CHARCOAL,i); - lists::add("craftguide",i); - lists::add("creative",i); - if (f->initial_metadata == NULL) - f->initial_metadata = new ClosedBookNodeMetadata(); - - i = CONTENT_DECRAFT_BOOK; - f = &content_features(i); - f->description = std::string("Decraft Book"); - f->setTexture(0, "book_decraft_cover.png"); - f->setTexture(1, "book_decraft_cover.png^[transformFX"); - f->setTexture(2, "book_decraft_side.png^[transformFY"); - f->setTexture(3, "book_decraft_side.png"); - f->setTexture(4, "book_decraft_end.png"); - f->setTexture(5, "book_decraft_end.png^[transformFX"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_DECRAFT_BOOK_OPEN; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; - content_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_decraft_cover.png", "book_decraft_end.png^[transformFX", "book_decraft_side.png^[transformFY"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_GUNPOWDER,i); - lists::add("craftguide",i); - lists::add("creative",i); - if (f->initial_metadata == NULL) - f->initial_metadata = new ClosedBookNodeMetadata(); - - i = CONTENT_DIARY_BOOK; - f = &content_features(i); - f->description = std::string("Diary"); - f->setTexture(0, "book_diary_cover.png"); - f->setTexture(1, "book_diary_cover.png^[transformFX"); - f->setTexture(2, "book_diary_side.png^[transformFY"); - f->setTexture(3, "book_diary_side.png"); - f->setTexture(4, "book_diary_end.png"); - f->setTexture(5, "book_diary_end.png^[transformFX"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_DIARY_BOOK_OPEN; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; - content_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_diary_cover.png", "book_diary_end.png^[transformFX", "book_diary_side.png^[transformFY"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_STEEL_INGOT,i); - if (f->initial_metadata == NULL) - f->initial_metadata = new ClosedBookNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_CRAFT_BOOK; - f = &content_features(i); - f->description = std::string("Craft Book"); - f->setTexture(0, "book_craft_cover.png"); - f->setTexture(1, "book_craft_cover.png^[transformFX"); - f->setTexture(2, "book_craft_side.png^[transformFY"); - f->setTexture(3, "book_craft_side.png"); - f->setTexture(4, "book_craft_end.png"); - f->setTexture(5, "book_craft_end.png^[transformFX"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_CRAFT_BOOK_OPEN; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; - content_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_craft_cover.png", "book_craft_end.png^[transformFX", "book_craft_side.png^[transformFY"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_MESE,i); - { - content_t r[9] = { - CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, - CONTENT_IGNORE, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, - CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_IGNORE - }; - crafting::setRecipe(r,CONTENT_CRAFT_BOOK,1); - } - if (f->initial_metadata == NULL) - f->initial_metadata = new ClosedBookNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_BOOK_OPEN; - f = &content_features(i); - f->description = std::string("Guide"); - f->setAllTextures("guide_side.png"); - f->setTexture(0, "guide_top.png"); - f->setTexture(1, "guide_bottom.png"); - f->setTexture(4, "guide_end.png"); - f->setTexture(5, "guide_end.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_BOOK; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_BOOK)+" 1"; - f->solidness = 0; - content_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "guide_top.png", "guide_end.png", "guide_side.png"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - if (f->initial_metadata == NULL) - f->initial_metadata = new BookNodeMetadata(); - - i = CONTENT_COOK_BOOK_OPEN; - f = &content_features(i); - f->description = std::string("Cooking Guide"); - f->setAllTextures("guide_cook_side.png"); - f->setTexture(0, "guide_cook_top.png"); - f->setTexture(1, "guide_cook_bottom.png"); - f->setTexture(4, "guide_cook_end.png"); - f->setTexture(5, "guide_cook_end.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_COOK_BOOK; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COOK_BOOK)+" 1"; - f->solidness = 0; - content_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "guide_cook_top.png", "guide_cook_end.png", "guide_cook_side.png"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - if (f->initial_metadata == NULL) - f->initial_metadata = new CookBookNodeMetadata(); - - i = CONTENT_DECRAFT_BOOK_OPEN; - f = &content_features(i); - f->description = std::string("Decrafting Guide"); - f->setAllTextures("guide_decraft_side.png"); - f->setTexture(0, "guide_decraft_top.png"); - f->setTexture(1, "guide_decraft_bottom.png"); - f->setTexture(4, "guide_decraft_end.png"); - f->setTexture(5, "guide_decraft_end.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_DECRAFT_BOOK; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DECRAFT_BOOK)+" 1"; - f->solidness = 0; - content_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "guide_decraft_top.png", "guide_decraft_end.png", "guide_decraft_side.png"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - if (f->initial_metadata == NULL) - f->initial_metadata = new DeCraftNodeMetadata(); - - i = CONTENT_DIARY_BOOK_OPEN; - f = &content_features(i); - f->description = std::string("Diary"); - f->setAllTextures("guide_diary_side.png"); - f->setTexture(0, "guide_diary_top.png"); - f->setTexture(1, "guide_diary_bottom.png"); - f->setTexture(4, "guide_diary_end.png"); - f->setTexture(5, "guide_diary_end.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_DIARY_BOOK; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DIARY_BOOK)+" 1"; - f->solidness = 0; - content_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "guide_diary_top.png", "guide_diary_end.png", "guide_diary_side.png"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - if (f->initial_metadata == NULL) - f->initial_metadata = new DiaryNodeMetadata(); - - i = CONTENT_CRAFT_BOOK_OPEN; - f = &content_features(i); - f->description = std::string("Craft Guide"); - f->setAllTextures("guide_craft_side.png"); - f->setTexture(0, "guide_craft_top.png"); - f->setTexture(1, "guide_craft_bottom.png"); - f->setTexture(4, "guide_craft_end.png"); - f->setTexture(5, "guide_craft_end.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->rotate_tile_with_nodebox = true; - f->light_propagates = true; - f->air_equivalent = true; - f->onpunch_replace_node = CONTENT_CRAFT_BOOK; - f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CRAFT_BOOK)+" 1"; - f->solidness = 0; - content_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "guide_craft_top.png", "guide_craft_end.png", "guide_craft_side.png"); - f->type = CMT_DIRT; - f->hardness = 1.0; - f->pressure_type = CST_CRUSHABLE; - if (f->initial_metadata == NULL) - f->initial_metadata = new CraftGuideNodeMetadata(); - i = CONTENT_COTTON; f = &content_features(i); f->description = std::string("Cotton"); @@ -3570,385 +2142,6 @@ void content_mapnode_init(bool repeat) f->hardness = 0.5; f->pressure_type = CST_CRUSHABLE; - i = CONTENT_FIRE; - f = &content_features(i); - f->description = std::string("Fire"); - f->setAllTextures("fire.png"); - f->setAllTextureFlags(0); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_FIRELIKE; - f->light_propagates = true; - f->light_source = LIGHT_MAX-1; - f->solidness = 0; // Drawn separately, makes no faces - f->walkable = false; - f->pointable = false; - f->diggable = false; - f->buildable_to = true; - f->damage_per_second = 4*2; -#ifndef SERVER - f->post_effect_color = video::SColor(192, 255, 64, 0); -#endif - f->pressure_type = CST_CRUSHED; - - i = CONTENT_FIRE_SHORTTERM; - f = &content_features(i); - f->description = std::string("Fire"); - f->setAllTextures("fire.png"); - f->setAllTextureFlags(0); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_FIRELIKE; - f->light_propagates = true; - f->light_source = LIGHT_MAX-1; - f->solidness = 0; // Drawn separately, makes no faces - f->walkable = false; - f->pointable = false; - f->diggable = false; - f->buildable_to = true; - f->damage_per_second = 4*2; -#ifndef SERVER - f->post_effect_color = video::SColor(192, 255, 64, 0); -#endif - f->pressure_type = CST_CRUSHED; - - i = CONTENT_TORCH_LEGACY; - f = &content_features(i); - f->description = std::string("Torch"); - f->setAllTextures("torch.png"); - f->setInventoryTexture("torch_inventory.png"); - f->setAllTextureFlags(0); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_TORCHLIKE; - f->light_propagates = true; - f->sunlight_propagates = true; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 0.5; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_TORCH)+" 1"; - f->light_source = LIGHT_MAX-1; - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHED; - - i = CONTENT_TORCH; - f = &content_features(i); - f->description = std::string("Torch"); - f->setAllTextures("torch.png"); - f->setInventoryTexture("torch_inventory.png"); - f->setAllTextureFlags(0); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_TORCHLIKE; - f->light_propagates = true; - f->sunlight_propagates = true; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 0.5; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->light_source = LIGHT_MAX-1; - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHABLE; - crafting::set1over4Recipe(CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); - crafting::set1over4Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); - lists::add("craftguide",i); - lists::add("player-creative",i); - lists::add("creative",i); - - i = CONTENT_SIGN_WALL; - f = &content_features(i); - f->description = std::string("Sign"); - f->setAllTextures("sign_wall.png"); - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_NODEBOX; - f->light_propagates = true; - f->sunlight_propagates = true; - f->floormount_alternate_node = CONTENT_SIGN; - f->roofmount_alternate_node = CONTENT_SIGN_UD; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new SignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign_wall(f); - - i = CONTENT_SIGN; - f = &content_features(i); - f->description = std::string("Sign"); - f->setAllTextures("sign.png"); - f->setTexture(4, "sign_back.png"); - f->setTexture(5, "sign_front.png"); // Z- - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->wallmount_alternate_node = CONTENT_SIGN_WALL; - f->roofmount_alternate_node = CONTENT_SIGN_UD; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new SignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign(f); - f->setInventoryTextureNodeBox(i,"sign.png", "sign_front.png", "sign.png"); - crafting::setSignRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_SIGN); - crafting::setSignRecipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_SIGN); - crafting::setSignRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_SIGN); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_SIGN_UD; - f = &content_features(i); - f->description = std::string("Sign"); - f->setAllTextures("sign.png"); - f->setTexture(4, "sign_back_ud.png"); - f->setTexture(5, "sign_front_ud.png"); // Z- - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->wallmount_alternate_node = CONTENT_SIGN_WALL; - f->floormount_alternate_node = CONTENT_SIGN; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new SignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign_ud(f); - f->setInventoryTextureNodeBox(i,"sign.png", "sign_front.png", "sign.png"); - - i = CONTENT_LOCKABLE_SIGN_WALL; - f = &content_features(i); - f->description = std::string("Locking Sign"); - f->setAllTextures("sign.png"); - f->setTexture(4, "sign_back.png"); - f->setTexture(5, "sign_wall_lock.png"); // Z- - f->param_type = CPT_LIGHT; - f->param2_type = CPT_FACEDIR_WALLMOUNT; - f->draw_type = CDT_NODEBOX; - f->light_propagates = true; - f->sunlight_propagates = true; - f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; - f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_LOCKABLE_SIGN)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new LockingSignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign_wall(f); - - i = CONTENT_LOCKABLE_SIGN; - f = &content_features(i); - f->description = std::string("Locking Sign"); - f->setAllTextures("sign.png"); - f->setTexture(4, "sign_back.png"); - f->setTexture(5, "sign_lock.png"); // Z- - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; - f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new LockingSignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign(f); - f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); - crafting::set1Any2Recipe(CONTENT_SIGN,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_SIGN); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_LOCKABLE_SIGN_UD; - f = &content_features(i); - f->description = std::string("Locking Sign"); - f->setAllTextures("sign.png"); - f->setTexture(4, "sign_back_ud.png"); - f->setTexture(5, "sign_lock_ud.png"); // Z- - f->param_type = CPT_LIGHT; - f->light_propagates = true; - f->sunlight_propagates = true; - f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; - f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; - f->param2_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_NODEBOX; - f->solidness = 0; // drawn separately, makes no faces - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_LOCKABLE_SIGN)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new LockingSignNodeMetadata("Some sign"); - f->type = CMT_WOOD; - f->hardness = 0.1; - f->pressure_type = CST_CRUSHABLE; - content_nodebox_sign_ud(f); - f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); - - i = CONTENT_CHEST; - f = &content_features(i); - f->description = std::string("Chest"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("chest_side.png"); - f->setTexture(0, "chest_top.png"); - f->setTexture(1, "chest_top.png"); - f->setTexture(5, "chest_front.png"); // Z- - f->setInventoryTexture("chest_top.png"); - f->setInventoryTextureCube("chest_top.png", "chest_front.png", "chest_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new ChestNodeMetadata(); - f->type = CMT_WOOD; - f->hardness = 1.0; - f->pressure_type = CST_SOLID; - crafting::setRoundRecipe(CONTENT_WOOD,CONTENT_CHEST); - crafting::setRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CHEST); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_CREATIVE_CHEST; - f = &content_features(i); - f->description = std::string("Creative Chest"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("chest_side.png"); - f->setTexture(0, "chest_top.png"); - f->setTexture(1, "chest_top.png"); - f->setTexture(5, "chest_creative.png"); // Z- - f->setInventoryTexture("chest_top.png"); - f->setInventoryTextureCube("chest_top.png", "chest_creative.png", "chest_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new CreativeChestNodeMetadata(); - f->type = CMT_WOOD; - f->hardness = 1.0; - f->pressure_type = CST_SOLID; - lists::add("player-creative",i); - lists::add("creative",i); - - i = CONTENT_LOCKABLE_CHEST; - f = &content_features(i); - f->description = std::string("Locking Chest"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("chest_side.png"); - f->setTexture(0, "chest_top.png"); - f->setTexture(1, "chest_top.png"); - f->setTexture(5, "chest_lock.png"); // Z- - f->setInventoryTexture("chest_lock.png"); - f->setInventoryTextureCube("chest_top.png", "chest_lock.png", "chest_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new LockingChestNodeMetadata(); - f->type = CMT_WOOD; - f->hardness = 1.0; - f->pressure_type = CST_SOLID; - crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); - crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_FURNACE; - f = &content_features(i); - f->description = std::string("Furnace"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("furnace_side.png"); - f->setTexture(0, "furnace_top.png"); - f->setTexture(1, "furnace_top.png"); - f->setTexture(5, "furnace_front.png"); // Z- - f->setInventoryTextureCube("furnace_top.png", "furnace_front.png", "furnace_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new FurnaceNodeMetadata(); - f->type = CMT_STONE; - f->hardness = 3.0; - f->pressure_type = CST_SOLID; - crafting::setRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_FURNACE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_LOCKABLE_FURNACE; - f = &content_features(i); - f->description = std::string("Locking Furnace"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("furnace_side.png"); - f->setTexture(0, "furnace_top.png"); - f->setTexture(1, "furnace_top.png"); - f->setTexture(5, "furnace_lock.png"); // Z- - f->setInventoryTextureCube("furnace_top.png", "furnace_lock.png", "furnace_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new LockingFurnaceNodeMetadata(); - f->type = CMT_STONE; - f->hardness = 3.0; - f->pressure_type = CST_SOLID; - crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); - crafting::set1Any2Recipe(CONTENT_FURNACE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_INCINERATOR; - f = &content_features(i); - f->description = std::string("Incinerator"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("incinerator_side.png"); - f->setTexture(0, "incinerator_top.png"); // Z- - f->setTexture(1, "incinerator_top.png"); // Z- - f->setTexture(5, "incinerator_front.png"); // Z- - f->setInventoryTextureCube("incinerator_top.png", "incinerator_front.png", "incinerator_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new IncineratorNodeMetadata(); - f->type = CMT_STONE; - f->hardness = 0.4; - f->pressure_type = CST_SOLID; - crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_MESE,CONTENT_INCINERATOR); - lists::add("craftguide",i); - lists::add("creative",i); - i = CONTENT_ROUGHSTONE; f = &content_features(i); f->description = std::string("Rough Stone"); @@ -4097,577 +2290,4 @@ void content_mapnode_init(bool repeat) lists::add("craftguide",i); lists::add("creative",i); - i = CONTENT_NC; - f = &content_features(i); - f->description = std::string("Nyan Cat"); - f->param_type = CPT_FACEDIR_SIMPLE; - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("nc_side.png"); - f->setTexture(5, "nc_front.png"); // Z- - f->setTexture(4, "nc_back.png"); // Z+ - f->setInventoryTextureCube("nc_front.png", "nc_side.png", "nc_side.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_STONE; - f->hardness = 3.0; - lists::add("creative",i); - - i = CONTENT_NC_RB; - f = &content_features(i); - f->description = std::string("Rainbow"); - f->draw_type = CDT_CUBELIKE; - f->setAllTextures("nc_rb.png"); - f->setInventoryTextureCube("nc_rb.png", "nc_rb.png", "nc_rb.png"); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_STONE; - f->hardness = 3.0; - lists::add("creative",i); - - i = CONTENT_SAPLING; - f = &content_features(i); - f->description = std::string("Sapling"); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->setAllTextures("sapling.png"); - f->setInventoryTexture("sapling.png"); - f->setAllTextureFlags(0); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->light_propagates = true; - f->air_equivalent = false; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->type = CMT_WOOD; - f->hardness = 0.0; - lists::add("creative",i); - - i = CONTENT_APPLE_SAPLING; - f = &content_features(i); - f->description = std::string("Apple Tree Sapling"); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->setAllTextures("apple_sapling.png"); - f->setInventoryTexture("apple_sapling.png"); - f->setAllTextureFlags(0); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->light_propagates = true; - f->air_equivalent = false; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_JUNGLESAPLING; - f = &content_features(i); - f->description = std::string("Jungle Sapling"); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->setAllTextures("junglesapling.png"); - f->setInventoryTexture("junglesapling.png"); - f->setAllTextureFlags(0); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->light_propagates = true; - f->air_equivalent = false; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_CONIFER_SAPLING; - f = &content_features(i); - f->description = std::string("Conifer Sapling"); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->setAllTextures("conifer_sapling.png"); - f->setInventoryTexture("conifer_sapling.png"); - f->setAllTextureFlags(0); - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->light_propagates = true; - f->air_equivalent = false; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_APPLE; - f = &content_features(i); - f->description = std::string("Apple"); - f->setInventoryTexture("apple.png"); - f->setAllTextures("apple.png"); - f->setAllTextureFlags(0); - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE_SML; - f->light_propagates = true; - f->sunlight_propagates = true; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->air_equivalent = true; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 1; - f->dug_item = std::string("CraftItem apple 1"); - f->type = CMT_WOOD; - f->hardness = 0.0; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - // plants - i = CONTENT_WILDGRASS_SHORT; - f = &content_features(i); - f->description = std::string("Wild Grass"); - f->setInventoryTexture("wildgrass_short.png"); - f->setAllTextures("wildgrass_short.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - //f->pointable = false; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - - i = CONTENT_WILDGRASS_LONG; - f = &content_features(i); - f->description = std::string("Wild Grass"); - f->setInventoryTexture("wildgrass_long.png"); - f->setAllTextures("wildgrass_long.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->air_equivalent = false; // grass grows underneath - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WILDGRASS_SHORT)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - - i = CONTENT_DEADGRASS; - f = &content_features(i); - f->description = std::string("Dead Grass"); - f->setInventoryTexture("deadgrass.png"); - f->setAllTextures("deadgrass.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - - i = CONTENT_FLOWER_STEM; - f = &content_features(i); - f->description = std::string("Flower Stem"); - f->setInventoryTexture("flower_stem.png"); - f->setAllTextures("flower_stem.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - - i = CONTENT_FLOWER_ROSE; - f = &content_features(i); - f->description = std::string("Rose"); - f->setInventoryTexture("flower_rose.png"); - f->setAllTextures("flower_rose.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_FLOWER_DAFFODIL; - f = &content_features(i); - f->description = std::string("Daffodil"); - f->setInventoryTexture("flower_daffodil.png"); - f->setAllTextures("flower_daffodil.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_FLOWER_TULIP; - f = &content_features(i); - f->description = std::string("Tulip"); - f->setInventoryTexture("flower_tulip.png"); - f->setAllTextures("flower_tulip.png"); - f->setAllTextureFlags(0); - f->light_propagates = true; - f->sunlight_propagates = true; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_PLANTLIKE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->walkable = false; - f->material_pointable = false; - f->flammable = 1; // can be replaced by fire if the node under it is set on fire - f->fuel_time = 30/32; - f->buildable_to = true; - f->type = CMT_WOOD; - f->hardness = 0.10; - f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); - - i = CONTENT_FLOWER_POT_RAW; - f = &content_features(i); - f->param_type = CPT_LIGHT; - f->description = std::string("Unbaked Flower Pot"); - f->setAllTextures("flower_pot_raw.png"); - f->setTexture(0,"flower_pot_raw_top.png"); - f->setTexture(1,"flower_pot_raw_bottom.png"); - f->draw_type = CDT_NODEBOX; - f->light_propagates = true; - f->sunlight_propagates = true; - f->solidness = 0; // drawn separately, makes no faces - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->cook_result = std::string("MaterialItem2 ")+itos(CONTENT_FLOWER_POT)+" 1"; - f->type = CMT_STONE; - f->hardness = 0.75; - f->pressure_type = CST_CRUSHABLE; - f->setNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - -0.5*BS, - 0.5*BS, - 0.5*BS, - -0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - 0.3*BS, - 0.5*BS, - 0.5*BS, - 0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3*BS, - 0.2*BS, - -0.3*BS, - 0.5*BS, - 0.5*BS, - 0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - -0.3*BS, - -0.3*BS, - 0.5*BS, - 0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3*BS, - -0.5*BS, - -0.3*BS, - 0.3*BS, - 0.35*BS, - 0.3*BS - )); - f->setInventoryTextureNodeBox(i,"flower_pot_raw_top.png","flower_pot_raw.png","flower_pot_raw.png"); - crafting::setVRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_FLOWER_POT_RAW); - lists::add("craftguide",i); - lists::add("cooking",i); - - i = CONTENT_FLOWER_POT; - f = &content_features(i); - f->param_type = CPT_LIGHT; - f->description = std::string("Flower Pot"); - f->setAllTextures("flower_pot.png"); - f->setTexture(0,"flower_pot_top.png"); - f->setTexture(1,"flower_pot_bottom.png"); - f->draw_type = CDT_NODEBOX; - f->light_propagates = true; - f->sunlight_propagates = true; - f->solidness = 0; // drawn separately, makes no faces - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->type = CMT_STONE; - f->hardness = 0.75; - f->setNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - -0.5*BS, - 0.5*BS, - 0.5*BS, - -0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - 0.3*BS, - 0.5*BS, - 0.5*BS, - 0.5*BS - )); - f->addNodeBox(core::aabbox3d( - 0.3*BS, - 0.2*BS, - -0.3*BS, - 0.5*BS, - 0.5*BS, - 0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.5*BS, - 0.2*BS, - -0.3*BS, - -0.3*BS, - 0.5*BS, - 0.3*BS - )); - f->addNodeBox(core::aabbox3d( - -0.3*BS, - -0.5*BS, - -0.3*BS, - 0.3*BS, - 0.35*BS, - 0.3*BS - )); - f->setInventoryTextureNodeBox(i,"flower_pot_top.png","flower_pot.png","flower_pot.png"); - lists::add("creative",i); - - // walls - i = CONTENT_COBBLE_WALL; - f = &content_features(i); - f->description = std::string("Cobblestone Wall"); - f->setAllTextures("cobble.png"); - f->light_propagates = true; - f->jumpable = false; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_WALLLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - content_nodebox_wall_inv(f); - content_nodebox_wall(f); - f->setInventoryTextureNodeBox(i,"cobble.png","cobble.png","cobble.png"); - f->special_alternate_node = CONTENT_COBBLE; - f->type = CMT_STONE; - f->hardness = 0.9; - crafting::setWallRecipe(CONTENT_COBBLE,CONTENT_COBBLE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_ROUGHSTONE_WALL; - f = &content_features(i); - f->description = std::string("Rough Stone Wall"); - f->setAllTextures("roughstone.png"); - f->light_propagates = true; - f->jumpable = false; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_WALLLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - content_nodebox_wall_inv(f); - content_nodebox_wall(f); - f->setInventoryTextureNodeBox(i,"roughstone.png","roughstone.png","roughstone.png"); - f->special_alternate_node = CONTENT_ROUGHSTONE; - f->type = CMT_STONE; - f->hardness = 0.9; - crafting::setWallRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_MOSSYCOBBLE_WALL; - f = &content_features(i); - f->description = std::string("Mossy Cobblestone Wall"); - f->setAllTextures("mossycobble.png"); - f->light_propagates = true; - f->jumpable = false; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_WALLLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - content_nodebox_wall_inv(f); - content_nodebox_wall(f); - f->setInventoryTextureNodeBox(i,"mossycobble.png","mossycobble.png","mossycobble.png"); - f->special_alternate_node = CONTENT_MOSSYCOBBLE; - f->type = CMT_STONE; - f->hardness = 0.8; - crafting::setWallRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_STONE_WALL; - f = &content_features(i); - f->description = std::string("Stone Wall"); - f->setAllTextures("stone.png"); - f->light_propagates = true; - f->jumpable = false; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_WALLLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - content_nodebox_wall_inv(f); - content_nodebox_wall(f); - f->setInventoryTextureNodeBox(i,"stone.png","stone.png","stone.png"); - f->special_alternate_node = CONTENT_STONE; - f->type = CMT_STONE; - f->hardness = 1.0; - crafting::setWallRecipe(CONTENT_STONE,CONTENT_STONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_SANDSTONE_WALL; - f = &content_features(i); - f->description = std::string("Sand Stone Wall"); - f->setAllTextures("sandstone.png"); - f->light_propagates = true; - f->jumpable = false; - f->param_type = CPT_LIGHT; - f->param2_type = CPT_SPECIAL; - f->draw_type = CDT_WALLLIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - f->solidness = 0; // drawn separately, makes no faces - f->air_equivalent = true; // grass grows underneath - content_nodebox_wall_inv(f); - content_nodebox_wall(f); - f->setInventoryTextureNodeBox(i,"sandstone.png","sandstone.png","sandstone.png"); - f->special_alternate_node = CONTENT_SANDSTONE; - f->type = CMT_DIRT; - f->hardness = 1.0; - crafting::setWallRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_TNT; - f = &content_features(i); - f->description = std::string("TNT"); - f->setAllTextures("tnt.png"); - f->setTexture(0, "tnt_top.png"); - f->setTexture(1, "tnt_bottom.png"); - f->setInventoryTextureCube("tnt_top.png", "tnt.png", "tnt.png"); - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->energy_type = CET_CONDUCTIVE; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - if(f->initial_metadata == NULL) - f->initial_metadata = new TNTNodeMetadata(); - f->type = CMT_DIRT; - f->hardness = 1.0; - crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_TNT,CONTENT_TNT); - lists::add("craftguide",i); - lists::add("creative",i); - - i = CONTENT_FLASH; - f = &content_features(i); - f->description = std::string("In-Progress explosion - how did you get this???"); - f->setAllTextures("flash.png"); - f->solidness = 0; // drawn separately, makes no faces - f->param_type = CPT_LIGHT; - f->draw_type = CDT_GLASSLIKE; - f->light_propagates = true; - f->light_source = LIGHT_MAX-1; - f->walkable = false; - f->pointable = false; - f->diggable = false; - f->buildable_to = true; - f->damage_per_second = 50; - f->pressure_type = CST_CRUSHED; -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); - f->post_effect_color = video::SColor(192, 255, 255, 64); -#endif - - i = CONTENT_STEAM; - f = &content_features(i); - f->description = std::string("Steam"); - f->setAllTextures("steam.png"); - f->solidness = 0; - f->param_type = CPT_LIGHT; - f->draw_type = CDT_GLASSLIKE; - f->light_propagates = true; - f->sunlight_propagates = true; - f->walkable = false; - f->pointable = false; - f->diggable = false; - f->buildable_to = true; - f->damage_per_second = 4; - f->pressure_type = CST_CRUSHED; -#ifndef SERVER - f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); - f->post_effect_color = video::SColor(120, 200, 200, 200); -#endif - - } diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 40130f6..58d9221 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -29,6 +29,8 @@ void content_mapnode_furniture(bool repeat); void content_mapnode_door(bool repeat); void content_mapnode_stair(bool repeat); void content_mapnode_slab(bool repeat); +void content_mapnode_special(bool repeat); +void content_mapnode_plants(bool repeat); extern content_t trans_table_19[21][2]; @@ -176,6 +178,14 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_COUCH_CHAIR_BLACK 0x865 // FREE 866-87F +#define CONTENT_FLAG 0x870 +#define CONTENT_FLAG_BLUE 0x871 +#define CONTENT_FLAG_GREEN 0x872 +#define CONTENT_FLAG_ORANGE 0x873 +#define CONTENT_FLAG_PURPLE 0x874 +#define CONTENT_FLAG_RED 0x875 +#define CONTENT_FLAG_YELLOW 0x876 +#define CONTENT_FLAG_BLACK 0x877 // plants #define CONTENT_WILDGRASS_SHORT 0x880 diff --git a/src/content_mapnode_plants.cpp b/src/content_mapnode_plants.cpp new file mode 100644 index 0000000..8500c9d --- /dev/null +++ b/src/content_mapnode_plants.cpp @@ -0,0 +1,907 @@ +/************************************************************************ +* Minetest-c55 +* Copyright (C) 2010 celeron55, Perttu Ahola +* +* content_mapnode_special.cpp +* Copyright (C) Lisa 'darkrose' Milne 2014 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see +************************************************************************/ + +// For g_settings +#include "main.h" + +#include "content_mapnode.h" +#include "content_nodebox.h" +#include "content_list.h" +#include "content_craft.h" +#include "content_nodemeta.h" +#include "settings.h" + +void content_mapnode_plants(bool repeat) +{ + bool new_style_leaves = g_settings->getBool("new_style_leaves"); + content_t i; + ContentFeatures *f = NULL; + + + i = CONTENT_TREE; + f = &content_features(i); + f->description = std::string("Tree"); + f->setAllTextures("tree.png"); + f->setTexture(0, "tree_top.png"); + f->setTexture(1, "tree_top.png"); + f->setInventoryTextureCube("tree_top.png", "tree.png", "tree.png"); + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->flammable = 2; // can be set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->cook_result = std::string("CraftItem lump_of_charcoal 1"); + f->fuel_time = 30; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_APPLE_TREE; + f = &content_features(i); + f->description = std::string("Apple Tree"); + f->setAllTextures("apple_tree.png"); + f->setTexture(0, "apple_tree_top.png"); + f->setTexture(1, "apple_tree_top.png"); + f->setInventoryTextureCube("apple_tree_top.png", "apple_tree.png", "apple_tree.png"); + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->flammable = 2; // can be set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->cook_result = std::string("CraftItem lump_of_charcoal 1"); + f->fuel_time = 30; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_JUNGLETREE; + f = &content_features(i); + f->description = std::string("Jungle Tree"); + f->setAllTextures("jungletree.png"); + f->setTexture(0, "jungletree_top.png"); + f->setTexture(1, "jungletree_top.png"); + f->setInventoryTextureCube("jungletree_top.png", "jungletree.png", "jungletree.png"); + f->draw_type = CDT_CUBELIKE; + //f->is_ground_content = true; + f->flammable = 2; // can be set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->fuel_time = 30; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + + i = CONTENT_CONIFER_TREE; + f = &content_features(i); + f->description = std::string("Conifer Tree"); + f->setAllTextures("conifer_tree.png"); + f->setTexture(0, "conifer_tree_top.png"); + f->setTexture(1, "conifer_tree_top.png"); + f->is_ground_content = true; + f->flammable = 2; // can be set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->cook_result = std::string("CraftItem lump_of_charcoal 1"); + f->fuel_time = 30; + f->draw_type = CDT_NODEBOX; + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 0; + f->fuel_time = 25; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->setNodeBox(core::aabbox3d( + -0.4375*BS, + -0.5*BS, + -0.4375*BS, + 0.4375*BS, + 0.5*BS, + 0.4375*BS + )); + f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png"); + f->type = CMT_WOOD; + f->hardness = 0.8; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_YOUNG_TREE; + f = &content_features(i); + f->description = std::string("Young Tree"); + f->setAllTextures("tree.png"); + f->setTexture(0, "tree_top.png"); + f->setTexture(1, "tree_top.png"); + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->param_type = CPT_LIGHT; + content_nodebox_youngtree(f); + f->setInventoryTextureNodeBox(i,"tree_top.png", "tree.png", "tree.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->special_alternate_node = CONTENT_LEAVES; + f->fuel_time = 20; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + + i = CONTENT_YOUNG_JUNGLETREE; + f = &content_features(i); + f->description = std::string("Young Jungle Tree"); + f->setAllTextures("jungletree.png"); + f->setTexture(0, "jungletree_top.png"); + f->setTexture(1, "jungletree_top.png"); + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->param_type = CPT_LIGHT; + content_nodebox_youngtree(f); + f->setInventoryTextureNodeBox(i,"jungletree_top.png", "jungletree.png", "jungletree.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->special_alternate_node = CONTENT_JUNGLELEAVES; + f->fuel_time = 20; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + + i = CONTENT_YOUNG_APPLE_TREE; + f = &content_features(i); + f->description = std::string("Young Apple Tree"); + f->setAllTextures("apple_tree.png"); + f->setTexture(0, "apple_tree_top.png"); + f->setTexture(1, "apple_tree_top.png"); + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->param_type = CPT_LIGHT; + content_nodebox_youngtree(f); + f->setInventoryTextureNodeBox(i,"apple_tree_top.png", "apple_tree.png", "apple_tree.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->special_alternate_node = CONTENT_APPLE_LEAVES; + f->fuel_time = 20; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + + i = CONTENT_YOUNG_CONIFER_TREE; + f = &content_features(i); + f->description = std::string("Young Conifer Tree"); + f->setAllTextures("conifer_tree.png"); + f->setTexture(0, "conifer_tree_top.png"); + f->setTexture(1, "conifer_tree_top.png"); + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->param_type = CPT_LIGHT; + content_nodebox_youngtree(f); + f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->special_alternate_node = CONTENT_CONIFER_LEAVES; + f->fuel_time = 20; + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); + + i = CONTENT_JUNGLEGRASS; + f = &content_features(i); + f->description = std::string("Jungle Grass"); + f->setInventoryTexture("junglegrass.png"); + f->setAllTextures("junglegrass.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE_LGE; + //f->is_ground_content = true; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_LEAVES; + f = &content_features(i); + f->description = std::string("Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + //f->is_ground_content = true; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1"; + f->extra_dug_item_rarity = 20; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("decrafting",i); + lists::add("cooking",i); + + i = CONTENT_APPLE_LEAVES; + f = &content_features(i); + f->description = std::string("Apple Tree Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + //f->is_ground_content = true; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("apple_leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:apple_leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_SAPLING)+" 1"; + f->extra_dug_item_rarity = 20; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("decrafting",i); + lists::add("cooking",i); + + i = CONTENT_JUNGLELEAVES; + f = &content_features(i); + f->description = std::string("Jungle Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + //f->is_ground_content = true; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("jungleleaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:jungleleaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_JUNGLESAPLING)+" 1"; + f->extra_dug_item_rarity = 20; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("decrafting",i); + lists::add("cooking",i); + + i = CONTENT_CONIFER_LEAVES; + f = &content_features(i); + f->description = std::string("Conifer Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + //f->is_ground_content = true; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("conifer_leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:conifer_leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CONIFER_SAPLING)+" 1"; + f->extra_dug_item_rarity = 20; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("decrafting",i); + lists::add("cooking",i); + + i = CONTENT_TRIMMED_LEAVES; + f = &content_features(i); + f->description = std::string("Trimmed Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_TRIMMED_APPLE_LEAVES; + f = &content_features(i); + f->description = std::string("Trimmed Apple Tree Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("apple_leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:apple_leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_TRIMMED_JUNGLE_LEAVES; + f = &content_features(i); + f->description = std::string("Trimmed Jungle Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("jungleleaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:jungleleaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_TRIMMED_CONIFER_LEAVES; + f = &content_features(i); + f->description = std::string("Trimmed Conifer Leaves"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("conifer_leaves.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:conifer_leaves.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->cook_result = std::string("CraftItem lump_of_resin 1"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + lists::add("cooking",i); + + i = CONTENT_APPLE_BLOSSOM; + f = &content_features(i); + f->description = std::string("Apple Tree Blossom"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + //f->is_ground_content = true; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("apple_leaves.png^apple_blossom.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->extra_dug_item = std::string("CraftItem apple_blossom 1"); + f->extra_dug_item_rarity = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_LEAVES)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("decrafting",i); + + i = CONTENT_TRIMMED_APPLE_BLOSSOM; + f = &content_features(i); + f->description = std::string("Trimmed Apple Tree Blossom"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + if (new_style_leaves) { + f->draw_type = CDT_GLASSLIKE; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("apple_leaves.png^apple_blossom.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE); +#endif + f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png"); + }else{ + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png"); + } + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_PLANT; + f->hardness = 0.15; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_CACTUS_BLOSSOM; + f = &content_features(i); + f->description = std::string("Cactus Blossom"); + f->setInventoryTexture("cactus_blossom.png"); + f->setAllTextures("cactus_blossom.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_CACTUS_FLOWER; + f = &content_features(i); + f->description = std::string("Cactus Flower"); + f->setInventoryTexture("cactus_flower.png"); + f->setAllTextures("cactus_flower.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CACTUS_BLOSSOM)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + lists::add("decrafting",i); + + i = CONTENT_CACTUS_FRUIT; + f = &content_features(i); + f->description = std::string("Cactus Berry"); + f->setInventoryTexture("cactus_fruit.png"); + f->setAllTextures("cactus_fruit.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("CraftItem cactus_fruit 1"); + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_CACTUS; + f = &content_features(i); + f->description = std::string("Cactus"); + f->setAllTextures("cactus_side.png"); + f->setTexture(0, "cactus_top.png"); + f->setTexture(1, "cactus_top.png"); + f->draw_type = CDT_NODEBOX; + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->is_ground_content = true; + f->damage_per_second = 2; + f->solidness = 0; // drawn separately, makes no faces + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/4; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->setNodeBox(core::aabbox3d( + -0.4375*BS, + -0.5*BS, + -0.4375*BS, + 0.4375*BS, + 0.5*BS, + 0.4375*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + 0.3125*BS, + -0.5*BS, + -0.4375*BS, + 0.375*BS, + -0.4375*BS + )); + f->addNodeBox(core::aabbox3d( + 0.4375*BS, + 0.125*BS, + 0.4375*BS, + 0.5*BS, + 0.1875*BS, + 0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.4375*BS, + -0.1875*BS, + -0.5*BS, + 0.5*BS, + -0.125*BS, + -0.4375*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + -0.375*BS, + 0.4375*BS, + -0.4375*BS, + -0.3125*BS, + 0.5*BS + )); + f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png"); + f->type = CMT_WOOD; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_PAPYRUS; + f = &content_features(i); + f->description = std::string("Papyrus"); + f->setInventoryTexture("papyrus.png"); + f->setAllTextures("papyrus.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->type = CMT_WOOD; + f->hardness = 0.25; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_SAPLING; + f = &content_features(i); + f->description = std::string("Sapling"); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->setAllTextures("sapling.png"); + f->setInventoryTexture("sapling.png"); + f->setAllTextureFlags(0); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->light_propagates = true; + f->air_equivalent = false; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->type = CMT_WOOD; + f->hardness = 0.0; + lists::add("creative",i); + + i = CONTENT_APPLE_SAPLING; + f = &content_features(i); + f->description = std::string("Apple Tree Sapling"); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->setAllTextures("apple_sapling.png"); + f->setInventoryTexture("apple_sapling.png"); + f->setAllTextureFlags(0); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->light_propagates = true; + f->air_equivalent = false; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_JUNGLESAPLING; + f = &content_features(i); + f->description = std::string("Jungle Sapling"); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->setAllTextures("junglesapling.png"); + f->setInventoryTexture("junglesapling.png"); + f->setAllTextureFlags(0); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->light_propagates = true; + f->air_equivalent = false; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_CONIFER_SAPLING; + f = &content_features(i); + f->description = std::string("Conifer Sapling"); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->setAllTextures("conifer_sapling.png"); + f->setInventoryTexture("conifer_sapling.png"); + f->setAllTextureFlags(0); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->light_propagates = true; + f->air_equivalent = false; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_APPLE; + f = &content_features(i); + f->description = std::string("Apple"); + f->setInventoryTexture("apple.png"); + f->setAllTextures("apple.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE_SML; + f->light_propagates = true; + f->sunlight_propagates = true; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("CraftItem apple 1"); + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + // plants + i = CONTENT_WILDGRASS_SHORT; + f = &content_features(i); + f->description = std::string("Wild Grass"); + f->setInventoryTexture("wildgrass_short.png"); + f->setAllTextures("wildgrass_short.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + //f->pointable = false; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + + i = CONTENT_WILDGRASS_LONG; + f = &content_features(i); + f->description = std::string("Wild Grass"); + f->setInventoryTexture("wildgrass_long.png"); + f->setAllTextures("wildgrass_long.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->air_equivalent = false; // grass grows underneath + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WILDGRASS_SHORT)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + + i = CONTENT_DEADGRASS; + f = &content_features(i); + f->description = std::string("Dead Grass"); + f->setInventoryTexture("deadgrass.png"); + f->setAllTextures("deadgrass.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + + i = CONTENT_FLOWER_STEM; + f = &content_features(i); + f->description = std::string("Flower Stem"); + f->setInventoryTexture("flower_stem.png"); + f->setAllTextures("flower_stem.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + + i = CONTENT_FLOWER_ROSE; + f = &content_features(i); + f->description = std::string("Rose"); + f->setInventoryTexture("flower_rose.png"); + f->setAllTextures("flower_rose.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_FLOWER_DAFFODIL; + f = &content_features(i); + f->description = std::string("Daffodil"); + f->setInventoryTexture("flower_daffodil.png"); + f->setAllTextures("flower_daffodil.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); + + i = CONTENT_FLOWER_TULIP; + f = &content_features(i); + f->description = std::string("Tulip"); + f->setInventoryTexture("flower_tulip.png"); + f->setAllTextures("flower_tulip.png"); + f->setAllTextureFlags(0); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->material_pointable = false; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/32; + f->buildable_to = true; + f->type = CMT_WOOD; + f->hardness = 0.10; + f->pressure_type = CST_CRUSHABLE; + lists::add("creative",i); +} diff --git a/src/content_mapnode_special.cpp b/src/content_mapnode_special.cpp new file mode 100644 index 0000000..628f9c0 --- /dev/null +++ b/src/content_mapnode_special.cpp @@ -0,0 +1,1788 @@ +/************************************************************************ +* Minetest-c55 +* Copyright (C) 2010 celeron55, Perttu Ahola +* +* content_mapnode_special.cpp +* Copyright (C) Lisa 'darkrose' Milne 2014 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see +************************************************************************/ + +#include "content_mapnode.h" +#include "content_nodebox.h" +#include "content_list.h" +#include "content_craft.h" +#include "content_nodemeta.h" + +void content_mapnode_special(bool repeat) +{ + content_t i; + ContentFeatures *f = NULL; + + + i = CONTENT_FENCE; + f = &content_features(i); + f->description = std::string("Fence"); + f->setAllTextures("fence.png"); + f->setTexture(0,"fence_top.png"); + f->setTexture(1,"fence_top.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_FENCELIKE; + f->is_ground_content = true; + f->jumpable = false; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 15; + f->special_alternate_node = CONTENT_WOOD; + f->type = CMT_WOOD; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_fence_inv(f); + content_nodebox_fence(f); + f->setInventoryTextureNodeBox(i,"fence.png","fence_top.png","fence.png"); + crafting::setWallRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_FENCE); + crafting::setWallRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_FENCE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_RAIL; + f = &content_features(i); + f->description = std::string("Rail"); + f->setAllTextures("rail.png"); + f->setTexture(0,"track_tie.png"); + f->setTexture(1,"track_rail.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_RAILLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + f->type = CMT_DIRT; + f->hardness = 0.75; + { + u16 r[9] = { + CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_CRAFTITEM_WOOD_PLANK, CONTENT_CRAFTITEM_STEEL_INGOT, + CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_IGNORE, CONTENT_CRAFTITEM_STEEL_INGOT, + CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_CRAFTITEM_WOOD_PLANK, CONTENT_CRAFTITEM_STEEL_INGOT + }; + crafting::setRecipe(r,CONTENT_RAIL,15); + r[1] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[7] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + crafting::setRecipe(r,CONTENT_RAIL,15); + } + f->setNodeBox(core::aabbox3d( + -0.5*BS,-0.5*BS,-0.5*BS,0.5*BS,-0.375*BS,0.5*BS + )); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_TERRACOTTA; + f = &content_features(i); + f->description = std::string("Terracotta Roof Tile"); + f->setAllTextures("rooftile_terracotta.png"); + f->setAllTextureFlags(0); + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA,CONTENT_ROOFTILE_TERRACOTTA); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_WOOD; + f = &content_features(i); + f->description = std::string("Wood Roof Tile"); + f->setAllTextures("rooftile_wood.png"); + f->setAllTextureFlags(0); + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_WOOD,CONTENT_WOOD,CONTENT_ROOFTILE_WOOD); + crafting::set1over4Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLEWOOD,CONTENT_ROOFTILE_WOOD); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_ASPHALT; + f = &content_features(i); + f->description = std::string("Asphalt Roof Tile"); + f->setAllTextures("rooftile_asphalt.png"); + f->setAllTextureFlags(0); + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + { + u16 r[9] = { + CONTENT_SAND, CONTENT_CRAFTITEM_PAPER, CONTENT_IGNORE, + CONTENT_CRAFTITEM_PAPER, CONTENT_CRAFTITEM_DYE_BLACK, CONTENT_IGNORE, + CONTENT_IGNORE, CONTENT_IGNORE, CONTENT_IGNORE, + }; + crafting::setRecipe(r,CONTENT_ROOFTILE_ASPHALT,4); + } + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_STONE; + f = &content_features(i); + f->description = std::string("Stone Roof Tile"); + f->setAllTextures("rooftile_stone.png"); + f->setAllTextureFlags(0); + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE,CONTENT_ROOFTILE_STONE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS; + f = &content_features(i); + f->description = std::string("Glass Roof Tile"); + f->setAllTextures("glass.png"); + f->setTexture(1,"glass_slab.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS,CONTENT_GLASS,CONTENT_ROOFTILE_GLASS); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_BLUE; + f = &content_features(i); + f->description = std::string("Blue Glass Roof Tile"); + f->setAllTextures("glass_blue.png"); + f->setTexture(1,"glass_slab_blue.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_BLUE,CONTENT_GLASS_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_GREEN; + f = &content_features(i); + f->description = std::string("Green Glass Roof Tile"); + f->setAllTextures("glass_green.png"); + f->setTexture(1,"glass_slab_green.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_GREEN,CONTENT_GLASS_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Glass Roof Tile"); + f->setAllTextures("glass_orange.png"); + f->setTexture(1,"glass_slab_orange.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_ORANGE,CONTENT_GLASS_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Glass Roof Tile"); + f->setAllTextures("glass_purple.png"); + f->setTexture(1,"glass_slab_purple.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_PURPLE,CONTENT_GLASS_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_RED; + f = &content_features(i); + f->description = std::string("Red Glass Roof Tile"); + f->setAllTextures("glass_red.png"); + f->setTexture(1,"glass_slab_red.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_RED,CONTENT_GLASS_RED,CONTENT_ROOFTILE_GLASS_RED); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_RED,CONTENT_ROOFTILE_GLASS_RED); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Glass Roof Tile"); + f->setAllTextures("glass_yellow.png"); + f->setTexture(1,"glass_slab_yellow.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_YELLOW,CONTENT_GLASS_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_GLASS_BLACK; + f = &content_features(i); + f->description = std::string("Black Glass Roof Tile"); + f->setAllTextures("glass_black.png"); + f->setTexture(1,"glass_slab_black.png"); // special texture for top sections + f->setAllTextureFlags(0); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_GLASS_BLACK,CONTENT_GLASS_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); + crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROOFTILE_THATCH; + f = &content_features(i); + f->description = std::string("Thatch Roof Tile"); + f->setAllTextures("rooftile_thatch.png"); + f->setAllTextureFlags(0); + f->draw_type = CDT_ROOFLIKE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->type = CMT_DIRT; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_roofcollide(f); + crafting::set1over4Recipe(CONTENT_DEADGRASS,CONTENT_DEADGRASS,CONTENT_ROOFTILE_THATCH); + crafting::set1over4Recipe(CONTENT_WILDGRASS_SHORT,CONTENT_WILDGRASS_SHORT,CONTENT_ROOFTILE_THATCH); + crafting::set1over4Recipe(CONTENT_JUNGLEGRASS,CONTENT_JUNGLEGRASS,CONTENT_ROOFTILE_THATCH); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_LADDER_LEGACY; + f = &content_features(i); + f->description = std::string("Ladder"); + f->setAllTextures("ladder.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; + f->solidness = 0; + f->floormount_alternate_node = CONTENT_LADDER_FLOOR; + f->wallmount_alternate_node = CONTENT_LADDER_WALL; + f->roofmount_alternate_node = CONTENT_LADDER_ROOF; + f->rotate_tile_with_nodebox = true; + f->climbable = true; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->type = CMT_WOOD; + f->hardness = 0.5; + f->pressure_type = CST_CRUSHABLE; + f->setNodeBox(core::aabbox3d( + -0.4375*BS,-0.5*BS,0.3125*BS,-0.3125*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3125*BS,-0.5*BS,0.3125*BS,0.4375*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,-0.25*BS,0.375*BS,0.3125*BS,-0.1875*BS,0.4375*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,0.25*BS,0.375*BS,0.3125*BS,0.3125*BS,0.4375*BS + )); + f->setInventoryTextureNodeBox(i,"ladder.png","ladder.png","ladder.png"); + + i = CONTENT_LADDER_WALL; + f = &content_features(i); + f->description = std::string("Ladder"); + f->setAllTextures("ladder.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->solidness = 0; + f->floormount_alternate_node = CONTENT_LADDER_FLOOR; + f->roofmount_alternate_node = CONTENT_LADDER_ROOF; + f->rotate_tile_with_nodebox = true; + f->climbable = true; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->type = CMT_WOOD; + f->hardness = 0.5; + f->pressure_type = CST_CRUSHABLE; + f->setNodeBox(core::aabbox3d( + -0.4375*BS,-0.5*BS,0.3125*BS,-0.3125*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3125*BS,-0.5*BS,0.3125*BS,0.4375*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,-0.25*BS,0.375*BS,0.3125*BS,-0.1875*BS,0.4375*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,0.25*BS,0.375*BS,0.3125*BS,0.3125*BS,0.4375*BS + )); + f->setInventoryTextureNodeBox(i,"ladder.png","ladder.png","ladder.png"); + { + u16 r[9] = { + CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK, + CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK, + CONTENT_CRAFTITEM_PINE_PLANK, CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PINE_PLANK + }; + crafting::setRecipe(r,CONTENT_LADDER_WALL,4); + r[0] = CONTENT_CRAFTITEM_WOOD_PLANK; + r[2] = CONTENT_CRAFTITEM_WOOD_PLANK; + r[3] = CONTENT_CRAFTITEM_WOOD_PLANK; + r[5] = CONTENT_CRAFTITEM_WOOD_PLANK; + r[6] = CONTENT_CRAFTITEM_WOOD_PLANK; + r[8] = CONTENT_CRAFTITEM_WOOD_PLANK; + crafting::setRecipe(r,CONTENT_LADDER_WALL,4); + r[0] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[2] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[3] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[5] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[6] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + r[8] = CONTENT_CRAFTITEM_JUNGLE_PLANK; + crafting::setRecipe(r,CONTENT_LADDER_WALL,4); + } + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_LADDER_FLOOR; + f = &content_features(i); + f->description = std::string("Ladder"); + f->setAllTextures("ladder.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; + f->solidness = 0; + f->wallmount_alternate_node = CONTENT_LADDER_WALL; + f->roofmount_alternate_node = CONTENT_LADDER_ROOF; + f->rotate_tile_with_nodebox = true; + f->climbable = true; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->type = CMT_WOOD; + f->hardness = 0.5; + f->pressure_type = CST_CRUSHABLE; + f->setNodeBox(core::aabbox3d( + -0.4375*BS,-0.5*BS,-0.5*BS,-0.3125*BS,-0.3125*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3125*BS,-0.5*BS,-0.5*BS,0.4375*BS,-0.3125*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,-0.4375*BS,-0.3125*BS,0.3125*BS,-0.375*BS,-0.25*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,-0.4375*BS,0.1875*BS,0.3125*BS,-0.375*BS,0.25*BS + )); + + i = CONTENT_LADDER_ROOF; + f = &content_features(i); + f->description = std::string("Ladder"); + f->setAllTextures("ladder.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(CONTENT_LADDER_WALL)+" 1"; + f->solidness = 0; + f->floormount_alternate_node = CONTENT_LADDER_FLOOR; + f->wallmount_alternate_node = CONTENT_LADDER_WALL; + f->rotate_tile_with_nodebox = true; + f->climbable = true; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 30/16; + f->type = CMT_WOOD; + f->hardness = 0.5; + f->pressure_type = CST_CRUSHABLE; + f->setNodeBox(core::aabbox3d( + -0.4375*BS,0.3125*BS,-0.5*BS,-0.3125*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3125*BS,0.3125*BS,-0.5*BS,0.4375*BS,0.5*BS,0.5*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,0.375*BS,-0.3125*BS,0.3125*BS,0.4375*BS,-0.25*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3125*BS,0.375*BS,0.1875*BS,0.3125*BS,0.4375*BS,0.25*BS + )); + + i = CONTENT_BORDERSTONE; + f = &content_features(i); + f->description = std::string("Border Stone"); + f->setAllTextures("borderstone.png"); + f->setInventoryTextureCube("borderstone.png", "borderstone.png", "borderstone.png"); + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new BorderStoneNodeMetadata(); + f->type = CMT_STONE; + f->hardness = 2.0; + f->pressure_type = CST_SOLID; + crafting::setFilledRoundRecipe(CONTENT_STONE,CONTENT_MESE,CONTENT_BORDERSTONE); + { + u16 r[9] = { + CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT, + CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, + CONTENT_CRAFTITEM_STEEL_INGOT, CONTENT_STONE, CONTENT_CRAFTITEM_STEEL_INGOT + }; + crafting::setRecipe(r,CONTENT_BORDERSTONE,1); + } + lists::add("craftguide",i); + lists::add("player-creative",i); + lists::add("creative",i); + + i = CONTENT_BOOK; + f = &content_features(i); + f->description = std::string("Book"); + f->setTexture(0, "book_cover.png"); + f->setTexture(1, "book_cover.png^[transformFX"); + f->setTexture(2, "book_side.png^[transformFY"); + f->setTexture(3, "book_side.png"); + f->setTexture(4, "book_end.png"); + f->setTexture(5, "book_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_cover.png", "book_end.png^[transformFX", "book_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,i); + lists::add("craftguide",i); + lists::add("creative",i); + if (f->initial_metadata == NULL) + f->initial_metadata = new ClosedBookNodeMetadata(); + + i = CONTENT_COOK_BOOK; + f = &content_features(i); + f->description = std::string("Cook Book"); + f->setTexture(0, "book_cook_cover.png"); + f->setTexture(1, "book_cook_cover.png^[transformFX"); + f->setTexture(2, "book_cook_side.png^[transformFY"); + f->setTexture(3, "book_cook_side.png"); + f->setTexture(4, "book_cook_end.png"); + f->setTexture(5, "book_cook_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_COOK_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_cook_cover.png", "book_cook_end.png^[transformFX", "book_cook_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_COAL,i); + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_CHARCOAL,i); + lists::add("craftguide",i); + lists::add("creative",i); + if (f->initial_metadata == NULL) + f->initial_metadata = new ClosedBookNodeMetadata(); + + i = CONTENT_DECRAFT_BOOK; + f = &content_features(i); + f->description = std::string("Decraft Book"); + f->setTexture(0, "book_decraft_cover.png"); + f->setTexture(1, "book_decraft_cover.png^[transformFX"); + f->setTexture(2, "book_decraft_side.png^[transformFY"); + f->setTexture(3, "book_decraft_side.png"); + f->setTexture(4, "book_decraft_end.png"); + f->setTexture(5, "book_decraft_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DECRAFT_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_decraft_cover.png", "book_decraft_end.png^[transformFX", "book_decraft_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_GUNPOWDER,i); + lists::add("craftguide",i); + lists::add("creative",i); + if (f->initial_metadata == NULL) + f->initial_metadata = new ClosedBookNodeMetadata(); + + i = CONTENT_DIARY_BOOK; + f = &content_features(i); + f->description = std::string("Diary"); + f->setTexture(0, "book_diary_cover.png"); + f->setTexture(1, "book_diary_cover.png^[transformFX"); + f->setTexture(2, "book_diary_side.png^[transformFY"); + f->setTexture(3, "book_diary_side.png"); + f->setTexture(4, "book_diary_end.png"); + f->setTexture(5, "book_diary_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DIARY_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_diary_cover.png", "book_diary_end.png^[transformFX", "book_diary_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_STEEL_INGOT,i); + if (f->initial_metadata == NULL) + f->initial_metadata = new ClosedBookNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_CRAFT_BOOK; + f = &content_features(i); + f->description = std::string("Craft Book"); + f->setTexture(0, "book_craft_cover.png"); + f->setTexture(1, "book_craft_cover.png^[transformFX"); + f->setTexture(2, "book_craft_side.png^[transformFY"); + f->setTexture(3, "book_craft_side.png"); + f->setTexture(4, "book_craft_end.png"); + f->setTexture(5, "book_craft_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_CRAFT_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_craft_cover.png", "book_craft_end.png^[transformFX", "book_craft_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_MESE,i); + { + content_t r[9] = { + CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, + CONTENT_IGNORE, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, + CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_IGNORE + }; + crafting::setRecipe(r,CONTENT_CRAFT_BOOK,1); + } + if (f->initial_metadata == NULL) + f->initial_metadata = new ClosedBookNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Guide"); + f->setAllTextures("guide_side.png"); + f->setTexture(0, "guide_top.png"); + f->setTexture(1, "guide_bottom.png"); + f->setTexture(4, "guide_end.png"); + f->setTexture(5, "guide_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_BOOK)+" 1"; + f->solidness = 0; + content_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_top.png", "guide_end.png", "guide_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + if (f->initial_metadata == NULL) + f->initial_metadata = new BookNodeMetadata(); + + i = CONTENT_COOK_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Cooking Guide"); + f->setAllTextures("guide_cook_side.png"); + f->setTexture(0, "guide_cook_top.png"); + f->setTexture(1, "guide_cook_bottom.png"); + f->setTexture(4, "guide_cook_end.png"); + f->setTexture(5, "guide_cook_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_COOK_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COOK_BOOK)+" 1"; + f->solidness = 0; + content_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_cook_top.png", "guide_cook_end.png", "guide_cook_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + if (f->initial_metadata == NULL) + f->initial_metadata = new CookBookNodeMetadata(); + + i = CONTENT_DECRAFT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Decrafting Guide"); + f->setAllTextures("guide_decraft_side.png"); + f->setTexture(0, "guide_decraft_top.png"); + f->setTexture(1, "guide_decraft_bottom.png"); + f->setTexture(4, "guide_decraft_end.png"); + f->setTexture(5, "guide_decraft_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DECRAFT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DECRAFT_BOOK)+" 1"; + f->solidness = 0; + content_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_decraft_top.png", "guide_decraft_end.png", "guide_decraft_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + if (f->initial_metadata == NULL) + f->initial_metadata = new DeCraftNodeMetadata(); + + i = CONTENT_DIARY_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Diary"); + f->setAllTextures("guide_diary_side.png"); + f->setTexture(0, "guide_diary_top.png"); + f->setTexture(1, "guide_diary_bottom.png"); + f->setTexture(4, "guide_diary_end.png"); + f->setTexture(5, "guide_diary_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DIARY_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DIARY_BOOK)+" 1"; + f->solidness = 0; + content_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_diary_top.png", "guide_diary_end.png", "guide_diary_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + if (f->initial_metadata == NULL) + f->initial_metadata = new DiaryNodeMetadata(); + + i = CONTENT_CRAFT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Craft Guide"); + f->setAllTextures("guide_craft_side.png"); + f->setTexture(0, "guide_craft_top.png"); + f->setTexture(1, "guide_craft_bottom.png"); + f->setTexture(4, "guide_craft_end.png"); + f->setTexture(5, "guide_craft_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_CRAFT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CRAFT_BOOK)+" 1"; + f->solidness = 0; + content_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_craft_top.png", "guide_craft_end.png", "guide_craft_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + f->pressure_type = CST_CRUSHABLE; + if (f->initial_metadata == NULL) + f->initial_metadata = new CraftGuideNodeMetadata(); + + i = CONTENT_FIRE; + f = &content_features(i); + f->description = std::string("Fire"); + f->setAllTextures("fire.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_FIRELIKE; + f->light_propagates = true; + f->light_source = LIGHT_MAX-1; + f->solidness = 0; // Drawn separately, makes no faces + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 4*2; +#ifndef SERVER + f->post_effect_color = video::SColor(192, 255, 64, 0); +#endif + f->pressure_type = CST_CRUSHED; + + i = CONTENT_FIRE_SHORTTERM; + f = &content_features(i); + f->description = std::string("Fire"); + f->setAllTextures("fire.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_FIRELIKE; + f->light_propagates = true; + f->light_source = LIGHT_MAX-1; + f->solidness = 0; // Drawn separately, makes no faces + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 4*2; +#ifndef SERVER + f->post_effect_color = video::SColor(192, 255, 64, 0); +#endif + f->pressure_type = CST_CRUSHED; + + i = CONTENT_TORCH_LEGACY; + f = &content_features(i); + f->description = std::string("Torch"); + f->setAllTextures("torch.png"); + f->setInventoryTexture("torch_inventory.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_TORCHLIKE; + f->light_propagates = true; + f->sunlight_propagates = true; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 0.5; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_TORCH)+" 1"; + f->light_source = LIGHT_MAX-1; + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHED; + + i = CONTENT_TORCH; + f = &content_features(i); + f->description = std::string("Torch"); + f->setAllTextures("torch.png"); + f->setInventoryTexture("torch_inventory.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_TORCHLIKE; + f->light_propagates = true; + f->sunlight_propagates = true; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 0.5; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->light_source = LIGHT_MAX-1; + f->type = CMT_WOOD; + f->hardness = 0.0; + f->pressure_type = CST_CRUSHABLE; + crafting::set1over4Recipe(CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); + crafting::set1over4Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); + lists::add("craftguide",i); + lists::add("player-creative",i); + lists::add("creative",i); + + i = CONTENT_SIGN_WALL; + f = &content_features(i); + f->description = std::string("Sign"); + f->setAllTextures("sign_wall.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_NODEBOX; + f->light_propagates = true; + f->sunlight_propagates = true; + f->floormount_alternate_node = CONTENT_SIGN; + f->roofmount_alternate_node = CONTENT_SIGN_UD; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new SignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign_wall(f); + + i = CONTENT_SIGN; + f = &content_features(i); + f->description = std::string("Sign"); + f->setAllTextures("sign.png"); + f->setTexture(4, "sign_back.png"); + f->setTexture(5, "sign_front.png"); // Z- + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_SIGN_WALL; + f->roofmount_alternate_node = CONTENT_SIGN_UD; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new SignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign(f); + f->setInventoryTextureNodeBox(i,"sign.png", "sign_front.png", "sign.png"); + crafting::setSignRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_SIGN); + crafting::setSignRecipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_SIGN); + crafting::setSignRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_SIGN); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_SIGN_UD; + f = &content_features(i); + f->description = std::string("Sign"); + f->setAllTextures("sign.png"); + f->setTexture(4, "sign_back_ud.png"); + f->setTexture(5, "sign_front_ud.png"); // Z- + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_SIGN_WALL; + f->floormount_alternate_node = CONTENT_SIGN; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new SignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign_ud(f); + f->setInventoryTextureNodeBox(i,"sign.png", "sign_front.png", "sign.png"); + + i = CONTENT_LOCKABLE_SIGN_WALL; + f = &content_features(i); + f->description = std::string("Locking Sign"); + f->setAllTextures("sign.png"); + f->setTexture(4, "sign_back.png"); + f->setTexture(5, "sign_wall_lock.png"); // Z- + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_WALLMOUNT; + f->draw_type = CDT_NODEBOX; + f->light_propagates = true; + f->sunlight_propagates = true; + f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; + f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + f->air_equivalent = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_LOCKABLE_SIGN)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new LockingSignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign_wall(f); + + i = CONTENT_LOCKABLE_SIGN; + f = &content_features(i); + f->description = std::string("Locking Sign"); + f->setAllTextures("sign.png"); + f->setTexture(4, "sign_back.png"); + f->setTexture(5, "sign_lock.png"); // Z- + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; + f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new LockingSignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign(f); + f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); + crafting::set1Any2Recipe(CONTENT_SIGN,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_SIGN); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_LOCKABLE_SIGN_UD; + f = &content_features(i); + f->description = std::string("Locking Sign"); + f->setAllTextures("sign.png"); + f->setTexture(4, "sign_back_ud.png"); + f->setTexture(5, "sign_lock_ud.png"); // Z- + f->param_type = CPT_LIGHT; + f->light_propagates = true; + f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; + f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->solidness = 0; // drawn separately, makes no faces + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + f->fuel_time = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_LOCKABLE_SIGN)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new LockingSignNodeMetadata("Some sign"); + f->type = CMT_WOOD; + f->hardness = 0.1; + f->pressure_type = CST_CRUSHABLE; + content_nodebox_sign_ud(f); + f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); + + i = CONTENT_CHEST; + f = &content_features(i); + f->description = std::string("Chest"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("chest_side.png"); + f->setTexture(0, "chest_top.png"); + f->setTexture(1, "chest_top.png"); + f->setTexture(5, "chest_front.png"); // Z- + f->setInventoryTexture("chest_top.png"); + f->setInventoryTextureCube("chest_top.png", "chest_front.png", "chest_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new ChestNodeMetadata(); + f->type = CMT_WOOD; + f->hardness = 1.0; + f->pressure_type = CST_SOLID; + crafting::setRoundRecipe(CONTENT_WOOD,CONTENT_CHEST); + crafting::setRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CHEST); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_CREATIVE_CHEST; + f = &content_features(i); + f->description = std::string("Creative Chest"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("chest_side.png"); + f->setTexture(0, "chest_top.png"); + f->setTexture(1, "chest_top.png"); + f->setTexture(5, "chest_creative.png"); // Z- + f->setInventoryTexture("chest_top.png"); + f->setInventoryTextureCube("chest_top.png", "chest_creative.png", "chest_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new CreativeChestNodeMetadata(); + f->type = CMT_WOOD; + f->hardness = 1.0; + f->pressure_type = CST_SOLID; + lists::add("player-creative",i); + lists::add("creative",i); + + i = CONTENT_LOCKABLE_CHEST; + f = &content_features(i); + f->description = std::string("Locking Chest"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("chest_side.png"); + f->setTexture(0, "chest_top.png"); + f->setTexture(1, "chest_top.png"); + f->setTexture(5, "chest_lock.png"); // Z- + f->setInventoryTexture("chest_lock.png"); + f->setInventoryTextureCube("chest_top.png", "chest_lock.png", "chest_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new LockingChestNodeMetadata(); + f->type = CMT_WOOD; + f->hardness = 1.0; + f->pressure_type = CST_SOLID; + crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); + crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FURNACE; + f = &content_features(i); + f->description = std::string("Furnace"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("furnace_side.png"); + f->setTexture(0, "furnace_top.png"); + f->setTexture(1, "furnace_top.png"); + f->setTexture(5, "furnace_front.png"); // Z- + f->setInventoryTextureCube("furnace_top.png", "furnace_front.png", "furnace_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new FurnaceNodeMetadata(); + f->type = CMT_STONE; + f->hardness = 3.0; + f->pressure_type = CST_SOLID; + crafting::setRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_FURNACE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_LOCKABLE_FURNACE; + f = &content_features(i); + f->description = std::string("Locking Furnace"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("furnace_side.png"); + f->setTexture(0, "furnace_top.png"); + f->setTexture(1, "furnace_top.png"); + f->setTexture(5, "furnace_lock.png"); // Z- + f->setInventoryTextureCube("furnace_top.png", "furnace_lock.png", "furnace_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new LockingFurnaceNodeMetadata(); + f->type = CMT_STONE; + f->hardness = 3.0; + f->pressure_type = CST_SOLID; + crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); + crafting::set1Any2Recipe(CONTENT_FURNACE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_INCINERATOR; + f = &content_features(i); + f->description = std::string("Incinerator"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("incinerator_side.png"); + f->setTexture(0, "incinerator_top.png"); // Z- + f->setTexture(1, "incinerator_top.png"); // Z- + f->setTexture(5, "incinerator_front.png"); // Z- + f->setInventoryTextureCube("incinerator_top.png", "incinerator_front.png", "incinerator_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new IncineratorNodeMetadata(); + f->type = CMT_STONE; + f->hardness = 0.4; + f->pressure_type = CST_SOLID; + crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_MESE,CONTENT_INCINERATOR); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_NC; + f = &content_features(i); + f->description = std::string("Nyan Cat"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("nc_side.png"); + f->setTexture(5, "nc_front.png"); // Z- + f->setTexture(4, "nc_back.png"); // Z+ + f->setInventoryTextureCube("nc_front.png", "nc_side.png", "nc_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_STONE; + f->hardness = 3.0; + lists::add("creative",i); + + i = CONTENT_NC_RB; + f = &content_features(i); + f->description = std::string("Rainbow"); + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("nc_rb.png"); + f->setInventoryTextureCube("nc_rb.png", "nc_rb.png", "nc_rb.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_STONE; + f->hardness = 3.0; + lists::add("creative",i); + + i = CONTENT_FLOWER_POT_RAW; + f = &content_features(i); + f->param_type = CPT_LIGHT; + f->description = std::string("Unbaked Flower Pot"); + f->setAllTextures("flower_pot_raw.png"); + f->setTexture(0,"flower_pot_raw_top.png"); + f->setTexture(1,"flower_pot_raw_bottom.png"); + f->draw_type = CDT_NODEBOX; + f->light_propagates = true; + f->sunlight_propagates = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->cook_result = std::string("MaterialItem2 ")+itos(CONTENT_FLOWER_POT)+" 1"; + f->type = CMT_STONE; + f->hardness = 0.75; + f->pressure_type = CST_CRUSHABLE; + f->setNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + -0.5*BS, + 0.5*BS, + 0.5*BS, + -0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + 0.3*BS, + 0.5*BS, + 0.5*BS, + 0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3*BS, + 0.2*BS, + -0.3*BS, + 0.5*BS, + 0.5*BS, + 0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + -0.3*BS, + -0.3*BS, + 0.5*BS, + 0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3*BS, + -0.5*BS, + -0.3*BS, + 0.3*BS, + 0.35*BS, + 0.3*BS + )); + f->setInventoryTextureNodeBox(i,"flower_pot_raw_top.png","flower_pot_raw.png","flower_pot_raw.png"); + crafting::setVRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_FLOWER_POT_RAW); + lists::add("craftguide",i); + lists::add("cooking",i); + + i = CONTENT_FLOWER_POT; + f = &content_features(i); + f->param_type = CPT_LIGHT; + f->description = std::string("Flower Pot"); + f->setAllTextures("flower_pot.png"); + f->setTexture(0,"flower_pot_top.png"); + f->setTexture(1,"flower_pot_bottom.png"); + f->draw_type = CDT_NODEBOX; + f->light_propagates = true; + f->sunlight_propagates = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->type = CMT_STONE; + f->hardness = 0.75; + f->setNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + -0.5*BS, + 0.5*BS, + 0.5*BS, + -0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + 0.3*BS, + 0.5*BS, + 0.5*BS, + 0.5*BS + )); + f->addNodeBox(core::aabbox3d( + 0.3*BS, + 0.2*BS, + -0.3*BS, + 0.5*BS, + 0.5*BS, + 0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.5*BS, + 0.2*BS, + -0.3*BS, + -0.3*BS, + 0.5*BS, + 0.3*BS + )); + f->addNodeBox(core::aabbox3d( + -0.3*BS, + -0.5*BS, + -0.3*BS, + 0.3*BS, + 0.35*BS, + 0.3*BS + )); + f->setInventoryTextureNodeBox(i,"flower_pot_top.png","flower_pot.png","flower_pot.png"); + lists::add("creative",i); + + // walls + i = CONTENT_COBBLE_WALL; + f = &content_features(i); + f->description = std::string("Cobblestone Wall"); + f->setAllTextures("cobble.png"); + f->light_propagates = true; + f->jumpable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_WALLLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_wall_inv(f); + content_nodebox_wall(f); + f->setInventoryTextureNodeBox(i,"cobble.png","cobble.png","cobble.png"); + f->special_alternate_node = CONTENT_COBBLE; + f->type = CMT_STONE; + f->hardness = 0.9; + crafting::setWallRecipe(CONTENT_COBBLE,CONTENT_COBBLE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_ROUGHSTONE_WALL; + f = &content_features(i); + f->description = std::string("Rough Stone Wall"); + f->setAllTextures("roughstone.png"); + f->light_propagates = true; + f->jumpable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_WALLLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_wall_inv(f); + content_nodebox_wall(f); + f->setInventoryTextureNodeBox(i,"roughstone.png","roughstone.png","roughstone.png"); + f->special_alternate_node = CONTENT_ROUGHSTONE; + f->type = CMT_STONE; + f->hardness = 0.9; + crafting::setWallRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_MOSSYCOBBLE_WALL; + f = &content_features(i); + f->description = std::string("Mossy Cobblestone Wall"); + f->setAllTextures("mossycobble.png"); + f->light_propagates = true; + f->jumpable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_WALLLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_wall_inv(f); + content_nodebox_wall(f); + f->setInventoryTextureNodeBox(i,"mossycobble.png","mossycobble.png","mossycobble.png"); + f->special_alternate_node = CONTENT_MOSSYCOBBLE; + f->type = CMT_STONE; + f->hardness = 0.8; + crafting::setWallRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_STONE_WALL; + f = &content_features(i); + f->description = std::string("Stone Wall"); + f->setAllTextures("stone.png"); + f->light_propagates = true; + f->jumpable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_WALLLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_wall_inv(f); + content_nodebox_wall(f); + f->setInventoryTextureNodeBox(i,"stone.png","stone.png","stone.png"); + f->special_alternate_node = CONTENT_STONE; + f->type = CMT_STONE; + f->hardness = 1.0; + crafting::setWallRecipe(CONTENT_STONE,CONTENT_STONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_SANDSTONE_WALL; + f = &content_features(i); + f->description = std::string("Sand Stone Wall"); + f->setAllTextures("sandstone.png"); + f->light_propagates = true; + f->jumpable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_SPECIAL; + f->draw_type = CDT_WALLLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_wall_inv(f); + content_nodebox_wall(f); + f->setInventoryTextureNodeBox(i,"sandstone.png","sandstone.png","sandstone.png"); + f->special_alternate_node = CONTENT_SANDSTONE; + f->type = CMT_DIRT; + f->hardness = 1.0; + crafting::setWallRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_TNT; + f = &content_features(i); + f->description = std::string("TNT"); + f->setAllTextures("tnt.png"); + f->setTexture(0, "tnt_top.png"); + f->setTexture(1, "tnt_bottom.png"); + f->setInventoryTextureCube("tnt_top.png", "tnt.png", "tnt.png"); + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->energy_type = CET_CONDUCTIVE; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new TNTNodeMetadata(); + f->type = CMT_DIRT; + f->hardness = 1.0; + crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_TNT,CONTENT_TNT); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLASH; + f = &content_features(i); + f->description = std::string("In-Progress explosion - how did you get this???"); + f->setAllTextures("flash.png"); + f->solidness = 0; // drawn separately, makes no faces + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->light_propagates = true; + f->light_source = LIGHT_MAX-1; + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 50; + f->pressure_type = CST_CRUSHED; +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); + f->post_effect_color = video::SColor(192, 255, 255, 64); +#endif + + i = CONTENT_STEAM; + f = &content_features(i); + f->description = std::string("Steam"); + f->setAllTextures("steam.png"); + f->solidness = 0; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->light_propagates = true; + f->sunlight_propagates = true; + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 4; + f->pressure_type = CST_CRUSHED; +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); + f->post_effect_color = video::SColor(120, 200, 200, 200); +#endif + + // flags + i = CONTENT_FLAG; + f = &content_features(i); + f->description = std::string("Home Flag"); + f->setAllTextures("flag.png"); + f->setTexture(4,"flag.png^[transformFX"); + f->setTexture(2,"flag_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag.png","flag.png","flag_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + { + content_t r[9] = { + CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_PAPER, CONTENT_IGNORE, + CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_IGNORE, + CONTENT_IGNORE, CONTENT_IGNORE, CONTENT_IGNORE + }; + crafting::setRecipe(r,CONTENT_FLAG,1); + } + crafting::set1Any2Recipe(CONTENT_FLAG_BLUE,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_BLUE,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_GREEN,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_GREEN,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_ORANGE,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_ORANGE,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_PURPLE,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_PURPLE,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_RED,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_RED,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_YELLOW,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_BLACK,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_FLAG); + crafting::set1Any2Recipe(CONTENT_FLAG_BLACK,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_BLUE; + f = &content_features(i); + f->description = std::string("Blue Home Flag"); + f->setAllTextures("flag_blue.png"); + f->setTexture(4,"flag_blue.png^[transformFX"); + f->setTexture(2,"flag_blue_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_blue.png","flag_blue.png","flag_blue_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_FLAG_BLUE); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_GREEN; + f = &content_features(i); + f->description = std::string("Green Home Flag"); + f->setAllTextures("flag_green.png"); + f->setTexture(4,"flag_green.png^[transformFX"); + f->setTexture(2,"flag_green_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_green.png","flag_green.png","flag_green_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_FLAG_GREEN); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Home Flag"); + f->setAllTextures("flag_orange.png"); + f->setTexture(4,"flag_orange.png^[transformFX"); + f->setTexture(2,"flag_orange_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_orange.png","flag_orange.png","flag_orange_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_FLAG_ORANGE); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Home Flag"); + f->setAllTextures("flag_purple.png"); + f->setTexture(4,"flag_purple.png^[transformFX"); + f->setTexture(2,"flag_purple_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_purple.png","flag_purple.png","flag_purple_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_FLAG_PURPLE); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_RED; + f = &content_features(i); + f->description = std::string("Red Home Flag"); + f->setAllTextures("flag_red.png"); + f->setTexture(4,"flag_red.png^[transformFX"); + f->setTexture(2,"flag_red_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_red.png","flag_red.png","flag_red_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_RED,CONTENT_FLAG_RED); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Home Flag"); + f->setAllTextures("flag_yellow.png"); + f->setTexture(4,"flag_yellow.png^[transformFX"); + f->setTexture(2,"flag_yellow_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_yellow.png","flag_yellow.png","flag_yellow_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_FLAG_YELLOW); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_FLAG_BLACK; + f = &content_features(i); + f->description = std::string("Black Home Flag"); + f->setAllTextures("flag_black.png"); + f->setTexture(4,"flag_black.png^[transformFX"); + f->setTexture(2,"flag_black_end.png"); + f->setTexture(3,"flag_post.png"); + f->light_propagates = true; + f->walkable = false; + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->rotate_tile_with_nodebox = true; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + content_nodebox_flag(f); + f->setInventoryTextureNodeBox(i,"flag_black.png","flag_black.png","flag_black_end.png"); + f->home_node = true; + f->type = CMT_WOOD; + f->hardness = 0.4; + crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_FLAG_BLACK); + if(f->initial_metadata == NULL) + f->initial_metadata = new FlagNodeMetadata(); + lists::add("craftguide",i); + lists::add("creative",i); +} diff --git a/src/content_nodebox.cpp b/src/content_nodebox.cpp index 64cee06..916159a 100644 --- a/src/content_nodebox.cpp +++ b/src/content_nodebox.cpp @@ -1411,3 +1411,13 @@ void content_nodebox_youngtree(ContentFeatures *f) )); } +void content_nodebox_flag(ContentFeatures *f) +{ + f->setNodeBox(core::aabbox3d( + -0.4375*BS,-0.5*BS,-0.1875*BS,-0.25*BS,0.5*BS,0.*BS + )); + f->addNodeBox(core::aabbox3d( + -0.25*BS,0.*BS,-0.125*BS,0.4375*BS,0.4375*BS,-0.0625*BS + )); +} + diff --git a/src/content_nodebox.h b/src/content_nodebox.h index 273f184..cd8abc2 100644 --- a/src/content_nodebox.h +++ b/src/content_nodebox.h @@ -62,5 +62,6 @@ void content_nodebox_fence(ContentFeatures *f); void content_nodebox_wall_inv(ContentFeatures *f); void content_nodebox_wall(ContentFeatures *f); void content_nodebox_youngtree(ContentFeatures *f); +void content_nodebox_flag(ContentFeatures *f); #endif diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 0300096..e1f1d8e 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -114,6 +114,42 @@ std::string LockingSignNodeMetadata::getDrawSpecString() return std::string("field[text;;") + m_text + "]"; } +/* + FlagNodeMetadata +*/ + +// Prototype +FlagNodeMetadata proto_FlagNodeMetadata(); + +FlagNodeMetadata::FlagNodeMetadata() +{ + NodeMetadata::registerType(typeId(), create); +} +u16 FlagNodeMetadata::typeId() const +{ + return CONTENT_FLAG; +} +NodeMetadata* FlagNodeMetadata::create(std::istream &is) +{ + FlagNodeMetadata *d = new FlagNodeMetadata(); + d->setOwner(deSerializeString(is)); + return d; +} +NodeMetadata* FlagNodeMetadata::clone() +{ + FlagNodeMetadata *d = new FlagNodeMetadata(); + d->m_owner = m_owner; + return d; +} +void FlagNodeMetadata::serializeBody(std::ostream &os) +{ + os<getTexture(getTexturePath("menulogo.png").c_str()); if (logotexture) { - core::rect rect(x-100,y-90,x+100,y+110); + core::rect rect(x-100,y-150,x+100,y+50); driver->draw2DImage(logotexture, rect, core::rect(core::position2d(0,0), core::dimension2di(logotexture->getSize())), @@ -695,7 +695,7 @@ void drawLoadingScreen(video::IVideoDriver* driver, const char* msg) m = L"Loading"; } core::dimension2d textsize = guienv->getSkin()->getFont()->getDimension(m.c_str()); - core::rect rect(x-(textsize.Width/2), y+100, x+textsize.Width, y+100+textsize.Height); + core::rect rect(x-(textsize.Width/2), y+50, x+textsize.Width, y+50+textsize.Height); gui::IGUIStaticText *guitext = guienv->addStaticText(m.c_str(),rect); guienv->drawAll(); guitext->remove(); diff --git a/src/mapnode.cpp b/src/mapnode.cpp index d148315..7fd4e80 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -277,6 +277,10 @@ void init_mapnode() drawLoadingScreen(driver,"Loading Circuit MapNodes"); #endif content_mapnode_circuit(repeat); +#ifndef SERVER + drawLoadingScreen(driver,"Loading Plant MapNodes"); +#endif + content_mapnode_plants(repeat); #ifndef SERVER drawLoadingScreen(driver,"Loading Farming MapNodes"); #endif @@ -294,6 +298,7 @@ void init_mapnode() #endif content_mapnode_stair(repeat); content_mapnode_slab(repeat); + content_mapnode_special(repeat); } /* diff --git a/src/mapnode.h b/src/mapnode.h index 26b5de1..e32b00e 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -302,8 +302,12 @@ struct ContentFeatures // for pistons ContentPressureType pressure_type; + // how much does this hurt? u32 damage_per_second; + // can be used to set the users respawn position + bool home_node; + // NOTE: Move relevant properties to here from elsewhere void reset() @@ -370,6 +374,7 @@ struct ContentFeatures hardness = 1.0; pressure_type = CST_MOVABLE; damage_per_second = 0; + home_node = false; } ContentFeatures() diff --git a/src/player.cpp b/src/player.cpp index 76a361f..3500bcb 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -43,7 +43,9 @@ Player::Player(): m_pitch(0), m_yaw(0), m_speed(0,0,0), - m_position(0,0,0) + m_position(0,0,0), + m_home(0,0,0), + m_hashome(false) { updateName(""); resetInventory(); @@ -116,6 +118,8 @@ void Player::serialize(std::ostream &os) args.setV3F("position", m_position); args.setBool("craftresult_is_preview", craftresult_is_preview); args.setS32("hp", hp); + if (m_hashome) + args.setV3F("home",m_home); args.writeLines(os); @@ -165,6 +169,10 @@ void Player::deSerialize(std::istream &is) }catch(SettingNotFoundException &e){ hp = 20; } + try{ + m_home = args.getV3F("home"); + m_hashome = true; + }catch(SettingNotFoundException &e){} /*try{ std::string sprivs = args.get("privs"); if(sprivs == "all") @@ -183,6 +191,20 @@ void Player::deSerialize(std::istream &is) inventory.deSerialize(is); } +bool Player::getHome(v3f &h) +{ + if (!m_hashome) + return false; + h = m_home; + return true; +} + +void Player::setHome(v3f h) +{ + m_home = h; + m_hashome = true; +} + /* RemotePlayer */ diff --git a/src/player.h b/src/player.h index 96257fe..83888f3 100644 --- a/src/player.h +++ b/src/player.h @@ -175,6 +175,10 @@ public: u16 peer_id; + bool getHome(v3f &h); + void setHome(v3f h); + void unsetHome() {m_hashome = false;} + protected: char m_name[PLAYERNAME_SIZE]; u16 m_selected_item; @@ -182,6 +186,8 @@ protected: f32 m_yaw; v3f m_speed; v3f m_position; + v3f m_home; + bool m_hashome; public: diff --git a/src/server.cpp b/src/server.cpp index 01f79d4..df7b347 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2902,6 +2902,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) || meta->typeId() == CONTENT_LOCKABLE_SIGN_WALL || meta->typeId() == CONTENT_LOCKABLE_SIGN_UD || meta->typeId() == CONTENT_LOCKABLE_FURNACE + || meta->typeId() == CONTENT_FLAG + || meta->typeId() == CONTENT_FLAG_BLUE + || meta->typeId() == CONTENT_FLAG_GREEN + || meta->typeId() == CONTENT_FLAG_ORANGE + || meta->typeId() == CONTENT_FLAG_PURPLE + || meta->typeId() == CONTENT_FLAG_RED + || meta->typeId() == CONTENT_FLAG_YELLOW + || meta->typeId() == CONTENT_FLAG_BLACK ) && meta->getOwner() != player->getName() ) { @@ -2949,7 +2957,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } bool is_farm_swap = false; - // This is pretty much the entirety of farming + // This was pretty much the entirety of farming if ( ( material == CONTENT_MUD @@ -3042,6 +3050,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } sendRemoveNode(p_under, 0, &far_players, 30); }else{ + if (content_features(n).home_node) + player->unsetHome(); if (n.getContent() == CONTENT_FLOWER_POT) { MapNode a = m_env.getMap().getNodeNoEx(p_under+v3s16(0,1,0)); if ( @@ -3769,6 +3779,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } } + if (content_features(n).home_node) { + v3f player_home = intToFloat(p_under,BS); + player_home.Y += 0.6*BS; + player->setHome(player_home); + std::string msg = std::string("Your home is now set to ")+itos(p_under.X)+","+itos(p_under.Y+1)+","+itos(p_under.Z); + SendChatMessage(player->peer_id,narrow_to_wide(msg).c_str()); + } + /* Send to all close-by players */ @@ -5310,7 +5328,9 @@ void Server::HandlePlayerHP(Player *player, s16 damage) void Server::RespawnPlayer(Player *player) { - v3f pos = findSpawnPos(m_env.getServerMap()); + v3f pos; + if (!player->getHome(pos)) + pos = findSpawnPos(m_env.getServerMap()); player->setPosition(pos); player->hp = 20; SendMovePlayer(player);