Posted March 3, 201510 yr i cant understand why this particle is falling through blocks instead of stopping on top of them? fyi Precipitation extends EntityFX public class DWRainFX extends Precipitation { private static final String __OBFID = "CL_00000934"; public DWRainFX(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); this.motionX *= 0.30000001192092896D; this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); this.motionZ *= 0.30000001192092896D; this.particleRed = 1.0F; this.particleGreen = 1.0F; this.particleBlue = 1.0F; this.setSize(0.01F, 0.01F); this.particleGravity = 0.06F; this.particleMaxAge = 35/*(int)(8.0D / (Math.random() * 0.8D + 0.2D))*/; } /** * Called to update the entity's position/logic. */ public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.motionY -= (double)this.particleGravity; this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.9800000190734863D; this.motionY *= 0.9800000190734863D; this.motionZ *= 0.9800000190734863D; if (this.particleMaxAge-- <= 0) { this.setDead(); } if (this.onGround) { // this.worldObj.set if (Math.random() < 0.5D) { this.setDead(); } this.motionX *= 0.699999988079071D; this.motionZ *= 0.699999988079071D; //this.motionY = 0.0; } Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial(); if (material.isLiquid() || material.isSolid()) { double d0 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); if (this.posY < d0) { this.setDead(); } } } public int getID(){ return 1; } public String getName(){ return "rain"; } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.