mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 12:59:44 +00:00
Fix leaves and particles
This commit is contained in:
1 parent
fed1994838
commit
db6d43e457
6 files changed
+55
-50
No files matched your search
@@ -36,9 +36,9 @@ public class EntityFXBee extends EntityFX {
|
||||
this.particleScale *= 0.2F;
|
||||
this.particleMaxAge = (int) (80.0D / (Math.random() * 0.8D + 0.2D));
|
||||
|
||||
this.xSpeed *= 0.9D;
|
||||
this.ySpeed *= 0.015D;
|
||||
this.zSpeed *= 0.9D;
|
||||
this.motionX *= 0.9D;
|
||||
this.motionY *= 0.015D;
|
||||
this.motionZ *= 0.9D;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,21 +49,21 @@ public class EntityFXBee extends EntityFX {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
|
||||
if (this.particleAge == this.particleMaxAge / 2) {
|
||||
this.xSpeed = (this.originX - this.posX) * 0.04;
|
||||
this.zSpeed = (this.originZ - this.posZ) * 0.04;
|
||||
this.motionX = (this.originX - this.posX) * 0.04;
|
||||
this.motionZ = (this.originZ - this.posZ) * 0.04;
|
||||
}
|
||||
|
||||
if (this.particleAge < this.particleMaxAge / 4 || this.particleAge > this.particleMaxAge * 3 / 4) {
|
||||
this.xSpeed *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.ySpeed = (this.ySpeed + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.zSpeed *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.motionX *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.motionZ *= 0.92 + 0.2D * rand.nextFloat();
|
||||
} else {
|
||||
this.xSpeed *= 0.95;
|
||||
this.ySpeed = (this.ySpeed + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.zSpeed *= 0.95;
|
||||
this.motionX *= 0.95;
|
||||
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.motionZ *= 0.95;
|
||||
}
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
|
||||
@@ -79,6 +79,7 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
|
||||
|
||||
public BlockForestryLeaves() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(CHECK_DECAY, true).withProperty(DECAYABLE, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,8 +90,12 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS});
|
||||
return new ExtendedBlockState(this, new IProperty[]{DECAYABLE, CHECK_DECAY}, new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS});
|
||||
}
|
||||
|
||||
public int getMetaFromState(IBlockState state){
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TILE ENTITY */
|
||||
@Override
|
||||
|
||||
@@ -48,21 +48,21 @@ public class EntityFXColoredDripParticle extends EntityFX {
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
this.ySpeed -= this.particleGravity;
|
||||
this.motionY -= this.particleGravity;
|
||||
|
||||
if (this.bobTimer-- > 0) {
|
||||
this.xSpeed *= 0.02D;
|
||||
this.ySpeed *= 0.02D;
|
||||
this.zSpeed *= 0.02D;
|
||||
this.motionX *= 0.02D;
|
||||
this.motionY *= 0.02D;
|
||||
this.motionZ *= 0.02D;
|
||||
this.setParticleTextureIndex(113);
|
||||
} else {
|
||||
this.setParticleTextureIndex(112);
|
||||
}
|
||||
|
||||
this.moveEntity(this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.xSpeed *= 0.9800000190734863D;
|
||||
this.ySpeed *= 0.9800000190734863D;
|
||||
this.zSpeed *= 0.9800000190734863D;
|
||||
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.setExpired();
|
||||
@@ -71,8 +71,8 @@ public class EntityFXColoredDripParticle extends EntityFX {
|
||||
if (this.isCollided) {
|
||||
this.setParticleTextureIndex(114);
|
||||
|
||||
this.xSpeed *= 0.699999988079071D;
|
||||
this.zSpeed *= 0.699999988079071D;
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
|
||||
IBlockState state = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)));
|
||||
|
||||
@@ -25,10 +25,10 @@ public class EntityFXIgnition extends EntityFX {
|
||||
|
||||
public EntityFXIgnition(World world, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
this.xSpeed *= 0.8;
|
||||
this.ySpeed *= 0.8;
|
||||
this.zSpeed *= 0.8;
|
||||
this.ySpeed = this.rand.nextFloat() * 0.4F + 0.05F;
|
||||
this.motionX *= 0.8;
|
||||
this.motionY *= 0.8;
|
||||
this.motionZ *= 0.8;
|
||||
this.motionY = this.rand.nextFloat() * 0.4F + 0.05F;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
|
||||
this.particleScale *= this.rand.nextFloat() / 2 + 0.3F;
|
||||
this.ignitionParticleScale = this.particleScale;
|
||||
@@ -67,18 +67,18 @@ public class EntityFXIgnition extends EntityFX {
|
||||
float f = (float) this.particleAge / (float) this.particleMaxAge;
|
||||
|
||||
if (this.rand.nextFloat() > f * 2) {
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ);
|
||||
}
|
||||
|
||||
this.ySpeed -= 0.03D;
|
||||
this.moveEntity(this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.xSpeed *= 0.999D;
|
||||
this.ySpeed *= 0.999D;
|
||||
this.zSpeed *= 0.999D;
|
||||
this.motionY -= 0.03D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.999D;
|
||||
this.motionY *= 0.999D;
|
||||
this.motionZ *= 0.999D;
|
||||
|
||||
if (this.isCollided) {
|
||||
this.xSpeed *= 0.7;
|
||||
this.zSpeed *= 0.7;
|
||||
this.motionX *= 0.7;
|
||||
this.motionZ *= 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,10 @@ public class EntityFXSmoke extends EntityFX {
|
||||
|
||||
public EntityFXSmoke(World world, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
this.xSpeed *= 0.8;
|
||||
this.xSpeed *= 0.8;
|
||||
this.xSpeed *= 0.8;
|
||||
this.xSpeed = this.rand.nextFloat() * 0.2F + 0.05F;
|
||||
this.motionX *= 0.8;
|
||||
this.motionY *= 0.8;
|
||||
this.motionZ *= 0.8;
|
||||
this.motionY = this.rand.nextFloat() * 0.2F + 0.05F;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
|
||||
this.particleScale *= this.rand.nextFloat() / 4;
|
||||
this.ignitionParticleScale = this.particleScale;
|
||||
@@ -66,18 +66,18 @@ public class EntityFXSmoke extends EntityFX {
|
||||
float f = (float) this.particleAge / (float) this.particleMaxAge;
|
||||
|
||||
if (this.rand.nextFloat() > f * 2) {
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY, this.posZ, this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ);
|
||||
}
|
||||
|
||||
this.ySpeed -= 0.03D;
|
||||
this.moveEntity(this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
this.xSpeed *= 0.999D;
|
||||
this.ySpeed *= 0.999D;
|
||||
this.zSpeed *= 0.999D;
|
||||
this.motionY -= 0.03D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.999D;
|
||||
this.motionY *= 0.999D;
|
||||
this.motionZ *= 0.999D;
|
||||
|
||||
if (this.isCollided) {
|
||||
this.xSpeed *= 0.7;
|
||||
this.zSpeed *= 0.7;
|
||||
this.motionX *= 0.7;
|
||||
this.motionZ *= 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,9 +27,9 @@ public class EntityFXSnow extends EntityFX {
|
||||
this.particleScale *= 0.5F;
|
||||
this.particleMaxAge = (int) (40.0D / (Math.random() * 0.8D + 0.2D));
|
||||
|
||||
this.xSpeed *= 0.01D;
|
||||
this.ySpeed *= -0.4D;
|
||||
this.zSpeed *= 0.01D;
|
||||
this.motionX *= 0.01D;
|
||||
this.motionY *= -0.4D;
|
||||
this.motionZ *= 0.01D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user