From cb3332c23dde7eae0c8339ffea9dc2c80a6715eb Mon Sep 17 00:00:00 2001 From: darkrose Date: Sun, 3 Jan 2016 22:30:37 +1000 Subject: [PATCH] wildgrass 32x textures --- data/textures/deadgrass.png | Bin 771 -> 803 bytes data/textures/wildgrass_long.png | Bin 764 -> 897 bytes data/textures/wildgrass_short.png | Bin 671 -> 605 bytes src/environment.cpp | 196 +++++++----------------------- 4 files changed, 41 insertions(+), 155 deletions(-) diff --git a/data/textures/deadgrass.png b/data/textures/deadgrass.png index 7500f401a5ca530427daf5cde399637cbfd24c87..6f24e573652036b986f457e56fc9486f5d0e8e60 100644 GIT binary patch literal 803 zcmV+;1Kj+HP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb0Rs#j5ov>h_5c6^wMj%lR9M69 zlubxfQ5462Gvkc&#&P_rg$}hz5`t=#P@4*gEc!r-s73Sv5d_*&g9t+?t%%UDC{hS% zp}Qhz6}V~V!mTCdq>kf!&%Algym>RX#d9W}^P$nQ`EM@oob%54-E+^qP*Ft{Ra8+$ z6;<>jr^HqY1;s8txYA9O@CV~u*GDxEI`{{cUgY{faItv8SHMZ<@vw~ z!!hjNSH8gaAIoKjvH(C!Crc)~H}KWutg-QONFThh;j_YQEBLbdkfya zI3q>|JBtpZ)oQ^ZRRPenV<%l#CyJi$hc{gUprzUMcSn#Lw(h{QJ1vR=WV0HQRLztAj-nl?sB zx;@tkfXR0k@*k?I7y%?ne`MBz3UWfl;jjVVaMYjds z0zsLq&~Hi324FH<44pOr#N#O*-9Ik;fdrbCB@|Y;d%Ioy^hD?%nl=F}EQU#If|*$_ z0G{O-(O4=!FS*@%eR0vb2 hqIg&104#g;^*7q}EC-v{=+^)M002ovPDHLkV1nVLYSjP$ delta 755 zcmVy{D6rE*^i~3jz`*E6;6Fu>b%9kV!;AR5(v%(#?t-RTzNb_d9=es;hdY zyAy-1vQTm5CPIh^2D~Hh#~TtvP;}!;1i^&KbWeA6)j6lmkBeCh;x#;v`TmEO*o`Gu zA%x75Bg!~-+n$m#h8vn3S<^~wjj{LSCaBi9+zUoq#bqiOr$B$fxbb*na2hTdtb(=f zs3iiGIT)xFr-X4U7^^K|353&%b&8Lkdv@M)j*$`+Cnj$99UG&u+F_bOY9^(Eb`^6? zneFJvCD1uxKX{xH!dz%n`ay#vI%{y+U_~)UVXlERXH4JstZQa>>j|k4mP*u>?Z$I$ zk!4E6T+yp$zZ-v9*G!Cs`I2#i!5nT5+=mI`!ZJ7RkAYz@c&9kr_N1aYr7N){rt^%J zjutz{zH%4`Ot=yOJrIWwpJn5b7Qwi6HHSl&Qs=Q z7|112t75t)wCXTfGhH*=o$#z53E_d$965bZeDcEc>?VI>rlrT4Bj?K<&Nr;Je7Oq0 zNagq;;5UgiTkg)4wpzX_k)NI?+@Luv8Ds1JokOkEBD{9O?>6)KrSNO__+;ok2mAEI zoaTwQbH~pwpPYApX57bxt*clpO9vz8W_#%pV zd+gh)ADzGWZ6??en&+EiW$XsNJ@qZ@Cb9iOURyh*AYn1o_V~p3PO<5FzIzv0YDJZb zlhy`5h=?Vvm0S#Og6F7KHdfl3_gad2d}7{DnSD1EHZry-4^r|%k_yeybfK(`Lcuvh lUK3R*rX`_G$ESbj_Aj}NeiHSLC!+uW002ovPDHLkV1nkPXhr}4 diff --git a/data/textures/wildgrass_long.png b/data/textures/wildgrass_long.png index c1bf87f15286623b5d7541ab0d3dea85fdca8665..4830c0e5240afcc2d525b8ff048a1b15e2aa59a4 100644 GIT binary patch literal 897 zcmV-{1AhF8P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb0Rs#gD0#=6IRF3y6G=otR9M69 zS4(RYK@hI)p4ms(#21Jc^$;+LCh;%mH77NPpm9U=n5#r0M1o2PM8um{K_o}Pi$6ro zLBX3R6Jqu?vpxMN53}9#>XJaXkKqF}F5>2i;2#13+sh zf+Gc>B_1t+zZr)DfcfNT0r(~QZveQ|USAzY9;$x>fO$o#8(SO(hWx_?Ftsr3lr^EG zz=o0t8!MY+_URQ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fa}P&@Q7vpUFfO0q6P0f6B-BGP!HP^9{i4_SAQ z!xuPJ0nZW0&*!*#^!19s#9WT6B@ezEdM7{ivr`oa1S=4!+M%z0T>!Ak`>uKz&UbU? zjTFlJu1fg#mjeJO?Kv=Qg76q4FMGJW=itGs9+q_gxawONdv}}v{H()04v@)O*eDd~ r;p<+NxN_j($LC#o^tO+`ukFx35y{D6rE*^j00TdGoAlVx0>;M1)EJ;K`R5;6h(n)UIMi_w6uO>FD$sVN0 zfOkG)?vq<3$R>aVCxEk%Y|+iB=06J|fLDEn_tdYyeZn0br71!v>?NXY$Mxi?sbD!H z>W!Q-O@z_+6j5jq=I;t?oMv7sw$q?tJofa~(ixZwI1Ra7X*GWWjV)McjZQ1ZlfpXV z2zww*8P{n(JoQ}ro?DF6pqW^>JRCS$gEJjgEUFb!s+g`}*Hk!-9i;{io#J8W>9itj z6`|n=11fQFmd;q5(ri(&wLsbm)_YIRh3lm!q)ONu(KJrSo>e0Il8B{Yvf<%6l5-)( z$~G6e!J;3}kGOx~i1QXHn(uFcus4*zUL=N!s*pc;Q~-vUNQa;d!D5|SOYRxVG8 zZpch~#=3UjS#-Jk#7^6N=MwHev3_XxoeOuL=zU4d>&lOLp^(_}PK=RlE@&*?d#p2D zFFhzt*c-QyS-(0tID<~F2l?4K?O>&6`|9N5c;@FPuYW1||B1BsC)#$J)77*7?PQOQ zlp9J5gZEM>93?eeu}q(>SPR2har;+^HiBqDPt&{ewLkLmxk@ZMU;f;r)=Dga=Ra-| ob3iFYt@-`Qwh?pX`S&XS0l^c7z&h2)!T= 13 ) { - plantgrowth_grass(this,p); + if ((n.param1&0x0F) != 0x00 && (n.param2&0x0F) == 0x0) { + int f = (700-(p.Y*2))+10; + if (p.Y > 1 && myrand()%f == 0) { + if ( + n_top.getContent() == CONTENT_AIR + && n_top.getLightBlend(getDayNightRatio()) >= 13 + ) { + v3f pp = intToFloat(p,BS); + Player *nearest = getNearestConnectedPlayer(pp); + if (nearest == NULL || nearest->getPosition().getDistanceFrom(pp)/BS > 20.0) { + std::vector search; + search.push_back(CONTENT_WILDGRASS_SHORT); + if (season != ENV_SEASON_SPRING) + search.push_back(CONTENT_WILDGRASS_LONG); + search.push_back(CONTENT_FLOWER_STEM); + search.push_back(CONTENT_FLOWER_ROSE); + search.push_back(CONTENT_FLOWER_TULIP); + search.push_back(CONTENT_FLOWER_DAFFODIL); + if (!searchNear(p,v3s16(1,1,1),search,NULL)) { + n_top.setContent(CONTENT_WILDGRASS_SHORT); + m_map->addNodeWithEvent(p+v3s16(0,1,0), n_top); + } + } + } + } + }else{ + plantgrowth_grass(this,p); + } } }else{ if (n.param1 == 0x01) { @@ -1404,155 +1431,6 @@ void ServerEnvironment::step(float dtime) break; } - /* - Convert grass and snow into mud if under something else than air - */ - - case CONTENT_MUDSNOW: - { - { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - u32 ch = m_time%60; - if (n_top.getContent() == CONTENT_SNOW) { - break; - }else if ( - p.Y < (coldzone-10) - && ( - ch > 10 - || ( - n_top.getLightBlend(getDayNightRatio()) >= 13 - && myrand_range(0,5) == 0 - ) || myrand_range(0,10) == 0 - ) - ) { - n.setContent(CONTENT_GRASS_AUTUMN); - m_map->addNodeWithEvent(p, n); - }else if ( - content_features(n_top).air_equivalent == false - && n_top.getContent() != CONTENT_IGNORE - && content_features(n_top).draw_type != CDT_PLANTLIKE - && content_features(n_top).draw_type != CDT_PLANTLIKE_SML - && content_features(n_top).draw_type != CDT_PLANTLIKE_LGE - && n_top.getContent() != CONTENT_SIGN - && n_top.getContent() != CONTENT_SNOW - ) { - n.setContent(CONTENT_MUD); - m_map->addNodeWithEvent(p, n); - } - } - } - case CONTENT_GRASS: - { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - ContentFeatures &f = content_features(n_top); - if (f.air_equivalent) { - if (n.envticks > 2) { - if ( - p.Y > (coldzone-10) - && p.Y < 1024 - && ( - m_time%60 > 10 - || myrand_range(0,10) == 0 - ) - ) { - // should only change to snow if there's nothing above it - std::vector search; - search.push_back(CONTENT_SNOW); - search.push_back(CONTENT_AIR); - if (!searchNearInv(p,v3s16(0,0,0),v3s16(0,32,0),search,NULL)) { - n.setContent(CONTENT_MUDSNOW); - m_map->addNodeWithEvent(p, n); - } - }else if ( - ( - season == ENV_SEASON_WINTER - || season == ENV_SEASON_AUTUMN - ) && ( - m_time%60 > 10 - || myrand_range(0,10) == 0 - ) - ) { - n.setContent(CONTENT_GRASS_AUTUMN); - m_map->addNodeWithEvent(p, n); - } - } - int f = (700-(p.Y*2))+10; - if (p.Y > 1 && myrand()%f == 0) { - if (n_top.getContent() == CONTENT_AIR && n_top.getLightBlend(getDayNightRatio()) >= 13) { - v3f pp = intToFloat(p,BS); - Player *nearest = getNearestConnectedPlayer(pp); - if (nearest == NULL || nearest->getPosition().getDistanceFrom(pp)/BS > 20.0) { - std::vector search; - search.push_back(CONTENT_WILDGRASS_SHORT); - if (season != ENV_SEASON_SPRING) - search.push_back(CONTENT_WILDGRASS_LONG); - search.push_back(CONTENT_FLOWER_STEM); - search.push_back(CONTENT_FLOWER_ROSE); - search.push_back(CONTENT_FLOWER_TULIP); - search.push_back(CONTENT_FLOWER_DAFFODIL); - if (!searchNear(p,v3s16(1,1,1),search,NULL)) { - n_top.setContent(CONTENT_WILDGRASS_SHORT); - m_map->addNodeWithEvent(p+v3s16(0,1,0), n_top); - } - } - } - } - }else if (n_top.getContent() != CONTENT_IGNORE) { - n.setContent(CONTENT_GRASS_AUTUMN); - m_map->addNodeWithEvent(p,n); - } - break; - } - case CONTENT_GRASS_AUTUMN: - { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - ContentFeatures &f = content_features(n_top); - u32 ch = m_time%60; - if (n_top.getContent() == CONTENT_SNOW) { - n.setContent(CONTENT_MUDSNOW); - m_map->addNodeWithEvent(p,n); - }else if (f.air_equivalent) { - if ((season == ENV_SEASON_SPRING && myrand_range(0,10) == 0) || season == ENV_SEASON_SUMMER) { - n.setContent(CONTENT_GRASS); - m_map->addNodeWithEvent(p,n); - }else if (season == ENV_SEASON_WINTER && p.Y > (coldzone-5) && (ch > 10 || myrand_range(0,5) == 0)) { - // should only change to snow if there's nothing above it - std::vector search; - search.push_back(CONTENT_SNOW); - search.push_back(CONTENT_AIR); - if (!searchNearInv(p,v3s16(0,0,0),v3s16(0,32,0),search,NULL)) { - n.setContent(CONTENT_MUDSNOW); - m_map->addNodeWithEvent(p, n); - } - }else{ - int f = (700-(p.Y*2))+10; - if (p.Y > 1 && myrand()%f == 0) { - if (n_top.getContent() == CONTENT_AIR && n_top.getLightBlend(getDayNightRatio()) >= 13) { - v3f pp = intToFloat(p,BS); - Player *nearest = getNearestConnectedPlayer(pp); - if (nearest == NULL || nearest->getPosition().getDistanceFrom(pp)/BS > 20.0) { - std::vector search; - search.push_back(CONTENT_WILDGRASS_SHORT); - search.push_back(CONTENT_WILDGRASS_LONG); - search.push_back(CONTENT_FLOWER_STEM); - search.push_back(CONTENT_FLOWER_ROSE); - search.push_back(CONTENT_FLOWER_TULIP); - search.push_back(CONTENT_FLOWER_DAFFODIL); - if (!searchNear(p,v3s16(1,1,1),search,NULL)) { - n_top.setContent(CONTENT_WILDGRASS_SHORT); - m_map->addNodeWithEvent(p+v3s16(0,1,0), n_top); - } - } - } - } - } - }else{ - n.setContent(CONTENT_MUD); - m_map->addNodeWithEvent(p,n); - } - break; - } - case CONTENT_WILDGRASS_SHORT: { MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); @@ -2806,12 +2684,18 @@ void ServerEnvironment::step(float dtime) } if ( - n.getContent() != CONTENT_GRASS - && n.getContent() != CONTENT_MUD - && p.Y >(coldzone+5) && p.Y < 1024 + p.Y >(coldzone+5) && p.Y < 1024 && ( content_features(n).draw_type == CDT_CUBELIKE || content_features(n).draw_type == CDT_GLASSLIKE + || ( + content_features(n).draw_type == CDT_DIRTLIKE + && (n.param1&0x20) != 0x20 + && ( + (n.param1&0x0F) == 0x00 + || (n.param1&0x0F) == 0x04 + ) + ) ) ) { if (myrand()%20 == 0) { @@ -2823,8 +2707,10 @@ void ServerEnvironment::step(float dtime) !searchNearInv(p,v3s16(0,1,0),v3s16(0,16,0),search,NULL) && !searchNear(p,v3s16(3,3,3),CONTENT_FIRE,NULL) ) { - MapNode n_top(CONTENT_SNOW); - m_map->addNodeWithEvent(p+v3s16(0,1,0), n_top); + n.param1 &= ~0x0F; + n.param1 |= 0x04; + n.envticks = 0; + m_map->addNodeWithEvent(p,n); } } }