Relocate Source to proper directory.

This commit is contained in:
AlgorithmX2
2014-09-23 19:26:27 -05:00
parent fe927ce65d
commit 386d18a059
785 changed files with 35585 additions and 35580 deletions
@@ -0,0 +1,65 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.EffectType;
import appeng.core.CommonHelper;
import appeng.entity.EntityFloatingItem;
public class AssemblerFX extends EntityFX
{
IAEItemStack item;
EntityFloatingItem fi;
float time = 0;
float speed;
public AssemblerFX(World w, double x, double y, double z, double r, double g, double b, float speed, IAEItemStack is) {
super( w, x, y, z, r, g, b );
motionX = 0;
motionY = 0;
motionZ = 0;
item = is;
this.speed = speed;
fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() );
w.spawnEntityInWorld( fi );
particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
}
@Override
public int getBrightnessForRender(float par1)
{
int j1 = 13;
return j1 << 20 | j1 << 4;
}
@Override
public void onUpdate()
{
super.onUpdate();
if ( isDead )
fi.setDead();
else
{
float lifeSpan = (float) this.particleAge / (float) this.particleMaxAge;
fi.setProgress( lifeSpan );
}
}
@Override
public void renderParticle(Tessellator tess, float l, float rX, float rY, float rZ, float rYZ, float rXY)
{
time += l;
if ( time > 4.0 )
{
time -= 4.0;
// if ( CommonHelper.proxy.shouldAddParticles( r ) )
for (int x = 0; x < (int) Math.ceil( speed / 5 ); x++)
CommonHelper.proxy.spawnEffect( EffectType.Crafting, worldObj, posX, posY, posZ, null );
}
}
}
@@ -0,0 +1,25 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityReddustFX;
import net.minecraft.world.World;
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
public int getBrightnessForRender(float par1)
{
int j1 = super.getBrightnessForRender( par1 );
j1 = Math.max( j1 >> 20, j1 >> 4 );
j1 += 3;
if ( j1 > 15 )
j1 = 15;
return j1 << 20 | j1 << 4;
}
}
@@ -0,0 +1,98 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.client.texture.ExtraBlockTextures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class CraftingFx extends EntityBreakingFX
{
private IIcon particleTextureIndex;
private int startBlkX;
private int startBlkY;
private int startBlkZ;
public int getFXLayer()
{
return 1;
}
public CraftingFx(World par1World, double par2, double par4, double par6, Item par8Item) {
super( par1World, par2, par4, par6, par8Item );
particleGravity = 0;
this.particleBlue = 1;
this.particleGreen = 0.9f;
this.particleRed = 1;
this.particleAlpha = 1.3f;
this.particleScale = 1.5f;
this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon();
particleMaxAge /= 1.2;
startBlkX = MathHelper.floor_double( posX );
startBlkY = MathHelper.floor_double( posY );
startBlkZ = MathHelper.floor_double( posZ );
}
public void fromItem(ForgeDirection d)
{
this.posX += 0.2 * d.offsetX;
this.posY += 0.2 * d.offsetY;
this.posZ += 0.2 * d.offsetZ;
this.particleScale *= 0.8f;
}
public void onUpdate()
{
super.onUpdate();
this.particleScale *= 0.51f;
this.particleAlpha *= 0.51f;
}
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) * (double) partialTick);
float offy = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) partialTick);
float offz = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) 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 == startBlkX && blkY == startBlkY && blkZ == 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( (double) (offx - x * scale - rx * scale), (double) (offy - y * scale), (double) (offz - z * scale - rz * scale),
(double) f7, (double) f9 );
par1Tessellator.addVertexWithUV( (double) (offx - x * scale + rx * scale), (double) (offy + y * scale), (double) (offz - z * scale + rz * scale),
(double) f7, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (offx + x * scale + rx * scale), (double) (offy + y * scale), (double) (offz + z * scale + rz * scale),
(double) f6, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (offx + x * scale - rx * scale), (double) (offy - y * scale), (double) (offz + z * scale - rz * scale),
(double) f6, (double) f9 );
}
}
}
@@ -0,0 +1,90 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.client.texture.ExtraBlockTextures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class EnergyFx extends EntityBreakingFX
{
private IIcon particleTextureIndex;
private int startBlkX;
private int startBlkY;
private int startBlkZ;
public int getFXLayer()
{
return 1;
}
public EnergyFx(World par1World, double par2, double par4, double par6, Item par8Item) {
super( par1World, par2, par4, par6, par8Item );
particleGravity = 0;
this.particleBlue = 255;
this.particleGreen = 255;
this.particleRed = 255;
this.particleAlpha = 1.4f;
this.particleScale = 3.5f;
this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon();
startBlkX = MathHelper.floor_double( posX );
startBlkY = MathHelper.floor_double( posY );
startBlkZ = MathHelper.floor_double( posZ );
}
public void fromItem(ForgeDirection d)
{
this.posX += 0.2 * d.offsetX;
this.posY += 0.2 * d.offsetY;
this.posZ += 0.2 * d.offsetZ;
this.particleScale *= 0.8f;
}
public void onUpdate()
{
super.onUpdate();
this.particleScale *= 0.89f;
this.particleAlpha *= 0.89f;
}
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) * (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;
int blkX = MathHelper.floor_double( posX );
int blkY = MathHelper.floor_double( posY );
int blkZ = MathHelper.floor_double( posZ );
if ( blkX == startBlkX && blkY == startBlkY && blkZ == startBlkZ )
{
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10),
(double) f7, (double) f9 );
par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10),
(double) f7, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10),
(double) f6, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10),
(double) f6, (double) f9 );
}
}
}
@@ -0,0 +1,38 @@
package appeng.client.render.effects;
import net.minecraft.world.World;
public class LightningArcFX extends LightningFX
{
double rx, ry, rz;
public LightningArcFX(World w, double x, double y, double z, double ex, double ey, double ez, double r, double g, double b) {
super( w, x, y, z, r, g, b, 6 );
this.rx = ex - x;
this.ry = ey - y;
this.rz = ez - z;
regen();
}
@Override
protected void regen()
{
double i = 1.0 / (steps - 1);
double lastDirectionX = rx * i;
double lastDirectionY = ry * i;
double lastDirectionZ = rz * i;
double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ );
for (int s = 0; s < steps; s++)
{
Steps[s][0] = (lastDirectionX + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
Steps[s][1] = (lastDirectionY + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
Steps[s][2] = (lastDirectionZ + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
}
}
}
@@ -0,0 +1,199 @@
package appeng.client.render.effects;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class LightningFX extends EntityFX
{
final int steps = getSteps();
static Random rng = new Random();
double[][] Steps;
protected LightningFX(World w, double x, double y, double z, double r, double g, double b, int maxAge) {
super( w, x, y, z, r, g, b );
Steps = new double[steps][3];
motionX = 0;
motionY = 0;
motionZ = 0;
particleMaxAge = maxAge;
}
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 );
regen();
}
float currentPoint = 0;
@Override
public int getBrightnessForRender(float par1)
{
int j1 = 13;
return j1 << 20 | j1 << 4;
}
protected void regen()
{
double lastDirectionX = (rng.nextDouble() - 0.5) * 0.9;
double lastDirectionY = (rng.nextDouble() - 0.5) * 0.9;
double lastDirectionZ = (rng.nextDouble() - 0.5) * 0.9;
for (int s = 0; s < steps; s++)
{
Steps[s][0] = lastDirectionX = (lastDirectionX + (rng.nextDouble() - 0.5) * 0.9) / 2.0;
Steps[s][1] = lastDirectionY = (lastDirectionY + (rng.nextDouble() - 0.5) * 0.9) / 2.0;
Steps[s][2] = lastDirectionZ = (lastDirectionZ + (rng.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 ( particleAge == 3 )
{
regen();
}
double f6 = this.particleTextureIndexX / 16.0;
double f7 = f6 + 0.0324375F;
double f8 = this.particleTextureIndexY / 16.0;
double f9 = f8 + 0.0324375F;
f6 = f7;
f8 = f9;
double scale = 0.02;// 0.02F * this.particleScale;
double a[] = new double[3];
double b[] = new double[3];
double ox = 0;
double oy = 0;
double oz = 0;
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
double offX = -rZ;
double offY = MathHelper.cos( (float) (Math.PI / 2.0f + p.rotationPitch * 0.017453292F) );
double offZ = rX;
for (int layer = 0; layer < 2; layer++)
{
if ( layer == 0 )
{
scale = 0.04;
offX *= 0.001;
offY *= 0.001;
offZ *= 0.001;
tess.setColorRGBA_F( this.particleRed * j * 0.4f, this.particleGreen * j * 0.25f, this.particleBlue * j * 0.45f, this.particleAlpha );
}
else
{
offX = 0;
offY = 0;
offZ = 0;
scale = 0.02;
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++)
{
clear();
double x = (this.prevPosX + (this.posX - this.prevPosX) * (double) l - interpPosX) - offX;
double y = (this.prevPosY + (this.posY - this.prevPosY) * (double) l - interpPosY) - offY;
double z = (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) l - interpPosZ) - offZ;
for (int s = 0; s < steps; s++)
{
double xN = x + Steps[s][0];
double yN = y + Steps[s][1];
double zN = z + Steps[s][2];
double xD = xN - x;
double yD = yN - y;
double zD = zN - z;
if ( cycle == 0 )
{
ox = (yD * 0) - (1 * zD);
oy = (zD * 0) - (0 * xD);
oz = (xD * 1) - (0 * yD);
}
if ( cycle == 1 )
{
ox = (yD * 1) - (0 * zD);
oy = (zD * 0) - (1 * xD);
oz = (xD * 0) - (0 * yD);
}
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) steps - (double) s) / (double) steps) * scale);
ox /= ss;
oy /= ss;
oz /= ss;
a[0] = x + ox;
a[1] = y + oy;
a[2] = z + oz;
b[0] = x;
b[1] = y;
b[2] = z;
draw( tess, a, b, f6, f8 );
x = xN;
y = yN;
z = zN;
}
}
}
/*
* GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glDisable( GL11.GL_CULL_FACE ); tess.draw();
* GL11.glPopAttrib(); tess.startDrawingQuads();
*/
}
boolean hasData = false;
double[] I = new double[3];
double[] K = new double[3];
private void draw(Tessellator tess, double[] a, double[] b, double f6, double f8)
{
if ( hasData )
{
tess.addVertexWithUV( a[0], a[1], a[2], f6, f8 );
tess.addVertexWithUV( I[0], I[1], I[2], f6, f8 );
tess.addVertexWithUV( K[0], K[1], K[2], f6, f8 );
tess.addVertexWithUV( b[0], b[1], b[2], f6, f8 );
}
hasData = true;
for (int x = 0; x < 3; x++)
{
I[x] = a[x];
K[x] = b[x];
}
}
private void clear()
{
hasData = false;
}
}
@@ -0,0 +1,74 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.client.texture.ExtraBlockTextures;
public class MatterCannonFX extends EntityBreakingFX
{
private IIcon particleTextureIndex;
public MatterCannonFX(World par1World, double par2, double par4, double par6, Item par8Item) {
super( par1World, par2, par4, par6, par8Item );
particleGravity = 0;
this.particleBlue = 255;
this.particleGreen = 255;
this.particleRed = 255;
this.particleAlpha = 1.4f;
this.particleScale = 1.1f;
this.motionX = 0.0f;
this.motionY = 0.0f;
this.motionZ = 0.0f;
this.particleTextureIndex = ExtraBlockTextures.BlockMatterCannonParticle.getIcon();
}
public void fromItem(ForgeDirection d)
{
this.particleScale *= 1.2f;
}
@Override
public void onUpdate()
{
super.onUpdate();
this.particleScale *= 1.19f;
this.particleAlpha *= 0.59f;
}
@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.05F * this.particleScale;
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;
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10),
(double) f7, (double) f9 );
par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10),
(double) f7, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10),
(double) f6, (double) f8 );
par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10),
(double) f6, (double) f9 );
}
}
@@ -0,0 +1,54 @@
package appeng.client.render.effects;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class VibrantFX extends EntityFX
{
public VibrantFX(World par1World, double x, double y, double z, double par8, double par10, double par12) {
super( par1World, x, y, z, par8, par10, par12 );
float f = this.rand.nextFloat() * 0.1F + 0.8F;
this.particleRed = f * 0.7f;
this.particleGreen = f * 0.89f;
this.particleBlue = f * 0.9f;
this.setParticleTextureIndex( 0 );
this.setSize( 0.04F, 0.04F );
this.particleScale *= this.rand.nextFloat() * 0.6F + 1.9F;
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.particleMaxAge = (int) (20.0D / (Math.random() * 0.8D + 0.1D));
this.noClip = true;
}
@Override
public float getBrightness(float par1)
{
return 1.0f;
}
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.particleScale *= 0.95;
if ( this.particleMaxAge-- <= 0 || this.particleScale < 0.1 )
{
this.setDead();
}
}
}