From c64f4b190219821991d291c9abfbd09580f8fcfb Mon Sep 17 00:00:00 2001 From: Adubbz Date: Fri, 30 Aug 2013 17:17:24 +1000 Subject: [PATCH] Made steam particles animated --- .../textures/particles/steam.png | Bin 179 -> 1819 bytes .../particles/EntitySteamFX.java | 75 +++++++++++------- 2 files changed, 46 insertions(+), 29 deletions(-) mode change 100644 => 100755 src/minecraft/assets/biomesoplenty/textures/particles/steam.png diff --git a/src/minecraft/assets/biomesoplenty/textures/particles/steam.png b/src/minecraft/assets/biomesoplenty/textures/particles/steam.png old mode 100644 new mode 100755 index 18ee5fa9415eb8e744d8e9419483632fd9fa2755..7713c346e654c232438986964abf33047031abc1 GIT binary patch literal 1819 zcmeH|`9ISQ0LQ<`T;XxeF<0h_M?#SeQ|6gbb1RQ#(G#(d+-9hh(33=-+)s{NFGdQ( zTnSloC5ARfa>N|DhOwvTzj%Ilet3W0zkhytCplnHqQVNo004-hZIDhs9se(apr8BB z!ix$3$JG6-tQ^o*R;mtnf_(gL-2i}d5)WLbf+k(0Es}zqiopogE2zZe_as+m4>Cld zsvCq(FJak&OP1(5>T@uYq;iPBjkih{Iz!&L?hTc0v^7O&H&4e}i^T)Tuz* z5Ei?{PiV6EU1yrZy|tXXu5RyBO{Yv3;0vCUNOPRu+iZE)N12t?c?0Ut(@Vh_`InN1 z>qhMOMk<#udTCUeZ+c3-5HqCPYrG`;EJEh3ENu1-oJ8?TSC6xD4xXB-EnD6LX5rLQe3yI z!I8*luQ+~o>i%#HZ={OjR{1kxD02aY!&ON$K}>$a(Ct!@O9%d81_VX9+M#WY^A8nz*tUCU zNi(j>C)!tHg3jNZFFWzHfHAxh3X+SWBU)hk^B~1Z?1+D5KP{}1-6pDl@nP27kq#?Q-H0?e(;WSZORPufA?jTgN1JP^o zahNRaLv`%)*0fXnrp;@V z0u4HWg!7VOBx7%W#uuE`a>n!#=48KRa9TL8%^)?>WSnw(=^SN!MQDe1{7{J^7b;xm zf9WkjZ{wKU8F39z9%!uF<$XeBDA;|nApMn-ac?($3tAd}HTPR)awIH2S<5DAEycd8 zXV!?fA-{#~$=0lS#kYNwE_E6Pn-2K(qDHULY#uDw&3a2XG-r^8jRj4K6{0J{M~(Yr zE{~HcNGFA2`Wg+fpHYc2v@05xt;K3 zx0@biQbg7-+ieOH57#j<^G1a!0^3cL*@YsTIZ&E2tY+#!X~}Mu5!x^m8Ncf~poN61 zm?&_oO%&ibH7_)Umzohx@=nQFtLs4enj=H(J zK!_?Tmy8(monLTRc)Cjo398Bhy;yF20zp9HJp_zqmGk24k78{$zZ}9gdm?B?yL)Hz z!y4vyeM7!dKX3u)dgf!){1{UrHl}~WQaP_+H=i}N#`+qy6C0#5U`8+(X-D!lvI6;>1s;*b z3=Dj$K$tORwVDJ_P^!c=q9iy!t)x7$D3u`~F*C13&(AePq0Cs%RL{`B;7id$pelV& z7sn8d;N&0w|J%p)gbGL|i?SpMFl^q)rIgIWSkmJw!1ACbg>#L>Y6YhM=?o0h-yO1> TRoWE?)XL!L>gTe~DWM4fm98*& diff --git a/src/minecraft/biomesoplenty/particles/EntitySteamFX.java b/src/minecraft/biomesoplenty/particles/EntitySteamFX.java index 9ce6b2f03..cd72d8bff 100644 --- a/src/minecraft/biomesoplenty/particles/EntitySteamFX.java +++ b/src/minecraft/biomesoplenty/particles/EntitySteamFX.java @@ -12,6 +12,8 @@ import cpw.mods.fml.client.FMLClientHandler; public class EntitySteamFX extends EntityFX { private static final String texture = "biomesoplenty:textures/particles/steam.png"; + + float steamParticleScale; public EntitySteamFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { @@ -21,36 +23,37 @@ public class EntitySteamFX extends EntityFX public EntitySteamFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); - this.setParticleTextureIndex(9); - noClip = false; - motionX *= 0.10000000149011612D; - motionY *= 0.10000000149011612D; - motionZ *= 0.10000000149011612D; - motionX += par8; - motionY += par10; - motionZ += par12; - particleScale *= 0.75F; - particleScale *= par14; - particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); - particleMaxAge = (int)(particleMaxAge * par14); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= par14; + this.steamParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * par14); + this.noClip = false; } @Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { - float f6 = (particleAge + par2) / particleMaxAge * 32.0F; + float f = (particleAge + par2) / particleMaxAge * 32.0F; - if (f6 < 0.0F) + if (f < 0.0F) { - f6 = 0.0F; + f = 0.0F; } - if (f6 > 1.0F) + if (f > 1.0F) { - f6 = 1.0F; + f = 1.0F; } - particleScale = particleScale * f6; + particleScale = particleScale * f; tessellator.draw(); GL11.glPushMatrix(); @@ -60,21 +63,35 @@ public class EntitySteamFX extends EntityFX GL11.glBlendFunc(770, 1); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(texture)); + + float f6 = (float)this.particleTextureIndexX / 16.0F; + float f7 = f6 + 0.0624375F; + float f8 = (float)this.particleTextureIndexY / 16.0F; + float f9 = f8 + 0.0624375F; + float f10 = 0.1F * this.particleScale; - float sizeFactor = 0.1F * particleScale; - float var13 = (float)(prevPosX + (posX - prevPosX) * par2 - EntityFX.interpPosX); - float var14 = (float)(prevPosY + (posY - prevPosY) * par2 - EntityFX.interpPosY); - float var15 = (float)(prevPosZ + (posZ - prevPosZ) * par2 - EntityFX.interpPosZ); + if (this.particleIcon != null) + { + f6 = this.particleIcon.getMinU(); + f7 = this.particleIcon.getMaxU(); + f8 = this.particleIcon.getMinV(); + f9 = this.particleIcon.getMaxV(); + } + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float f14 = 1.0F; + tessellator.startDrawingQuads(); tessellator.setBrightness(10); - - tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 1.0F); - tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); - tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); - tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); - tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); - + + tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha); + tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9); + tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8); + tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8); + tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9); + tessellator.draw(); GL11.glDisable(3042);