AE2 First Commit, the dawn of 1.7 hast arrived.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import net.minecraft.client.particle.EntityReddustFX;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ChargedOreEffect extends EntityReddustFX
|
||||
{
|
||||
|
||||
public ChargedOreEffect(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,199 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class LightningEffect extends EntityFX
|
||||
{
|
||||
|
||||
final int steps = 5;
|
||||
static Random rng = new Random();
|
||||
double[][] Steps;
|
||||
|
||||
public LightningEffect(World w, double x, double y, double z, double r, double g, double b) {
|
||||
super( w, x, y, z, r, g, b );
|
||||
Steps = new double[steps][3];
|
||||
motionX = 0;
|
||||
motionY = 0;
|
||||
motionZ = 0;
|
||||
particleMaxAge = 6;
|
||||
|
||||
// particleMaxAge = 269;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
float currentPoint = 0;
|
||||
|
||||
@Override
|
||||
public int getBrightnessForRender(float par1)
|
||||
{
|
||||
int j1 = 13;
|
||||
return j1 << 20 | j1 << 4;
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
EntityClientPlayerMP 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,72 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityBreakingFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
|
||||
public class MatterCannonEffect extends EntityBreakingFX
|
||||
{
|
||||
|
||||
private Icon particleTextureIndex;
|
||||
|
||||
public MatterCannonEffect(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 = ExtraTextures.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 void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );
|
||||
|
||||
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 VibrantEffect extends EntityFX
|
||||
{
|
||||
|
||||
public VibrantEffect(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user