Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
@@ -34,8 +34,8 @@ public class AssemblerFX extends EntityFX
final IAEItemStack item;
final EntityFloatingItem fi;
float time = 0;
final float speed;
float time = 0;
public AssemblerFX( World w, double x, double y, double z, double r, double g, double b, float speed, IAEItemStack is )
{
@@ -47,7 +47,7 @@ public class AssemblerFX extends EntityFX
this.speed = speed;
this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() );
w.spawnEntityInWorld( this.fi );
this.particleMaxAge = ( int ) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
this.noClip = true;
}
@@ -63,11 +63,11 @@ public class AssemblerFX extends EntityFX
{
super.onUpdate();
if ( this.isDead )
if( this.isDead )
this.fi.setDead();
else
{
float lifeSpan = ( float ) this.particleAge / ( float ) this.particleMaxAge;
float lifeSpan = (float) this.particleAge / (float) this.particleMaxAge;
this.fi.setProgress( lifeSpan );
}
}
@@ -76,13 +76,12 @@ public class AssemblerFX extends EntityFX
public void renderParticle( Tessellator tess, float l, float rX, float rY, float rZ, float rYZ, float rXY )
{
this.time += l;
if ( this.time > 4.0 )
if( this.time > 4.0 )
{
this.time -= 4.0;
// if ( CommonHelper.proxy.shouldAddParticles( r ) )
for ( int x = 0; x < ( int ) Math.ceil( this.speed / 5 ); x++ )
for( int x = 0; x < (int) Math.ceil( this.speed / 5 ); x++ )
CommonHelper.proxy.spawnEffect( EffectType.Crafting, this.worldObj, this.posX, this.posY, this.posZ, null );
}
}
}
@@ -29,7 +29,6 @@ public class ChargedOreFX extends EntityReddustFX
public ChargedOreFX( World w, double x, double y, double z, float r, float g, float b )
{
super( w, x, y, z, 0.21f, 0.61f, 1.0f );
}
@Override
@@ -38,9 +37,8 @@ public class ChargedOreFX extends EntityReddustFX
int j1 = super.getBrightnessForRender( par1 );
j1 = Math.max( j1 >> 20, j1 >> 4 );
j1 += 3;
if ( j1 > 15 )
if( j1 > 15 )
j1 = 15;
return j1 << 20 | j1 << 4;
}
}
@@ -43,12 +43,6 @@ public class CraftingFx extends EntityBreakingFX
private final int startBlkY;
private final int startBlkZ;
@Override
public int getFXLayer()
{
return 1;
}
public CraftingFx( World par1World, double par2, double par4, double par6, Item par8Item )
{
super( par1World, par2, par4, par6, par8Item );
@@ -68,6 +62,47 @@ public class CraftingFx extends EntityBreakingFX
this.noClip = true;
}
@Override
public int getFXLayer()
{
return 1;
}
@Override
public void renderParticle( Tessellator par1Tessellator, float partialTick, float x, float y, float z, float rx, float rz )
{
if( partialTick < 0 || partialTick > 1 )
return;
float f6 = this.particleTextureIndex.getMinU();
float f7 = this.particleTextureIndex.getMaxU();
float f8 = this.particleTextureIndex.getMinV();
float f9 = this.particleTextureIndex.getMaxV();
float scale = 0.1F * this.particleScale;
float offX = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick );
float offY = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick );
float offZ = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( offX );
int blkY = MathHelper.floor_double( offY );
int blkZ = MathHelper.floor_double( offZ );
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
offX -= interpPosX;
offY -= interpPosY;
offZ -= interpPosZ;
// AELog.info( "" + partialTick );
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale, f7, f9 );
par1Tessellator.addVertexWithUV( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale, f7, f8 );
par1Tessellator.addVertexWithUV( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale, f6, f8 );
par1Tessellator.addVertexWithUV( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale, f6, f9 );
}
}
public void fromItem( ForgeDirection d )
{
this.posX += 0.2 * d.offsetX;
@@ -83,44 +118,4 @@ public class CraftingFx extends EntityBreakingFX
this.particleScale *= 0.51f;
this.particleAlpha *= 0.51f;
}
@Override
public void renderParticle( Tessellator par1Tessellator, float partialTick, float x, float y, float z, float rx, float rz )
{
if ( partialTick < 0 || partialTick > 1 )
return;
float f6 = this.particleTextureIndex.getMinU();
float f7 = this.particleTextureIndex.getMaxU();
float f8 = this.particleTextureIndex.getMinV();
float f9 = this.particleTextureIndex.getMaxV();
float scale = 0.1F * this.particleScale;
float offX = ( float ) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick );
float offY = ( float ) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick );
float offZ = ( float ) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( offX );
int blkY = MathHelper.floor_double( offY );
int blkZ = MathHelper.floor_double( offZ );
if ( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
offX -= interpPosX;
offY -= interpPosY;
offZ -= interpPosZ;
// AELog.info( "" + partialTick );
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale,
f7, f9 );
par1Tessellator.addVertexWithUV( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale,
f7, f8 );
par1Tessellator.addVertexWithUV( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale,
f6, f8 );
par1Tessellator.addVertexWithUV( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale,
f6, f9 );
}
}
}
@@ -43,12 +43,6 @@ public class EnergyFx extends EntityBreakingFX
private final int startBlkY;
private final int startBlkZ;
@Override
public int getFXLayer()
{
return 1;
}
public EnergyFx( World par1World, double par2, double par4, double par6, Item par8Item )
{
super( par1World, par2, par4, par6, par8Item );
@@ -67,6 +61,40 @@ public class EnergyFx extends EntityBreakingFX
this.noClip = true;
}
@Override
public int getFXLayer()
{
return 1;
}
@Override
public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7 )
{
float f6 = this.particleTextureIndex.getMinU();
float f7 = this.particleTextureIndex.getMaxU();
float f8 = this.particleTextureIndex.getMinV();
float f9 = this.particleTextureIndex.getMaxV();
float f10 = 0.1F * this.particleScale;
float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX );
float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY );
float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( this.posX );
int blkY = MathHelper.floor_double( this.posY );
int blkZ = MathHelper.floor_double( this.posZ );
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9 );
}
}
public void fromItem( ForgeDirection d )
{
this.posX += 0.2 * d.offsetX;
@@ -82,37 +110,4 @@ public class EnergyFx extends EntityBreakingFX
this.particleScale *= 0.89f;
this.particleAlpha *= 0.89f;
}
@Override
public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7 )
{
float f6 = this.particleTextureIndex.getMinU();
float f7 = this.particleTextureIndex.getMaxU();
float f8 = this.particleTextureIndex.getMinV();
float f9 = this.particleTextureIndex.getMaxV();
float f10 = 0.1F * this.particleScale;
float f11 = ( float ) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX );
float f12 = ( float ) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY );
float f13 = ( float ) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( this.posX );
int blkY = MathHelper.floor_double( this.posY );
int blkZ = MathHelper.floor_double( this.posZ );
if ( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10,
f7, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10,
f7, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10,
f6, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10,
f6, f9 );
}
}
}
@@ -53,13 +53,11 @@ public class LightningArcFX extends LightningFX
double lastDirectionZ = this.rz * i;
double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ );
for ( int s = 0; s < this.steps; s++ )
for( int s = 0; s < this.steps; s++ )
{
this.Steps[s][0] = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
this.Steps[s][1] = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
this.Steps[s][2] = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
}
}
}
@@ -32,9 +32,19 @@ import net.minecraft.world.World;
public class LightningFX extends EntityFX
{
final int steps = this.getSteps();
private static final Random RANDOM_GENERATOR = new Random();
final int steps = this.getSteps();
final double[][] Steps;
final double[] I = new double[3];
final double[] K = new double[3];
float currentPoint = 0;
boolean hasData = false;
public LightningFX( World w, double x, double y, double z, double r, double g, double b )
{
this( w, x, y, z, r, g, b, 6 );
this.regen();
}
protected LightningFX( World w, double x, double y, double z, double r, double g, double b, int maxAge )
{
@@ -47,19 +57,24 @@ public class LightningFX extends EntityFX
this.noClip = true;
}
protected void regen()
{
double lastDirectionX = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionY = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionZ = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
for( int s = 0; s < this.steps; s++ )
{
this.Steps[s][0] = lastDirectionX = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][1] = lastDirectionY = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][2] = lastDirectionZ = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
}
}
private int getSteps()
{
return 5;
}
public LightningFX( World w, double x, double y, double z, double r, double g, double b )
{
this( w, x, y, z, r, g, b, 6 );
this.regen();
}
float currentPoint = 0;
@Override
public int getBrightnessForRender( float par1 )
{
@@ -67,25 +82,12 @@ public class LightningFX extends EntityFX
return j1 << 20 | j1 << 4;
}
protected void regen()
{
double lastDirectionX = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionY = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionZ = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
for ( int s = 0; s < this.steps; s++ )
{
this.Steps[s][0] = lastDirectionX = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][1] = lastDirectionY = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][2] = lastDirectionZ = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
}
}
@Override
public void renderParticle( Tessellator tess, float l, float rX, float rY, float rZ, float rYZ, float rXY )
{
float j = 1.0f;
tess.setColorRGBA_F( this.particleRed * j * 0.9f, this.particleGreen * j * 0.95f, this.particleBlue * j, this.particleAlpha );
if ( this.particleAge == 3 )
if( this.particleAge == 3 )
{
this.regen();
}
@@ -108,12 +110,12 @@ public class LightningFX extends EntityFX
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
double offX = -rZ;
double offY = MathHelper.cos( ( float ) ( Math.PI / 2.0f + p.rotationPitch * 0.017453292F ) );
double offY = MathHelper.cos( (float) ( Math.PI / 2.0f + p.rotationPitch * 0.017453292F ) );
double offZ = rX;
for ( int layer = 0; layer < 2; layer++ )
for( int layer = 0; layer < 2; layer++ )
{
if ( layer == 0 )
if( layer == 0 )
{
scale = 0.04;
offX *= 0.001;
@@ -130,7 +132,7 @@ public class LightningFX extends EntityFX
tess.setColorRGBA_F( this.particleRed * j * 0.9f, this.particleGreen * j * 0.65f, this.particleBlue * j * 0.85f, this.particleAlpha );
}
for ( int cycle = 0; cycle < 3; cycle++ )
for( int cycle = 0; cycle < 3; cycle++ )
{
this.clear();
@@ -138,7 +140,7 @@ public class LightningFX extends EntityFX
double y = ( this.prevPosY + ( this.posY - this.prevPosY ) * l - interpPosY ) - offY;
double z = ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * l - interpPosZ ) - offZ;
for ( int s = 0; s < this.steps; s++ )
for( int s = 0; s < this.steps; s++ )
{
double xN = x + this.Steps[s][0];
double yN = y + this.Steps[s][1];
@@ -148,26 +150,26 @@ public class LightningFX extends EntityFX
double yD = yN - y;
double zD = zN - z;
if ( cycle == 0 )
if( cycle == 0 )
{
ox = ( yD * 0 ) - ( 1 * zD );
oy = ( zD * 0 ) - ( 0 * xD );
oz = ( xD * 1 ) - ( 0 * yD );
}
if ( cycle == 1 )
if( cycle == 1 )
{
ox = ( yD * 1 ) - ( 0 * zD );
oy = ( zD * 0 ) - ( 1 * xD );
oz = ( xD * 0 ) - ( 0 * yD );
}
if ( cycle == 2 )
if( cycle == 2 )
{
ox = ( yD * 0 ) - ( 0 * zD );
oy = ( zD * 1 ) - ( 0 * xD );
oz = ( xD * 0 ) - ( 1 * yD );
}
double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( ( double ) this.steps - ( double ) s ) / this.steps ) * scale );
double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale );
ox /= ss;
oy /= ss;
oz /= ss;
@@ -194,13 +196,14 @@ public class LightningFX extends EntityFX
*/
}
boolean hasData = false;
final double[] I = new double[3];
final double[] K = new double[3];
private void clear()
{
this.hasData = false;
}
private void draw( Tessellator tess, double[] a, double[] b, double f6, double f8 )
{
if ( this.hasData )
if( this.hasData )
{
tess.addVertexWithUV( a[0], a[1], a[2], f6, f8 );
tess.addVertexWithUV( this.I[0], this.I[1], this.I[2], f6, f8 );
@@ -208,15 +211,10 @@ public class LightningFX extends EntityFX
tess.addVertexWithUV( b[0], b[1], b[2], f6, f8 );
}
this.hasData = true;
for ( int x = 0; x < 3; x++ )
for( int x = 0; x < 3; x++ )
{
this.I[x] = a[x];
this.K[x] = b[x];
}
}
private void clear()
{
this.hasData = false;
}
}
@@ -78,20 +78,15 @@ public class MatterCannonFX extends EntityBreakingFX
float f9 = this.particleTextureIndex.getMaxV();
float f10 = 0.05F * this.particleScale;
float f11 = ( float ) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX );
float f12 = ( float ) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY );
float f13 = ( float ) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX );
float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY );
float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
float f14 = 1.0F;
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10,
f7, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10,
f7, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10,
f6, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10,
f6, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8 );
par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9 );
}
}
@@ -46,7 +46,7 @@ public class VibrantFX extends EntityFX
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.particleMaxAge = ( int ) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
this.particleMaxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
this.noClip = true;
}
@@ -68,7 +68,7 @@ public class VibrantFX extends EntityFX
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.particleScale *= 0.95;
if ( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
if( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
{
this.setDead();
}