From f14fe80543b04ca0c5baa5b0ce3d594df09556fe Mon Sep 17 00:00:00 2001 From: darkrose Date: Sun, 27 Oct 2013 00:31:02 +1000 Subject: [PATCH] fire,tnt,stained clay, hay, sponges,terracotta, stained glass, flint, firestarter, gunpowder, walls, gates, more ores... --- data/textures/charcoal.png | Bin 0 -> 470 bytes data/textures/coal.png | Bin 0 -> 446 bytes data/textures/copper_block.png | Bin 0 -> 249 bytes data/textures/copper_ingot.png | Bin 0 -> 362 bytes data/textures/fire.png | Bin 0 -> 847 bytes data/textures/gate_steel_inv.png | Bin 0 -> 207 bytes data/textures/gate_wood_inv.png | Bin 0 -> 757 bytes data/textures/glass_black.png | Bin 0 -> 388 bytes data/textures/glass_blue.png | Bin 0 -> 383 bytes data/textures/glass_green.png | Bin 0 -> 404 bytes data/textures/glass_orange.png | Bin 0 -> 395 bytes data/textures/glass_purple.png | Bin 0 -> 404 bytes data/textures/glass_red.png | Bin 0 -> 403 bytes data/textures/glass_yellow.png | Bin 0 -> 387 bytes data/textures/gold_block.png | Bin 0 -> 277 bytes data/textures/gold_ingot.png | Bin 0 -> 358 bytes data/textures/gunpowder.png | Bin 0 -> 405 bytes data/textures/lump_of_charcoal.png | Bin 0 -> 208 bytes data/textures/lump_of_copper.png | Bin 0 -> 382 bytes data/textures/lump_of_flint.png | Bin 0 -> 261 bytes data/textures/lump_of_gold.png | Bin 0 -> 364 bytes data/textures/lump_of_quartz.png | Bin 0 -> 224 bytes data/textures/lump_of_silver.png | Bin 0 -> 356 bytes data/textures/lump_of_tin.png | Bin 0 -> 361 bytes data/textures/mineral_copper.png | Bin 0 -> 258 bytes data/textures/mineral_gold.png | Bin 0 -> 222 bytes data/textures/mineral_quartz.png | Bin 0 -> 288 bytes data/textures/mineral_silver.png | Bin 0 -> 259 bytes data/textures/mineral_tin.png | Bin 0 -> 254 bytes data/textures/quartz_block.png | Bin 0 -> 273 bytes data/textures/quartz_dust.png | Bin 0 -> 367 bytes data/textures/saltpeter.png | Bin 0 -> 384 bytes data/textures/silver_block.png | Bin 0 -> 270 bytes data/textures/silver_ingot.png | Bin 0 -> 350 bytes data/textures/tin_block.png | Bin 0 -> 269 bytes data/textures/tin_ingot.png | Bin 0 -> 361 bytes data/textures/tnt.png | Bin 0 -> 186 bytes data/textures/tnt_bottom.png | Bin 0 -> 161 bytes data/textures/tnt_top.png | Bin 0 -> 264 bytes data/textures/tool_fire_starter.png | Bin 0 -> 370 bytes src/content_craft.cpp | 369 ++++++++++++++++++++- src/content_inventory.cpp | 135 ++++++-- src/content_mapnode.cpp | 486 +++++++++++++++++++++++++++- src/content_mapnode.h | 25 ++ src/content_nodemeta.cpp | 60 ++++ src/content_nodemeta.h | 22 ++ src/defaultsettings.cpp | 1 + src/environment.cpp | 169 ++++++++-- src/guiDeathScreen.h | 1 + src/guiTextInputMenu.h | 1 + src/inventory.h | 9 + src/mapgen.cpp | 27 +- src/mapnode.h | 17 + src/mineral.cpp | 7 +- src/mineral.h | 22 +- src/server.cpp | 53 +++ 56 files changed, 1316 insertions(+), 88 deletions(-) create mode 100644 data/textures/charcoal.png create mode 100644 data/textures/coal.png create mode 100644 data/textures/copper_block.png create mode 100644 data/textures/copper_ingot.png create mode 100644 data/textures/fire.png create mode 100644 data/textures/gate_steel_inv.png create mode 100644 data/textures/gate_wood_inv.png create mode 100644 data/textures/glass_black.png create mode 100644 data/textures/glass_blue.png create mode 100644 data/textures/glass_green.png create mode 100644 data/textures/glass_orange.png create mode 100644 data/textures/glass_purple.png create mode 100644 data/textures/glass_red.png create mode 100644 data/textures/glass_yellow.png create mode 100644 data/textures/gold_block.png create mode 100644 data/textures/gold_ingot.png create mode 100644 data/textures/gunpowder.png create mode 100644 data/textures/lump_of_charcoal.png create mode 100644 data/textures/lump_of_copper.png create mode 100644 data/textures/lump_of_flint.png create mode 100644 data/textures/lump_of_gold.png create mode 100644 data/textures/lump_of_quartz.png create mode 100644 data/textures/lump_of_silver.png create mode 100644 data/textures/lump_of_tin.png create mode 100644 data/textures/mineral_copper.png create mode 100644 data/textures/mineral_gold.png create mode 100644 data/textures/mineral_quartz.png create mode 100644 data/textures/mineral_silver.png create mode 100644 data/textures/mineral_tin.png create mode 100644 data/textures/quartz_block.png create mode 100644 data/textures/quartz_dust.png create mode 100644 data/textures/saltpeter.png create mode 100644 data/textures/silver_block.png create mode 100644 data/textures/silver_ingot.png create mode 100644 data/textures/tin_block.png create mode 100644 data/textures/tin_ingot.png create mode 100644 data/textures/tnt.png create mode 100644 data/textures/tnt_bottom.png create mode 100644 data/textures/tnt_top.png create mode 100644 data/textures/tool_fire_starter.png diff --git a/data/textures/charcoal.png b/data/textures/charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e82541d21e7379773faeeb23ff3f8cdb9d7710 GIT binary patch literal 470 zcmV;{0V)28P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K|0`GMTq}IRF3wXh}ptR4C6~ zk~^~NFbqTaldMUqEF$|~U2IDf$yeZxi`Qu^695my-|v@*R8>{iT13RmRmIHie&4sM z_TELLs_y&N&*!uECL(ult<5=!NJNMTLO4eRv_wQywW_L0M2_Q7RWr-XsxmVo%1l+w zOd^u1A|jZ&dsXedBLb4GHOybv6%l4;b50Rytr5}Qo0->IB7e>ZBO3CM1(e> zqVM+`f0$YC-QAy!0TgnGO+?mOGcy!fRlWD~JRfeYwTS4w!-R-zi~;Jv`c#9EV3nC; z3|ReDhEkY$&e>Ya%%^@;#k#N+kVe+)y0Cz|@~ M07*qoM6N<$f@*Edg#Z8m literal 0 HcmV?d00001 diff --git a/data/textures/coal.png b/data/textures/coal.png new file mode 100644 index 0000000000000000000000000000000000000000..e866ccc1e1ff4d14b2dcac59e511257ee39a1a42 GIT binary patch literal 446 zcmV;v0YUzWP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K$F(0E5Qe@Bjb-P)S5VR4C6) zQd_RYAP58owaMAR+5Z|(TNSt;(=@jqrU9H6>i7E<5i5fQ5@5h3Z` zyQ=oynMp`@2jK44b!DczV~jy04pr4!%gj_2fSJuXRkgMDNTRG)v6-1!X43jvivj$8 zKNcN;h*T9BIYB-A+`aeCN<=teUOn_j_K4Vf1BeK^j|is>M)6Y7!x%$VGm{KNG-B}1 zbzRJas^**#VP+9=o+sCZ-aBF59la-4@y5*}dhg7^-CJvW?}(rcYNPcr2LHXa_J6gl zwevhV&D=7xwKnH`LK|Z+V795@0dr?o02qLXJd6>cs;WBYB&wNly8vkSc~r-7upuII o&b{|>9BVDUfQab5Q!Ur>2N?A-;OVov9RL6T07*qoM6N<$g8dA;DF6Tf literal 0 HcmV?d00001 diff --git a/data/textures/copper_block.png b/data/textures/copper_block.png new file mode 100644 index 0000000000000000000000000000000000000000..c8cdeea50a12c0b5775a1bb28080b187b23cffba GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmP)lZddTkjkX%N)tqe9e@UtDeE2c$S6t zz%ohOhM688^|#$fR9YesE4*v;3ufQyOZQZ9DUtc;tfo^^8A0*)niFb@tO+@475u)#^*J`bt}47EaL; zDm3_K;rV3Evl;pQbIRYj*x8vfOm;b!b*{j~ZKcS}Gdv8R7}otfc=<2y@!nv*Ra@>_VY^Nd@j-1Ckss299D`j&N#yp@;B6_??$d^>f&WBP5$NW zZ{Kc^v0t-yPqd)HM{%Z$`HoUEX6CKdT(9?P(%%#26&oAlQB>(^b literal 0 HcmV?d00001 diff --git a/data/textures/fire.png b/data/textures/fire.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c2afda7adc180e68b3403f803dba72f00cf24e GIT binary patch literal 847 zcmV-V1F-ywP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RX1P2x;JF*&V4gdfG;Ymb6R5;6x zlU-<&cNE5d|2J=A^5)HF^U$HpWm8rh;C0 zw~I}r2;0OPwJ37~8O)27*)c%}MwHf8N!m0Y7?LJ2O_SqADO%>hb9H#m;W^K9;DOhu zqhSw6!=6{+@*i-g6Zt=)v6O?clw;Lg9SoUruCSn1fQ$V|Z+C=|zvdOdJAMa%7$~+m zItmb_=?ai+W-jbgq^xz@%?^fOM~hn|C{1DpH={O zM%=PC5u#qN6TOmC&BK;V-z#DbgwgWp68`TWDZ6Q~Xme0L(kB2jkEQ`=e6d!1ekYpV zB(y#VfISf={&s@K<{q@j#f$>TOwAG7;={Wq!sMrJNvsPjKgo)d97<7^MVdRbWshc_ zg^@a~*$mo>Z^J3H!!}4eiG68Niz(!{k43jTS5*0QU3nwJ0|vy2uRvoQbw002ovPDHLkV1gaximm_v literal 0 HcmV?d00001 diff --git a/data/textures/gate_steel_inv.png b/data/textures/gate_steel_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..d56c76c1b72e5f1e68850862915a53ae82c2f728 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9jKx9jP7LeL$-D$|I0Jk_Tp1YB z4;(mf<;s<{D>#0DRFnky1v5B2yO9P`QQ#3-%)r1c48n{Iv*t(u1=&kHeO=k_a!GNB zShrnEJp>f8_jGX#;kcfh(9q1ehB3!Msj)XPD7ziS7(8A5T-G@yGywpMhCFis literal 0 HcmV?d00001 diff --git a/data/textures/gate_wood_inv.png b/data/textures/gate_wood_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..f27ce524f6985364d5c6bc50878d8a907e13f762 GIT binary patch literal 757 zcmVPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K|F&8DW4%qyPW{he*Th=rV#5Dc{%vckC+v{oLXW34ds9_Jf_R^<8TpRiOq0}_P1CcFW4jhqZZ z49br!u3mmoKt|Vt#+_6&Fx( zrqmr!+OC|Us4?K2<1zM>y_#j-SW6?G&&07;j6t4%{md|Slv31c#fw9{V>q307N~`` zH*UA2m+x1!DTk?Nm?q-!fRqaDJ#nAk`F@$X-!qdaeehr$sqFv1Sq`U>QX8!*x*OhJ zugKtqS~ucD#O#%)=&|Bh(uPRKXbofEvu%Z^r$>yn^r0gNwD)$#JOa=EPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K$9>C`b|EG5`Pp7D+@wR5;6} zlf7#KK@i2??kxv_7)fC#w*EcW*jWi8N{ocW1V7^7i60mQEmGKO@Bd_BbyZFg+{mVr zth;iF_qrKoe$2kdGS4e3#E<}h)#{V3S@yg#am17cD3x9)7Ql5m8jUt}Iz(3iX0s8k z*I$tGs14O>Z&az&DG~qx%jJ}UV2@Vo{j`usxY+F^n$0#v0stVHbip}0)xO`QRO$xX zt+dB@uJO1}wqCLL{I?4(X+Hn>KOmofq(b4zYM{dpIv|&Opx@>Jz+y3_FqEiPU&)q% z21uuGvDt*iST=i)AlMrarI-$wOa>%`V*q@=OPS0agwS8Clw+n~GYSBP!=BMs0GRDN ib9Mmd9N$L~namH{ep=}#6hK1&0000`sfT`mbO5w5z{N?D*DK~ERQ5R21GCmUunISRDiKc_3r(i@Yg zwejosnB;WT4uy`bTzoOg9AeY9-TFOWhvli$f!(KB^{4x)N9G?^z4tn8=Fc0I{ett# zFKH-pGW`C_ZEy6ZGF@%T6h;Z2Bt6!EE`ymVHuIb1nbuqvwUg2FxO^rYn{Qs51+3OQQrPv<{tI8@4l1%UM0S|kuTQQVfp7%_Gg(J-d=lZ;A1GInsfR9gURernf}CeYwwl` zvUu_>+G@bK`l_(^%O?!`{O@GhI(ro-ubo@NWww|hVdI1v`B`iVInR9_aVZ^2SL2@i ala2FcOm@@izbwG;V(@hJb6Mw<&;$UdNRZwD literal 0 HcmV?d00001 diff --git a/data/textures/glass_green.png b/data/textures/glass_green.png new file mode 100644 index 0000000000000000000000000000000000000000..8f974a96b819fc7d6df7f08d2fe1223ad85fbe38 GIT binary patch literal 404 zcmV;F0c-w=P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K$9j$#{zhsz(H8% zi6%z^+)iJz(fEN#!YoDthyNm?@Kz*)8-|yh4d)yyLCOx#<3Wuu9SO5T|(;kFy z`tPb+VKzH~R!iAq{Hv?UGump)-`hlHh#&l?`jszJwyXxaA~XRDFKZk$ z4*(u!YYYN~_0K)pGB5zS+!UJ4AktPSWZ?Uq2t;eg1l**~DWw|$RNV^m`4pryH`dyX yreHG)04@@zM8d3T0FLdPg%d&ufo@O6Ci4q6Y+Z}&_y->V0000Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K$9=3-fKE0RR929Z5t%R5;6} zlV3{$K@`Q$&Q6Pwe^6KgF?%SG3hH|a5k&u9jDtiG^x{h&pifjFK~Mw=BDh4gy9hhV z^d_!5vErV$x!n8X-g6l1`KhUqK@tFt@W@q$U(lpLM#TWb&2we~IF3NH*P=coR{~V} z_w4n4q0}_i^u2w>QT2kU007txJM_FUCI{EEfkMGS7%Hg!7E=KLP%1eP!kWG9Zkw*V zjv!Fx7#FqieoIsB$30_tnGOC^b@Z^@3G@2MpRiv!H5zD(C=PgCJLbH30I(Bu==%y^ zTbDFt5Cha|c?<@AqOH*=!}G=oh}KpdQ2e~3ly-8}ZkzRb5mLr4*4j>{U@{5-a&I@x pEz~ps%k-Uv6+sAr$yBB$^9TOETsn&Kb724g002ovPDHLkV1ns=pLYNN literal 0 HcmV?d00001 diff --git a/data/textures/glass_purple.png b/data/textures/glass_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..3f9e722428eacbdd0241922c0ba824cb16b0637b GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfT`mbOIi-#FEpvf-)I41rLo7}w&k?J5V9(6j(AwD8`0(^E zbKWNz&p1Ug6OtAPERa|*NAbSHM8=#PAD(5QuXw}0&f-mxEU3Nox6QrZ&hXE_zx=Kf z%Nm24qqaFQJ2FcEL7ZOYy${dMma~19;@!a(7iZSCKEB>~M(ApD0h0!x6^--f_cnHR z3ZApSShLtMWXj}+r>Eb)u~<+x=Ec6t4Zc2xzI_(r5178E+bZ2<=!`hYwlhU?4daP3 zU%0O_95ndI_T)fvLPA2t#vhf3pP%0^Y4TY_dc#r1E=D6G8=mv?YL5jhTc>vdzzx7$1i rK@m^2WAQvbK0ZA4|27HqNHQEe6)`9AtM4aZAToHm`njxgN@xNAV6>kk literal 0 HcmV?d00001 diff --git a/data/textures/glass_red.png b/data/textures/glass_red.png new file mode 100644 index 0000000000000000000000000000000000000000..33fdf70f2a8ba868c0b9583e38111215068883ba GIT binary patch literal 403 zcmV;E0c`$>P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY3K$9>1LUn3asU7UB}qgDx=z>%UN{Yczdt?(=hXmqP&nF!xxa@3+x8I_?c5lO9?v1$9{FPyhg=(;kFy zdT+N{VKzH~W>eW?9Mt618Ev(nB&002ovPDHLkV1i9qnHK;6 literal 0 HcmV?d00001 diff --git a/data/textures/glass_yellow.png b/data/textures/glass_yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..1b7a192d3f44a816134bc6ff51dcdf83417b7f87 GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfT`mbOd9ludKQn=PL_J*`Lo7}&z3iKP$U%VZf%$H4kBx3x z6@niZJ-GN^b&AtMdGXWHn!2rVd%l#vJUUyPRgg!iSLlS>HD||NzFuo)-qthb-)-Du zEcKO#tA(i{@B8HEBK^m0xkPxlBlO-!a1_KgTD-d~@kwVvRPFPeZ>(#-hh0kheB$b> zc{>>xw%m4Rb8Jzmv=Wcbr;B5V#p&cfpBDVKXJ&19dj9%s zp7{A|mAwr2XQ>`Oe*0~K-S!XxW??heKdYun%-XrMDZu1#Y=d6IS=T#3jux?<51Eqo zHeY7Q@jITbA*?!!Q>ww&xQfAe;-mPyl?rY4@%ch#3^&Dq>^<>DP}?ZNn=@bvtG`1(vZfaBm7#x^|QI Q8PK&1p00i_>zopr0Dw4T)&Kwi literal 0 HcmV?d00001 diff --git a/data/textures/gold_ingot.png b/data/textures/gold_ingot.png new file mode 100644 index 0000000000000000000000000000000000000000..fa1de151d45463fa2d4cfb966486ba48fb5c817f GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)BfFp+`&6du$v~mco-U3d7N?(HT$pz#K;+oR|E$x} z8XIQJnBkgJTmVU+;HU>k-J24u?cPm17He_#ibrn#3jksF}Lslbq4S;|XsV16Cio?UyE~?;Nk%cjI-~({*))4BPe{{4cie z&tmKUe>_>v|2ri2i#LU}c=h$Qr-GO3{OP~NC??YQ=R_b|1JL^np00i_>zopr00LH( AHUIzs literal 0 HcmV?d00001 diff --git a/data/textures/gunpowder.png b/data/textures/gunpowder.png new file mode 100644 index 0000000000000000000000000000000000000000..612311c01bb185e35d78c3e5b0f1fb78e4fa4c48 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfT`nm;Q5ie0xluqN+02lL66gHf+|;}hAeVu`xhOTUBsE2$ zJhLQ2!QIn0AVn{g9Vq_K)5S5w;`H61g?&th0=24>4}`C2X_=$!7+xTMpzDUD57oN?(IR9wp zO1>R8j~AQ0+L!muVedZguU7q=0>5M{GIS?59^KgS^W-N^X2;9><~JAfo#A0HIQAer zbd{&r``2tg>`pLs9=n+-oO0$&#qW<=toK!Nx?eDzIit(0bSQ7Z;U9!R@IbFc5qQx6vkz&eExIv v#nTp{R<3JHE4F6etNvOsF-~Oif&Iz*Q{NQmt-9Nl2MQujS3j3^P6`sfT`nn33B%JRE1v^}l001;Lo7}wCrGd|^Gg(Zo|$9$*}iA) zym{w5wlJQMy2xnO98sWYSM-DVEn*g&&bH`M;(EaKForbU(gVEyvS!ql5{D7*I00^lV#e)06>tciGBcF;_e1uds zQAmX-%El|WO^-FX?r}Dqq94AY^yKF&9PO;zC56L;TvirSdcx(+owM{G>~5_Yz>4eC cdGSA~Pkk_aY_C{n4*&oF07*qoM6N<$f@DykeEQL70(Y)*K0-AbW|YuPgfjj?$zd1hwg544s+<@U}$(Ew$jSMWy=KBgtXix uZxY<(`VEv-;^!J14>~L7>%MU-N+5 zM2AHlzJ~=DJh!;hIFGB3K~{ZXgC4JlNuUaQkI$dYyFcC6Yn{saC?d>jMqb+e-}AN@ ze|UcSb#+Cx&DM@spPdOs-`?c1a>)DXG^l?wDCKFm#(MmDcVFC>nUhmG&p0j7ny~6X z#E$)TTbdct!`f1_IPObdIx``y?c_y2cB3f&emlFBTHX(~zd7)KrNP_{@eMa^mT9aN zX5Z(q>YB<{)gGyN%TnzXx}+J7{bpLZ)_cmWNzc+Ai@D8i(=ME~y>`x)zh9OvTEl*= zqP+Bh-OJKz3%-;WMIJtz`;PbC!KX)WFrC}u6>I)~@-L=fgTe~ HDWM4f{m+*h literal 0 HcmV?d00001 diff --git a/data/textures/lump_of_quartz.png b/data/textures/lump_of_quartz.png new file mode 100644 index 0000000000000000000000000000000000000000..ae2f4bb75a1a460360c760eac5c7836f981e707a GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0XB z4ude`@%$AjKtc8rPhVH|yIfN2k^)m^Ed2x&D)Mx346!(!{OA9FduG*!&PFE#A)bm) z4?ov$;ssIv`R~^o$?W?5#Qr4P0TW{b0|So2!UrZP0_>0WZkN|IKHwMG_VMm^c^(jW zzwd9thTv(5M^=6K|Nno*$Ai}W{~u3IUy_=Zr08aE$NWzqk-?nd@1sbC-!Zd{fVMMu My85}Sb4q9e0NY(sX#fBK literal 0 HcmV?d00001 diff --git a/data/textures/lump_of_silver.png b/data/textures/lump_of_silver.png new file mode 100644 index 0000000000000000000000000000000000000000..5093d9f07ec283724f8d0c091cfa9f2b0df82c3a GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)BfFry@!GXQ(}6-CJzX3_EKc8@v@z?jfk2!6b+M06 z!nsTMzOe2}IUQtW;w-1=9lvnG$_dvE52gsLm{zEAv&-t_mE73N8~;v!T=M<@_r=yf zK6@k-?wT^`Usb9i%K?Gq20|;&rT^L| z|EX2r#yaK$mhQ3Fr=(iyUNGThsGRqBj`Y2`#S+QSWL=ItlX$GQYSp3Y|DVO=w%>j@ zdC3%I^?TLxzW+}7#`o^}Yk{@yN*`MP_no-U3d7N_q{+Us}NK%{m5goM=7 zn@e4_s@wVA$Xb;=mps)Ia&4bat5S{mn@pZw{(ZuBy6X4M zH#?tYycJmTGi0?LK-){(IWrFRRuSo>Od5hzopr E0BZ7@`2YX_ literal 0 HcmV?d00001 diff --git a/data/textures/mineral_copper.png b/data/textures/mineral_copper.png new file mode 100644 index 0000000000000000000000000000000000000000..43cdb115efd6910670df65bccc00b038ff7d125c GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)qo^>G@C0j7OQ2A{r;B5V#p&dP1!gyH$$hCWTX?yC zm*goYkH_u)@e+HquNxW}7#QTd=lcKu$^85W3z7X*Hv0(2PzgQu&X%Q~loCIIO1VtxPs literal 0 HcmV?d00001 diff --git a/data/textures/mineral_gold.png b/data/textures/mineral_gold.png new file mode 100644 index 0000000000000000000000000000000000000000..e110b437d9f207d17e9e332d0fc3e60efc5a0edb GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)qo^>GXl29(9-vURr;B5V#p&dP1!h0$_CNf;yO!ra zd;7xs@6G@GFXmeK@qKWIV+3#WO{dc5mu++;CaUhgpMPN0#D4av|6g*qh!r`#NO#~{ zVZU7B!Hj)%hef%88XuH!D%&|HCN{~i&ENOngLUX$$LSju&05H?l{3{~(!4+`ptTI1 Lu6{1-oD!M`sfT`mb8BbKgw; dV~Yj@L+{q8DLPD-+JUZT@O1TaS?83{1OUbUY%l-- literal 0 HcmV?d00001 diff --git a/data/textures/mineral_silver.png b/data/textures/mineral_silver.png new file mode 100644 index 0000000000000000000000000000000000000000..a81e73f7129928e2808c32d96a27b6836e29e9cb GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)qo^>G0H={lGf-%Pr;B5V#p&dP1!fi{|DOCW{k{GF z^4SY@T1@JGf9ySY?!ugjjg5^DuU!57fBv4Tg9m^>;K_@VCqRsjH9yX_mupOF=1<_} zUK8iQ9wQ^8@h9KD?!exzhu4F{&;PIg{*rml`^1+Xw?8Btc~QL70(Y)*K0-AbW|YuPgg)9!?=%E;k;QE}&4Ir;B5V#p&dP z1!gzOzhC%YTh9M?`Rs)~Eha@9HW){ooNa7mU|=9qUGeFEzrDSr1Q5)b@>U{{$6*_z zn&l6MZ5s}}Vl6pv@KE0&cRqHW{c_b6LPr%M7%uS`Bo*6L>Acxp{lb3TjKm}22{#Ts qI6i;=mEN>2VIk#}FB@L16lJLT=4$w{OlcR;B@CXfelF{r5}E+*=~tux literal 0 HcmV?d00001 diff --git a/data/textures/quartz_block.png b/data/textures/quartz_block.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9b2c5eff76579705e53bbe6b2c0479bac96af3 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0XB zj({-ZRBb+KpdfpRr>`sfT`nnh331`)j35&hd%8G=Se#xOw2_a=ki+%T+?Iu&=5-7H z+y4~J)7v%EV#W+VAFIlPm+lo>s%2EJ?|1iq{`xI5yOL?>j{Wx*K8rGnkvqRsOzl8m zuVItfL>#yC3ddwm0+17oAzFUjJp%$qsdG{1#RX PbS{IZtDnm{r-UW|a+YN+ literal 0 HcmV?d00001 diff --git a/data/textures/quartz_dust.png b/data/textures/quartz_dust.png new file mode 100644 index 0000000000000000000000000000000000000000..f558a3f55edc9d40654bb3c3937f200ce4db66a0 GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfT`nn3F4jpVx{W{~+02lL66gHf+|;}hAeVu`xhOTUBsE2$ zJhLQ2!QIn0AVn{g9VmXo)5S5w;&gI?M4Li^9?RoLiy7T`&i3ay-6(oBW0m~flmv_0 ztx88)7JB%}HYKtd8W=pW@lQKZIgdxsT<`EhCX;l#c!7WQ*T1^+fWUI@EfVMLk`fH2 zHJ_MUd*ndDAIVLO5hlu?%VX=06zp>77K}AM#Ql1*qJ-z?b+7v+67&i#Pf0eITkzJt zD|=y_Bj=Il^7{{%9yVFDyQQ(QQE}gA3*|FOYB94e-aNskr?dSJKX-~)PS?cTV`}e~ zX|nhGxqXRRAAwUbhU#HM2hnHlPSCRn|Ayh#b`sfT`nn3Zt;p~xg9_u+02lL66gHf+|;}hAeVu`xhOTUBsE2$ zJhLQ2!QIn0AVn{g9Vq_N)5S5w;`H4~hFpgn1YF~fC^W?#P)eA}d?RC}xIpynEt)}{ z=^IY5=H%)e366Nm5Y{O2jDf8wCqehxgIzZhwE1|>oH_U3__yQ_=jgXnw?A#Oo@~=+ z`z0{G{^>mD<~il#EYYkYp<1p}Pc7<64LlZf{;=j5xAl$d*VlAttO~g%%vkkKs93n+ zVAYC(n1ImdKI;Vst0IIx`-~a#s literal 0 HcmV?d00001 diff --git a/data/textures/silver_block.png b/data/textures/silver_block.png new file mode 100644 index 0000000000000000000000000000000000000000..e0ad5dfe59b5b030b334a603fa0708cc76d4ecbc GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmP)lZXhTyvJw8hd`m(o-U3d7N?g6dy6$2aJbCd&aln% zUA=JZ&3(JFs#&hR^^$+K_{Stsl`|<4lOAqeXa6E%@v1|=e;0}_7f7tM`xeu|nC+^0 zgh}TJ`-gQ3_g82NJz93ksd4*UHAmlHlA7Nd^f|L0+)3DTdA&gMsyN{r(JenhM5~^^ z{d8cK+7Z`%N5dZ8D7tgZa^hD;+sCKQ=k%4w#dB?3A-k;d-LG@??G2$#-&If90G-L; M>FVdQ&MBb@0J>UhTmS$7 literal 0 HcmV?d00001 diff --git a/data/textures/silver_ingot.png b/data/textures/silver_ingot.png new file mode 100644 index 0000000000000000000000000000000000000000..d07fdaad8dedbc339a6189a5d6572fcb7905d371 GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)BfFry`u6f;uYf|YJzX3_EKWb2Xqa`_K%~vSk@Mn< zz~U3EmzY^MJzj^5uxlN2g4N6qTOv9F4_co7^ZW0=#bT}(ohQC%{`*jI;?`+4 z=OcBeE4|A9%hc|2E$Ull*A$`TGtXrj_TII~I9p?;-1j(s(XMrsH{Uj`$drofcNb(~ zU&~mrJC3nw#VW0DnOqH1gcy=}&fm_puw~NdVp@9TyK|hL#q*5YW>4^5y sf^)2nk<*$VWSDtA3V*%zdHoY+jo{X|?0-x*1HH}Q>FVdQ&MBb@00Og-M*si- literal 0 HcmV?d00001 diff --git a/data/textures/tin_block.png b/data/textures/tin_block.png new file mode 100644 index 0000000000000000000000000000000000000000..e28c371c10cbee94543d0ce3daad141ea30be59f GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmP)lZXhjc!}KWK%mepPZ!4!i_=Sk422FGa4eqle?e#C z$^ZXduAiA}RC0bP0l+XkK^C^-Yf1IQ%_c zeD1p}AN#-hX7|a{{7~W1OvOnd_SEfPd46vzVP;5p{0?>Uf1Ng zy3YH&@g|3Mga_w=s@<#`7MYx$;VQ@=d!Ic){J4+0aP=4nJ z@ErkR#;MwT(m=r&PZ!4!i{9jz#S1_FKh-PE0|M_QBqZLLm`Hd$G&T(2XlrEb`40sC zqT&WdMu!Z0`gPiUdAk@5+7+xhA{F&aD-J&ZN=vjo_`+o8{DHBHd19f7W^f(@gTf`7 V-v-t5ZGrYMc)I$ztaD0e0ssynH*^31 literal 0 HcmV?d00001 diff --git a/data/textures/tnt_bottom.png b/data/textures/tnt_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..8ba2fca0be5b58ab656f61743204358e8d8152f8 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z@ErkR#;MwT(m+9HPZ!4!i{9jz#S1^qXXN6$yW?QO@`VQ-xaM~@0)b@=2s7$Ag7{7c uW*k58Vg3fAI}NQN_Wf-KGbDH}8vxDda%<*zA(RC)j=|H_&t;ucLK6U;Lohf1 literal 0 HcmV?d00001 diff --git a/data/textures/tnt_top.png b/data/textures/tnt_top.png new file mode 100644 index 0000000000000000000000000000000000000000..a84ffc9af486b0869b64c649700eafb6aab959e9 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z@ErkR#;MwT(m=sgo-U3d7QJUDALMOO5OAHptF>YY*SR=fpEpfnJ-QL>o#E%BS?}(c zp4c3j_+;CACj0pYXP#WHNcL+f=ZHvNaZ%U7{Ci39f77gz?n5F>kE>Gt9y>U*w2`-9 zlUvND`b=A3jvUcZ!Db1c~6CPz3 zO$fU){o!$TRrZfBe;cK24mjg@#-THb???Ck1q=VN_VO>g7J2ZQL70(Y)*K0-AbW|YuPgf!Cq)?tb0Y*M?cvgBVCwMDy(!eVxLi=3?=I8#nP<+= z`nX4u`9E(mk96{n@RX$@!h*tr+Dr2~JN}-&7RAu;UG7>`#d}AWM?MdB+Kae0F3X${ zB=p##DE9hvzIpHUg1nkK^jPKUdH)uQz1YaR)^t9X&S|FSGChWG<{X}Qr}XZ2rRkm3Co4@V%zT*Zw3=O5RhUblo&OHj_uKv_^{dMcv zqf46~>$EU1bQmf<*EuqkSyOd-YNr5GQqTO)xvkL?g7*3TXTH$iu=UPXMj4>*89ZJ6 KT-G@yGywpwYmMdr literal 0 HcmV?d00001 diff --git a/src/content_craft.cpp b/src/content_craft.cpp index a6266d4..ef1aa15 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_mapnode.h" #include "player.h" #include "mapnode.h" // For content_t +#include "settings.h" // for g_settings struct CraftDef { ItemSpec specs[9]; @@ -107,7 +108,7 @@ struct CraftDef { */ InventoryItem *craft_get_result(InventoryItem **items) { - static CraftDef defs[135]; + static CraftDef defs[174]; static int defs_init = 0; // only initialise (and hence allocate) these once @@ -431,6 +432,116 @@ InventoryItem *craft_get_result(InventoryItem **items) defs_init++; } + // copper block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_COPPER, 1); + defs_init++; + } + + // Uncrafted Copper block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COPPER); + defs[defs_init].item = new CraftItem("copper_ingot", 9); + defs_init++; + } + + // gold block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_GOLD, 1); + defs_init++; + } + + // Uncrafted gold block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_GOLD); + defs[defs_init].item = new CraftItem("gold_ingot", 9); + defs_init++; + } + + // silver block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_SILVER, 1); + defs_init++; + } + + // Uncrafted silver block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_SILVER); + defs[defs_init].item = new CraftItem("silver_ingot", 9); + defs_init++; + } + + // tin block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_TIN, 1); + defs_init++; + } + + // Uncrafted tin block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_TIN); + defs[defs_init].item = new CraftItem("tin_ingot", 9); + defs_init++; + } + + // quartz block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].item = new MaterialItem(CONTENT_QUARTZ, 1); + defs_init++; + } + + // Uncrafted quartz block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_QUARTZ); + defs[defs_init].item = new CraftItem("lump_of_quartz", 9); + defs_init++; + } + // Sandstone { defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); @@ -1249,6 +1360,17 @@ InventoryItem *craft_get_result(InventoryItem **items) defs_init++; } + // Tin bucket + { + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].item = new ToolItem("TinBucket", 0); + defs_init++; + } + // Cobble wall { defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE); @@ -1438,6 +1560,251 @@ InventoryItem *craft_get_result(InventoryItem **items) defs[defs_init].item = new MaterialItem(CONTENT_CLAY_BLACK, 1); defs_init++; } + + // blue glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_blue"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_BLUE, 1); + defs_init++; + } + + // green glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_green"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_GREEN, 1); + defs_init++; + } + + // orange glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_orange"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_ORANGE, 1); + defs_init++; + } + + // purple glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_purple"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_PURPLE, 1); + defs_init++; + } + + // red glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_red"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_RED, 1); + defs_init++; + } + + // yellow glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_yellow"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_YELLOW, 1); + defs_init++; + } + + // black glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_black"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_BLACK, 1); + defs_init++; + } + + // Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET, 3); + defs_init++; + } + + // blue Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLUE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLUE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLUE, 3); + defs_init++; + } + + // blue Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_blue"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLUE, 1); + defs_init++; + } + + // green Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_GREEN); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_GREEN); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_GREEN, 3); + defs_init++; + } + + // green Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_green"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_GREEN, 1); + defs_init++; + } + + // orange Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_ORANGE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_ORANGE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_ORANGE, 3); + defs_init++; + } + + // orange Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_orange"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_ORANGE, 1); + defs_init++; + } + + // purple Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_PURPLE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_PURPLE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_PURPLE, 3); + defs_init++; + } + + // purple Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_purple"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_PURPLE, 1); + defs_init++; + } + + // red Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_RED); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_RED); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_RED, 3); + defs_init++; + } + + // red Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_red"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_RED, 1); + defs_init++; + } + + // yellow Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_YELLOW); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_YELLOW); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_YELLOW, 3); + defs_init++; + } + + // yellow Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_yellow"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_YELLOW, 1); + defs_init++; + } + + // black Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLACK); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLACK); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLACK, 3); + defs_init++; + } + + // black Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_black"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLACK, 1); + defs_init++; + } + + // Coal block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].item = new MaterialItem(CONTENT_COAL, 1); + defs_init++; + } + + // Charoal block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].item = new MaterialItem(CONTENT_CHARCOAL, 1); + defs_init++; + } + + // fire starter + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_flint"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + defs[defs_init].item = new ToolItem("FireStarter", 0); + defs_init++; + } + + // quartz dust + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].item = new CraftItem("quartz_dust", 1); + defs_init++; + } + + // gun powder + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "saltpeter"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_flint"); + defs[defs_init].item = new CraftItem("gunpowder", 2); + defs_init++; + } + + // tnt + if (g_settings->getBool("enable_tnt")) { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].item = new MaterialItem(CONTENT_TNT, 1); + defs_init++; + } } for (int i=0; isetNodeBox(core::aabbox3d( + -0.5*BS, + -0.5*BS, + -0.5*BS, + 0.5*BS, + -0.4*BS, + 0.5*BS + )); +} + /* A conversion table for backwards compatibility. Maps <=v19 content types to current ones. @@ -666,6 +678,30 @@ void content_mapnode_init() if(invisible_stone) f->solidness = 0; // For debugging, hides regular stone + i = CONTENT_COAL; + f = &content_features(i); + f->description = std::string("Coal Block"); + f->setAllTextures("coal.png"); + f->setInventoryTextureCube("coal.png", "coal.png", "coal.png"); + f->param_type = CPT_MINERAL; + 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"; + setStoneLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CHARCOAL; + f = &content_features(i); + f->description = std::string("Charcoal Block"); + f->setAllTextures("charcoal.png"); + f->setInventoryTextureCube("charcoal.png", "charcoal.png", "charcoal.png"); + f->param_type = CPT_MINERAL; + 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"; + setStoneLikeDiggingProperties(f->digging_properties, 1.0); + i = CONTENT_STONEBRICK; f = &content_features(i); f->description = std::string("Stone Brick"); @@ -741,6 +777,8 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->extra_dug_item = std::string("CraftItem lump_of_flint 1"); + f->extra_dug_item_rarity = 10; setDirtLikeDiggingProperties(f->digging_properties, 1.75); i = CONTENT_SANDSTONE; @@ -943,6 +981,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; 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"; setWoodLikeDiggingProperties(f->digging_properties, 1.0); @@ -956,6 +995,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; 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"; setWoodLikeDiggingProperties(f->digging_properties, 1.0); @@ -973,6 +1013,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_LEAVES; @@ -987,11 +1028,15 @@ void content_mapnode_init() 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->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"; @@ -1007,11 +1052,15 @@ void content_mapnode_init() 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->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setLeafLikeDiggingProperties(f->digging_properties, 0.15); @@ -1025,6 +1074,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; + 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"; setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -1041,6 +1091,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.25); i = CONTENT_BOOKSHELF; @@ -1053,10 +1104,12 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_GLASS; f = &content_features(i); + f->description = std::string("Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -1066,9 +1119,138 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->visual_solidness = 1; f->setAllTextures("glass.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif f->setInventoryTextureCube("glass.png", "glass.png", "glass.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.15); + i = CONTENT_GLASS_BLUE; + f = &content_features(i); + f->description = std::string("Blue Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_blue.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_blue.png", "glass_blue.png", "glass_blue.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_GREEN; + f = &content_features(i); + f->description = std::string("Green Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_green.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_green.png", "glass_green.png", "glass_green.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_orange.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_orange.png", "glass_orange.png", "glass_orange.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_purple.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_purple.png", "glass_purple.png", "glass_purple.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_RED; + f = &content_features(i); + f->description = std::string("Red Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_red.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_red.png", "glass_red.png", "glass_red.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_yellow.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_yellow.png", "glass_yellow.png", "glass_yellow.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_BLACK; + f = &content_features(i); + f->description = std::string("Black Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_black.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_black.png", "glass_black.png", "glass_black.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + i = CONTENT_GLASSLIGHT; f = &content_features(i); f->description = std::string("Glass Light"); @@ -1081,6 +1263,9 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->visual_solidness = 1; f->setAllTextures("glasslight.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif f->setInventoryTextureCube("glasslight.png", "glasslight.png", "glasslight.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.15); f->light_source = LIGHT_MAX-1; @@ -1098,6 +1283,7 @@ void content_mapnode_init() f->air_equivalent = true; // grass grows underneath f->setInventoryTexture("fence.png"); f->used_texturenames["fence.png"] = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_RAIL; @@ -1130,6 +1316,7 @@ void content_mapnode_init() f->air_equivalent = true; f->walkable = false; f->climbable = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.5); i = CONTENT_BORDERSTONE; @@ -1152,6 +1339,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLEWOOD; @@ -1162,6 +1350,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_MESE; @@ -1174,17 +1363,6 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setStoneLikeDiggingProperties(f->digging_properties, 0.5); - i = CONTENT_COTTON; - f = &content_features(i); - f->description = std::string("Cotton"); - f->setAllTextures("cotton.png"); - f->setInventoryTextureCube("cotton.png", "cotton.png", "cotton.png"); - f->param_type = CPT_MINERAL; - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - setDirtLikeDiggingProperties(f->digging_properties, 1.0); - i = CONTENT_SPONGE; f = &content_features(i); f->description = std::string("Sponge"); @@ -1194,6 +1372,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_SPONGE_FULL; @@ -1220,6 +1399,18 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setLeafLikeDiggingProperties(f->digging_properties, 0.6); + i = CONTENT_COTTON; + f = &content_features(i); + f->description = std::string("Cotton"); + f->setAllTextures("cotton.png"); + f->setInventoryTextureCube("cotton.png", "cotton.png", "cotton.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + i = CONTENT_COTTON_BLUE; f = &content_features(i); f->description = std::string("Blue Cotton"); @@ -1229,6 +1420,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_GREEN; @@ -1240,6 +1432,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_ORANGE; @@ -1251,6 +1444,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_PURPLE; @@ -1262,6 +1456,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_RED; @@ -1273,6 +1468,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_YELLOW; @@ -1284,6 +1480,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_BLACK; @@ -1295,6 +1492,119 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET; + f = &content_features(i); + f->description = std::string("Carpet"); + f->setAllTextures("cotton.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton.png", "cotton.png", "cotton.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_BLUE; + f = &content_features(i); + f->description = std::string("Blue Carpet"); + f->setAllTextures("cotton_blue.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_blue.png", "cotton_blue.png", "cotton_blue.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_GREEN; + f = &content_features(i); + f->description = std::string("Green Carpet"); + f->setAllTextures("cotton_green.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_green.png", "cotton_green.png", "cotton_green.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Carpet"); + f->setAllTextures("cotton_orange.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_orange.png", "cotton_orange.png", "cotton_orange.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Carpet"); + f->setAllTextures("cotton_purple.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_purple.png", "cotton_purple.png", "cotton_purple.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_RED; + f = &content_features(i); + f->description = std::string("Red Carpet"); + f->setAllTextures("cotton_red.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_red.png", "cotton_red.png", "cotton_red.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Carpet"); + f->setAllTextures("cotton_yellow.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_yellow.png", "cotton_yellow.png", "cotton_yellow.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_BLACK; + f = &content_features(i); + f->description = std::string("Black Carpet"); + f->setAllTextures("cotton_black.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_black.png", "cotton_black.png", "cotton_black.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_AIR; @@ -1428,6 +1738,7 @@ void content_mapnode_init() f->pointable = false; f->diggable = false; f->buildable_to = true; + f->flammable = 2; // can be set on fire f->liquid_type = LIQUID_FLOWING; f->liquid_alternative_flowing = CONTENT_LAVA; f->liquid_alternative_source = CONTENT_LAVASOURCE; @@ -1490,6 +1801,7 @@ void content_mapnode_init() f->pointable = false; //f->diggable = false; f->buildable_to = true; + f->flammable = 2; // can be set on fire f->liquid_type = LIQUID_SOURCE; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->liquid_alternative_flowing = CONTENT_LAVA; @@ -1517,6 +1829,44 @@ void content_mapnode_init() #endif setWaterLikeDiggingProperties(f->digging_properties, 0.5); + 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_PLANTLIKE; + 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 + + 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_PLANTLIKE; + 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 + i = CONTENT_TORCH; f = &content_features(i); f->description = std::string("Torch"); @@ -1530,6 +1880,7 @@ void content_mapnode_init() f->walkable = false; f->wall_mounted = true; f->air_equivalent = true; + 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->light_source = LIGHT_MAX-1; f->digging_properties.set("", DiggingProperties(true, 0.0, 0)); @@ -1547,6 +1898,7 @@ void content_mapnode_init() f->walkable = false; f->wall_mounted = true; f->air_equivalent = true; + 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"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1562,6 +1914,7 @@ void content_mapnode_init() f->param_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->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN_WALL)+" 1"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1593,6 +1946,7 @@ void content_mapnode_init() f->param_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->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN_WALL)+" 1"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1692,6 +2046,61 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setStoneLikeDiggingProperties(f->digging_properties, 5.0); + i = CONTENT_COPPER; + f = &content_features(i); + f->description = std::string("Copper Block"); + f->setAllTextures("copper_block.png"); + f->setInventoryTextureCube("copper_block.png", "copper_block.png", "copper_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_GOLD; + f = &content_features(i); + f->description = std::string("Gold Block"); + f->setAllTextures("gold_block.png"); + f->setInventoryTextureCube("gold_block.png", "gold_block.png", "gold_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_SILVER; + f = &content_features(i); + f->description = std::string("Silver Block"); + f->setAllTextures("silver_block.png"); + f->setInventoryTextureCube("silver_block.png", "silver_block.png", "silver_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_TIN; + f = &content_features(i); + f->description = std::string("Tin Block"); + f->setAllTextures("tin_block.png"); + f->setInventoryTextureCube("tin_block.png", "tin_block.png", "tin_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_QUARTZ; + f = &content_features(i); + f->description = std::string("Quartz Block"); + f->setAllTextures("quartz_block.png"); + f->setInventoryTextureCube("quartz_block.png", "quartz_block.png", "quartz_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + i = CONTENT_NC; f = &content_features(i); f->description = std::string("Nyan Cat"); @@ -1726,6 +2135,7 @@ void content_mapnode_init() 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->digging_properties.set("", DiggingProperties(true, 0.0, 0)); i = CONTENT_APPLE; @@ -1733,6 +2143,7 @@ void content_mapnode_init() 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; @@ -1740,6 +2151,7 @@ void content_mapnode_init() 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->dug_item = std::string("CraftItem apple 1"); f->digging_properties.set("", DiggingProperties(true, 0.0, 0)); @@ -1797,6 +2209,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_WOOD; content_mapnode_nodebox_slab(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_SLAB; @@ -1811,6 +2224,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_JUNGLEWOOD; content_mapnode_nodebox_slab(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_SLAB; @@ -1891,6 +2305,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_WOOD; content_mapnode_nodebox_slabud(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_SLAB_UD; @@ -1904,6 +2319,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_JUNGLEWOOD; content_mapnode_nodebox_slabud(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_SLAB_UD; @@ -1984,6 +2400,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; content_mapnode_nodebox_stair(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_STAIR; @@ -1997,6 +2414,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; content_mapnode_nodebox_stair(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_STAIR; @@ -2072,6 +2490,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_STAIR)+" 1"; content_mapnode_nodebox_stairud(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_STAIR_UD; @@ -2084,6 +2503,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_JUNGLE_STAIR)+" 1"; content_mapnode_nodebox_stairud(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_STAIR_UD; @@ -2125,6 +2545,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_LT; @@ -2141,6 +2562,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2195,6 +2617,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_LT; @@ -2211,6 +2634,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2266,6 +2690,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_RT; @@ -2282,6 +2707,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2336,6 +2762,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_RT; @@ -2352,6 +2779,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2405,6 +2833,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_LT_OPEN; @@ -2419,6 +2848,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2467,6 +2897,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_LT_OPEN; @@ -2481,6 +2912,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorwol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2532,6 +2964,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_RT_OPEN; @@ -2548,6 +2981,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2603,6 +3037,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_RT_OPEN; @@ -2619,6 +3054,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorwor(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2672,6 +3108,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatch(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2704,6 +3141,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatchw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2737,6 +3175,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_gate(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2772,6 +3211,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->climbable = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_HATCH)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatcho(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2808,6 +3248,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->climbable = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_HATCH)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatchwo(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2843,6 +3284,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_gateo(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2877,6 +3319,7 @@ void content_mapnode_init() 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->pointable = false; //f->buildable_to = true; setWoodLikeDiggingProperties(f->digging_properties, 0.10); @@ -2894,6 +3337,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WILDGRASS_SHORT)+" 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_DEADGRASS; @@ -2908,6 +3352,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_STEM; @@ -2922,6 +3367,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_ROSE; @@ -2936,6 +3382,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_DAFFODIL; @@ -2950,6 +3397,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_TULIP; @@ -2964,6 +3412,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_POT_RAW; @@ -3129,6 +3578,21 @@ void content_mapnode_init() f->setInventoryTexture("sandstone_wall_inv.png"); setDirtLikeDiggingProperties(f->digging_properties, 1.0); + 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->param_type = CPT_MINERAL; + 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 TNTNodeMetadata(); + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + // NOTE: Remember to add frequently used stuff to the texture atlas in tile.cpp diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 3a9f988..23effe3 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -233,6 +233,31 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_CLAY_RED 0x8AD #define CONTENT_CLAY_YELLOW 0x8AE #define CONTENT_CLAY_BLACK 0x8AF +#define CONTENT_GLASS_BLUE 0x8B0 +#define CONTENT_GLASS_GREEN 0x8B1 +#define CONTENT_GLASS_ORANGE 0x8B2 +#define CONTENT_GLASS_PURPLE 0x8B3 +#define CONTENT_GLASS_RED 0x8B4 +#define CONTENT_GLASS_YELLOW 0x8B5 +#define CONTENT_GLASS_BLACK 0x8B6 +#define CONTENT_CARPET 0x8B7 +#define CONTENT_CARPET_BLUE 0x8B8 +#define CONTENT_CARPET_GREEN 0x8B9 +#define CONTENT_CARPET_ORANGE 0x8BA +#define CONTENT_CARPET_PURPLE 0x8BB +#define CONTENT_CARPET_RED 0x8BC +#define CONTENT_CARPET_YELLOW 0x8BD +#define CONTENT_CARPET_BLACK 0x8BE +#define CONTENT_COAL 0x8BF +#define CONTENT_CHARCOAL 0x8C0 +#define CONTENT_TIN 0x8C1 +#define CONTENT_COPPER 0x8C2 +#define CONTENT_SILVER 0x8C3 +#define CONTENT_GOLD 0x8C4 +#define CONTENT_QUARTZ 0x8C5 +#define CONTENT_FIRE 0x8C6 +#define CONTENT_FIRE_SHORTTERM 0x8C7 +#define CONTENT_TNT 0x8C8 #endif diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 6684eb6..cbd510b 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -550,6 +550,13 @@ bool FurnaceNodeMetadata::step(float dtime) fuel_list->decrementMaterials(1); changed = true; } + else if(ItemSpec(ITEM_CRAFT, "lump_of_charcoal").checkItem(fuel_item)) + { + m_fuel_totaltime = 40; + m_fuel_time = 0; + fuel_list->decrementMaterials(1); + changed = true; + } else if(ItemSpec(ITEM_CRAFT, "lump_of_coal").checkItem(fuel_item)) { m_fuel_totaltime = 40; @@ -577,4 +584,57 @@ std::string FurnaceNodeMetadata::getInventoryDrawSpecString() "list[current_player;main;0,5;8,4;]"; } +/* + LockedDoorNodeMetadata +*/ +// Prototype +TNTNodeMetadata proto_TNTNodeMetadata; + +TNTNodeMetadata::TNTNodeMetadata(): + m_armed(false), + m_time(0) +{ + NodeMetadata::registerType(typeId(), create); +} +TNTNodeMetadata::~TNTNodeMetadata() +{ +} +u16 TNTNodeMetadata::typeId() const +{ + return CONTENT_TNT; +} +NodeMetadata* TNTNodeMetadata::create(std::istream &is) +{ + TNTNodeMetadata *d = new TNTNodeMetadata(); + int temp; + is>>temp; + d->m_time = (float)temp/10; + is>>temp; + d->m_armed = (bool)temp; + return d; +} +NodeMetadata* TNTNodeMetadata::clone() +{ + TNTNodeMetadata *d = new TNTNodeMetadata(); + return d; +} +bool TNTNodeMetadata::step(float dtime) +{ + if (!m_armed) + return false; + m_time -= dtime; + return true; +} +void TNTNodeMetadata::serializeBody(std::ostream &os) +{ + os<setDefault("full_block_send_enable_min_time_from_building", "2.0"); settings->setDefault("enable_experimental", "false"); settings->setDefault("enable_lavabuckets", "false"); + settings->setDefault("enable_tnt", "false"); } diff --git a/src/environment.cpp b/src/environment.cpp index 1605a52..915138a 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "collision.h" #include "content_mapnode.h" +#include "content_nodemeta.h" #include "mapblock.h" #include "serverobject.h" #include "content_sao.h" @@ -29,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" #include "log.h" #include "profiler.h" +#include "server.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" @@ -1101,8 +1103,8 @@ void ServerEnvironment::step(float dtime) */ if (n.getContent() == CONTENT_GRASS) { - int f = (1000-(p.Y*2))+10; - if (p.Y > -1 && myrand()%f == 0) { + int f = (10000-(p.Y*2))+10; + if (p.Y > 2 && myrand()%f == 0) { MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); if (n_top.getContent() == CONTENT_AIR && n_top.getLightBlend(getDayNightRatio()) >= 13) { v3f pp; @@ -1119,18 +1121,25 @@ void ServerEnvironment::step(float dtime) } if (n.getContent() == CONTENT_WILDGRASS_SHORT) { - if (p.Y > -1 && myrand()%200 == 0) { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); - if (n_btm.getContent() == CONTENT_GRASS && n_top.getLightBlend(getDayNightRatio()) >= 13) { - if (myrand()%5 == 0) { - n.setContent(CONTENT_FLOWER_STEM); - m_map->addNodeWithEvent(p, n); - }else{ - n.setContent(CONTENT_WILDGRASS_LONG); - m_map->addNodeWithEvent(p, n); + MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); + if (n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_MUD) { + if (p.Y > -1 && myrand()%200 == 0) { + MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); + if (n_btm.getContent() == CONTENT_GRASS) { + if (n_top.getLightBlend(getDayNightRatio()) >= 13) { + if (myrand()%5 == 0) { + n.setContent(CONTENT_FLOWER_STEM); + m_map->addNodeWithEvent(p, n); + }else{ + n.setContent(CONTENT_WILDGRASS_LONG); + m_map->addNodeWithEvent(p, n); + } + } } } + }else{ + n.setContent(CONTENT_DEADGRASS); + m_map->addNodeWithEvent(p, n); } } if (n.getContent() == CONTENT_WILDGRASS_LONG) @@ -1142,25 +1151,30 @@ void ServerEnvironment::step(float dtime) } if (n.getContent() == CONTENT_FLOWER_STEM) { - if (p.Y > -1 && myrand()%200 == 0) { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); - if ((n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_FLOWER_POT) && n_top.getLightBlend(getDayNightRatio()) >= 13) { - switch (myrand()%3) { - case 0: - n.setContent(CONTENT_FLOWER_ROSE); - m_map->addNodeWithEvent(p, n); - break; - case 1: - n.setContent(CONTENT_FLOWER_DAFFODIL); - m_map->addNodeWithEvent(p, n); - break; - case 2: - n.setContent(CONTENT_FLOWER_TULIP); - m_map->addNodeWithEvent(p, n); - break; + MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); + if (n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_MUD) { + if (p.Y > -1 && myrand()%200 == 0) { + MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); + if ((n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_FLOWER_POT) && n_top.getLightBlend(getDayNightRatio()) >= 13) { + switch (myrand()%3) { + case 0: + n.setContent(CONTENT_FLOWER_ROSE); + m_map->addNodeWithEvent(p, n); + break; + case 1: + n.setContent(CONTENT_FLOWER_DAFFODIL); + m_map->addNodeWithEvent(p, n); + break; + case 2: + n.setContent(CONTENT_FLOWER_TULIP); + m_map->addNodeWithEvent(p, n); + break; + } } } + }else{ + n.setContent(CONTENT_DEADGRASS); + m_map->addNodeWithEvent(p, n); } } if (n.getContent() == CONTENT_DEADGRASS) @@ -1184,6 +1198,103 @@ void ServerEnvironment::step(float dtime) m_map->addNodeWithEvent(p, n); } } + /* + fire that goes out + */ + if (n.getContent() == CONTENT_FIRE_SHORTTERM) { + if (myrand()%10 == 0) + m_map->removeNodeWithEvent(p); + } + /* + fire that spreads just a little + */ + if (n.getContent() == CONTENT_FIRE) { + if (myrand()%10) { + bool can_spread = true; + s16 bs_rad = g_settings->getS16("borderstone_radius"); + bs_rad += 2; + // if any node is border stone protected, don't spread + for(s16 x=-bs_rad; can_spread && x<=bs_rad; x++) + for(s16 y=-bs_rad; can_spread && y<=bs_rad; y++) + for(s16 z=-bs_rad; can_spread && z<=bs_rad; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_BORDERSTONE) + can_spread = false; + } + if (can_spread) { + for(s16 x=-1; x<=1; x++) + for(s16 y=0; y<=1; y++) + for(s16 z=-1; z<=1; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_FIRE || n_test.getContent() == CONTENT_FIRE_SHORTTERM) + continue; + if (content_features(n_test).flammable > 0) { + n_test.setContent(CONTENT_FIRE_SHORTTERM); + m_map->addNodeWithEvent(p+v3s16(x,y,z), n_test); + } + } + } + } + } + /* + boom + */ + if (n.getContent() == CONTENT_TNT) { + TNTNodeMetadata *meta = (TNTNodeMetadata*)m_map->getNodeMetadata(p); + if (meta && meta->getArmed() && meta->getTime() < 0.0) { + bool can_spread = true; + s16 bs_rad = g_settings->getS16("borderstone_radius"); + bs_rad += 3; + // if any node is border stone protected, don't destroy anything + for(s16 x=-bs_rad; can_spread && x<=bs_rad; x++) + for(s16 y=-bs_rad; can_spread && y<=bs_rad; y++) + for(s16 z=-bs_rad; can_spread && z<=bs_rad; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_BORDERSTONE) + can_spread = false; + } + if (can_spread) { + for(s16 x=-2; x<=2; x++) + for(s16 y=-2; y<=2; y++) + for(s16 z=-2; z<=2; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_AIR) + continue; + if (n_test.getContent() == CONTENT_TNT) { + meta = (TNTNodeMetadata*)m_map->getNodeMetadata(p+v3s16(x,y,z)); + if (meta && !meta->getArmed()) + meta->setArmed(true); + continue; + } + if ( + (x == -2 && y == -2) + || (x == 2 && y == -2) + || (x == -2 && y == 2) + || (x == 2 && y == 2) + || (z == -2 && y == -2) + || (z == 2 && y == -2) + || (z == -2 && y == 2) + || (z == 2 && y == 2) + || (x == -2 && z == -2) + || (x == 2 && z == -2) + || (x == -2 && z == 2) + || (x == 2 && z == 2) + ) { + if (myrand()%3 == 0) + continue; + } + m_map->removeNodeWithEvent(p+v3s16(x,y,z)); + } + } + // but still blow up + m_map->removeNodeWithEvent(p); + // TODO: damage nearby players + } + } /* Rats spawn around regular trees */ diff --git a/src/guiDeathScreen.h b/src/guiDeathScreen.h index 786abc6..acfce2e 100644 --- a/src/guiDeathScreen.h +++ b/src/guiDeathScreen.h @@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc., class IRespawnInitiator { public: + virtual ~IRespawnInitiator() {} virtual void respawn() = 0; }; diff --git a/src/guiTextInputMenu.h b/src/guiTextInputMenu.h index 1d8c981..78ec945 100644 --- a/src/guiTextInputMenu.h +++ b/src/guiTextInputMenu.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., struct TextDest { + virtual ~TextDest() {} virtual void gotText(std::wstring text) = 0; }; diff --git a/src/inventory.h b/src/inventory.h index 2a5b7dd..c7cdd98 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -346,14 +346,20 @@ public: return "tool_shears.png"; }else if (m_toolname == "WBucket") { return "tool_woodbucket.png"; + }else if (m_toolname == "TinBucket") { + return "tool_tinbucket.png"; }else if (m_toolname == "WBucket_water") { return "tool_woodbucket_water.png"; + }else if (m_toolname == "TinBucket_water") { + return "tool_tinbucket_water.png"; }else if(m_toolname == "SteelBucket") { return "tool_steelbucket.png"; }else if(m_toolname == "SteelBucket_water") { return "tool_steelbucket_water.png"; }else if(m_toolname == "SteelBucket_lava") { return "tool_steelbucket_lava.png"; + }else if (m_toolname == "FireStarter") { + return "tool_fire_starter.png"; }else{ return "cotton.png"; } @@ -427,6 +433,8 @@ public: return "Steel Bucket of Water"; }else if(m_toolname == "SteelBucket_lava") { return "Steel Bucket of Lava"; + }else if (m_toolname == "FireStarter") { + return "Fire Starter"; } return ""; @@ -620,6 +628,7 @@ public: struct InventoryAction { + virtual ~InventoryAction() {} static InventoryAction * deSerialize(std::istream &is); virtual u16 getType() const = 0; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 1ec8c3e..a913d80 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1821,22 +1821,21 @@ void make_block(BlockMakeData *data) MapNode new_content(CONTENT_IGNORE); u32 sparseness = 6; - if(noisebuf_ground_crumbleness.get(x,y+5,z) < -0.1) - { + if (noisebuf_ground_crumbleness.get(x,y+5,z) < -0.1) { new_content = MapNode(CONTENT_STONE, MINERAL_COAL); + }else if (noisebuf_ground_wetness.get(x,y+5,z) > 0.1) { + new_content = MapNode(CONTENT_STONE, MINERAL_IRON); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.4) { + new_content = MapNode(CONTENT_STONE, MINERAL_SILVER); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.3) { + new_content = MapNode(CONTENT_STONE, MINERAL_GOLD); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.2) { + new_content = MapNode(CONTENT_STONE, MINERAL_COPPER); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.1) { + new_content = MapNode(CONTENT_STONE, MINERAL_TIN); + }else if (noisebuf_ground_wetness.get(x,y+5,z) > 0.0) { + new_content = MapNode(CONTENT_STONE, MINERAL_QUARTZ); } - else - { - if(noisebuf_ground_wetness.get(x,y+5,z) > 0.0) - new_content = MapNode(CONTENT_STONE, MINERAL_IRON); - /*if(noisebuf_ground_wetness.get(x,y,z) > 0.0) - vmanip.m_data[i] = MapNode(CONTENT_MUD); - else - vmanip.m_data[i] = MapNode(CONTENT_SAND);*/ - } - /*else if(noisebuf_ground_crumbleness.get(x,y,z) > 0.1) - { - }*/ if(new_content.getContent() != CONTENT_IGNORE) { diff --git a/src/mapnode.h b/src/mapnode.h index bdcb32a..3a89f04 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -177,6 +177,8 @@ struct ContentFeatures bool climbable; // Player can build on these bool buildable_to; + // Whether fire can be started on top of it + u8 flammable; // Whether the node has no liquid, source liquid or flowing liquid enum LiquidType liquid_type; // If true, param2 is set to direction when placed. Used for torches. @@ -259,6 +261,7 @@ struct ContentFeatures diggable = true; climbable = false; buildable_to = false; + flammable = 0; liquid_type = LIQUID_NONE; wall_mounted = false; air_equivalent = false; @@ -314,6 +317,10 @@ struct ContentFeatures {} void setAllTextureFlags(u8 flags) {} + void setTextureType(u16 i, u8 type) + {} + void setAllTextureTypes(u8 type) + {} #else void setTexture(u16 i, std::string name, u8 alpha=255); @@ -335,6 +342,16 @@ struct ContentFeatures setTextureFlags(i, flags); } } + void setTextureType(u16 i, u8 type) + { + tiles[i].material_type = type; + } + void setAllTextureTypes(u8 type) + { + for (u16 i=0; i<6; i++) { + setTextureType(i, type); + } + } #endif #ifndef SERVER diff --git a/src/mineral.cpp b/src/mineral.cpp index afbff4e..4b178be 100644 --- a/src/mineral.cpp +++ b/src/mineral.cpp @@ -24,7 +24,12 @@ const char *mineral_filenames[MINERAL_COUNT] = { NULL, "mineral_coal.png", - "mineral_iron.png" + "mineral_iron.png", + "mineral_tin.png", + "mineral_copper.png", + "mineral_silver.png", + "mineral_gold.png", + "mineral_quartz.png" }; std::string mineral_textures[MINERAL_COUNT]; diff --git a/src/mineral.h b/src/mineral.h index 61776e6..7130178 100644 --- a/src/mineral.h +++ b/src/mineral.h @@ -35,17 +35,33 @@ void init_mineral(); #define MINERAL_NONE 0 #define MINERAL_COAL 1 #define MINERAL_IRON 2 +#define MINERAL_TIN 3 +#define MINERAL_COPPER 4 +#define MINERAL_SILVER 5 +#define MINERAL_GOLD 6 +#define MINERAL_QUARTZ 7 -#define MINERAL_COUNT 3 +#define MINERAL_COUNT 8 std::string mineral_block_texture(u8 mineral); inline CraftItem * getDiggedMineralItem(u8 mineral) { - if(mineral == MINERAL_COAL) + if (mineral == MINERAL_COAL) { return new CraftItem("lump_of_coal", 1); - else if(mineral == MINERAL_IRON) + }else if(mineral == MINERAL_IRON) { return new CraftItem("lump_of_iron", 1); + }else if(mineral == MINERAL_TIN) { + return new CraftItem("lump_of_tin", 1); + }else if(mineral == MINERAL_COPPER) { + return new CraftItem("lump_of_copper", 1); + }else if(mineral == MINERAL_SILVER) { + return new CraftItem("lump_of_silver", 1); + }else if(mineral == MINERAL_GOLD) { + return new CraftItem("lump_of_gold", 1); + }else if(mineral == MINERAL_QUARTZ) { + return new CraftItem("lump_of_quartz", 1); + } return NULL; } diff --git a/src/server.cpp b/src/server.cpp index e627a1f..654b516 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2456,6 +2456,49 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) continue; client->SetBlocksNotSent(modified_blocks); } + }else if (content_features(n).flammable > 1) { + const InventoryItem *wield = player->getWieldItem(); + if ( + wield && wield->getName() == std::string("ToolItem") + && ((ToolItem*)wield)->getToolName() == "FireStarter" + ) { + if (content_features(n).flammable == 2) { + MapNode a = m_env.getMap().getNodeNoEx(p_under+v3s16(0,1,0)); + if (a.getContent() == CONTENT_AIR || content_features(a).flammable > 0) { + a.setContent(CONTENT_FIRE); + core::list far_players; + sendAddNode(p_under+v3s16(0,1,0), a, 0, &far_players, 30); + core::map modified_blocks; + { + MapEditEventIgnorer ign(&m_ignore_map_edit_events); + + std::string p_name = std::string(player->getName()); + m_env.getMap().addNodeAndUpdate(p_under+v3s16(0,1,0), a, modified_blocks, p_name); + } + } + }else{ + n.setContent(CONTENT_FIRE_SHORTTERM); + core::list far_players; + sendAddNode(p_under, n, 0, &far_players, 30); + core::map modified_blocks; + { + MapEditEventIgnorer ign(&m_ignore_map_edit_events); + + std::string p_name = std::string(player->getName()); + m_env.getMap().addNodeAndUpdate(p_under, n, modified_blocks, p_name); + } + } + } + }else if (n.getContent() == CONTENT_TNT) { + const InventoryItem *wield = player->getWieldItem(); + if ( + wield && wield->getName() == std::string("ToolItem") + && ((ToolItem*)wield)->getToolName() == "FireStarter" + ) { + TNTNodeMetadata *meta = (TNTNodeMetadata*)m_env.getMap().getNodeMetadata(p_under); + if (meta && !meta->getArmed()) + meta->setArmed(true); + } } /* NOTE: This can be used in the future to check if @@ -2700,6 +2743,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } } } + MapNode a = m_env.getMap().getNode(p_under+v3s16(0,1,0)); + if (a.getContent() == CONTENT_FIRE) { + sendRemoveNode(p_under+v3s16(0,1,0), 0, &far_players, 30); + { + MapEditEventIgnorer ign(&m_ignore_map_edit_events); + m_env.getMap().removeNodeAndUpdate(p_under+v3s16(0,1,0), modified_blocks); + } + } /* Send the removal to all close-by players. - If other player is close, send REMOVENODE @@ -2776,6 +2827,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) && ( wieldname == std::string("WBucket") || wieldname == std::string("SteelBucket") + || wieldname == std::string("TinBucket") ) ) { std::string dug_s = std::string("ToolItem ") + wieldname + "_water 1"; @@ -2793,6 +2845,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) && ( wieldname == std::string("WBucket") || wieldname == std::string("SteelBucket") + || wieldname == std::string("TinBucket") ) ) { MapNode n = m_env.getMap().getNode(p_under);