reformatted all src files (#141)
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
@@ -29,140 +31,125 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CraftingFx extends ParticleBreaking {
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public class CraftingFx extends ParticleBreaking
|
||||
{
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
private final int startBlkX;
|
||||
private final int startBlkY;
|
||||
private final int startBlkZ;
|
||||
|
||||
private final int startBlkX;
|
||||
private final int startBlkY;
|
||||
private final int startBlkZ;
|
||||
public CraftingFx(final World par1World, final double par2, final double par4, final double par6, final Item par8Item) {
|
||||
super(par1World, par2, par4, par6, par8Item);
|
||||
this.particleGravity = 0;
|
||||
this.particleBlue = 1;
|
||||
this.particleGreen = 0.9f;
|
||||
this.particleRed = 1;
|
||||
this.particleAlpha = 1.3f;
|
||||
this.particleScale = 1.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
this.particleMaxAge /= 1.2;
|
||||
|
||||
public CraftingFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item )
|
||||
{
|
||||
super( par1World, par2, par4, par6, par8Item );
|
||||
this.particleGravity = 0;
|
||||
this.particleBlue = 1;
|
||||
this.particleGreen = 0.9f;
|
||||
this.particleRed = 1;
|
||||
this.particleAlpha = 1.3f;
|
||||
this.particleScale = 1.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
this.particleMaxAge /= 1.2;
|
||||
this.startBlkX = MathHelper.floor(this.posX);
|
||||
this.startBlkY = MathHelper.floor(this.posY);
|
||||
this.startBlkZ = MathHelper.floor(this.posZ);
|
||||
}
|
||||
|
||||
this.startBlkX = MathHelper.floor( this.posX );
|
||||
this.startBlkY = MathHelper.floor( this.posY );
|
||||
this.startBlkZ = MathHelper.floor( this.posZ );
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public void renderParticle(final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz) {
|
||||
if (partialTick < 0 || partialTick > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz )
|
||||
{
|
||||
if( partialTick < 0 || partialTick > 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
final float f6 = this.particleTextureIndex.getMinU();
|
||||
final float f7 = this.particleTextureIndex.getMaxU();
|
||||
final float f8 = this.particleTextureIndex.getMinV();
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final float scale = 0.1F * this.particleScale;
|
||||
|
||||
final float f6 = this.particleTextureIndex.getMinU();
|
||||
final float f7 = this.particleTextureIndex.getMaxU();
|
||||
final float f8 = this.particleTextureIndex.getMinV();
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final 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 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 );
|
||||
final int blkX = MathHelper.floor(offX);
|
||||
final int blkY = MathHelper.floor(offY);
|
||||
final int blkZ = MathHelper.floor(offZ);
|
||||
if (blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ) {
|
||||
offX -= interpPosX;
|
||||
offY -= interpPosY;
|
||||
offZ -= interpPosZ;
|
||||
|
||||
final int blkX = MathHelper.floor( offX );
|
||||
final int blkY = MathHelper.floor( offY );
|
||||
final int blkZ = MathHelper.floor( offZ );
|
||||
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
|
||||
{
|
||||
offX -= interpPosX;
|
||||
offY -= interpPosY;
|
||||
offZ -= interpPosZ;
|
||||
int i = this.getBrightnessForRender(partialTick);
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
|
||||
int i = this.getBrightnessForRender( partialTick );
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
// AELog.info( "" + partialTick );
|
||||
final float f14 = 1.0F;
|
||||
par1Tessellator.pos(offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale)
|
||||
.tex(f7, f9)
|
||||
.color(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha)
|
||||
.lightmap(j, k)
|
||||
.endVertex();
|
||||
par1Tessellator.pos(offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale)
|
||||
.tex(f7, f8)
|
||||
.color(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha)
|
||||
.lightmap(j, k)
|
||||
.endVertex();
|
||||
par1Tessellator.pos(offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale)
|
||||
.tex(f6, f8)
|
||||
.color(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha)
|
||||
.lightmap(j, k)
|
||||
.endVertex();
|
||||
par1Tessellator.pos(offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale)
|
||||
.tex(f6, f9)
|
||||
.color(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha)
|
||||
.lightmap(j, k)
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
// AELog.info( "" + partialTick );
|
||||
final float f14 = 1.0F;
|
||||
par1Tessellator.pos( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale )
|
||||
.tex( f7, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale )
|
||||
.tex( f7, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale )
|
||||
.tex( f6, f8 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
par1Tessellator.pos( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale )
|
||||
.tex( f6, f9 )
|
||||
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
.lightmap( j, k )
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
public void fromItem(final AEPartLocation d) {
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
{
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
this.motionY -= 0.04D * this.particleGravity;
|
||||
this.move(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
this.particleScale *= 0.51f;
|
||||
this.particleAlpha *= 0.51f;
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * this.particleGravity;
|
||||
this.move( this.motionX, this.motionY, this.motionZ );
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
this.particleScale *= 0.51f;
|
||||
this.particleAlpha *= 0.51f;
|
||||
}
|
||||
public void setMotionX(float motionX) {
|
||||
this.motionX = motionX;
|
||||
}
|
||||
|
||||
public void setMotionX( float motionX )
|
||||
{
|
||||
this.motionX = motionX;
|
||||
}
|
||||
public void setMotionY(float motionY) {
|
||||
this.motionY = motionY;
|
||||
}
|
||||
|
||||
public void setMotionY( float motionY )
|
||||
{
|
||||
this.motionY = motionY;
|
||||
}
|
||||
|
||||
public void setMotionZ( float motionZ )
|
||||
{
|
||||
this.motionZ = motionZ;
|
||||
}
|
||||
public void setMotionZ(float motionZ) {
|
||||
this.motionZ = motionZ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user