Effects should not collide with anything

This commit is contained in:
yueh
2015-01-02 20:34:00 +01:00
parent 59adde7c6b
commit 2f51568772
8 changed files with 101 additions and 68 deletions
@@ -18,6 +18,7 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -27,6 +28,7 @@ import appeng.client.EffectType;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.entity.EntityFloatingItem; import appeng.entity.EntityFloatingItem;
public class AssemblerFX extends EntityFX public class AssemblerFX extends EntityFX
{ {
@@ -35,7 +37,8 @@ public class AssemblerFX extends EntityFX
float time = 0; float time = 0;
final float speed; final float speed;
public AssemblerFX(World w, double x, double y, double z, double r, double g, double b, float speed, IAEItemStack is) { 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 ); super( w, x, y, z, r, g, b );
this.motionX = 0; this.motionX = 0;
this.motionY = 0; this.motionY = 0;
@@ -45,6 +48,7 @@ public class AssemblerFX extends EntityFX
this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() ); this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() );
w.spawnEntityInWorld( this.fi ); 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;
} }
@Override @Override
@@ -18,13 +18,16 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityReddustFX; import net.minecraft.client.particle.EntityReddustFX;
import net.minecraft.world.World; import net.minecraft.world.World;
public class ChargedOreFX extends EntityReddustFX public class ChargedOreFX extends EntityReddustFX
{ {
public ChargedOreFX(World w, double x, double y, double z, float r, float g, float b) { 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 ); super( w, x, y, z, 0.21f, 0.61f, 1.0f );
} }
@@ -18,6 +18,7 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -31,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public class CraftingFx extends EntityBreakingFX public class CraftingFx extends EntityBreakingFX
{ {
@@ -47,7 +49,8 @@ public class CraftingFx extends EntityBreakingFX
return 1; return 1;
} }
public CraftingFx(World par1World, double par2, double par4, double par6, Item par8Item) { public CraftingFx( World par1World, double par2, double par4, double par6, Item par8Item )
{
super( par1World, par2, par4, par6, par8Item ); super( par1World, par2, par4, par6, par8Item );
this.particleGravity = 0; this.particleGravity = 0;
this.particleBlue = 1; this.particleBlue = 1;
@@ -61,6 +64,8 @@ public class CraftingFx extends EntityBreakingFX
this.startBlkX = MathHelper.floor_double( this.posX ); this.startBlkX = MathHelper.floor_double( this.posX );
this.startBlkY = MathHelper.floor_double( this.posY ); this.startBlkY = MathHelper.floor_double( this.posY );
this.startBlkZ = MathHelper.floor_double( this.posZ ); this.startBlkZ = MathHelper.floor_double( this.posZ );
this.noClip = true;
} }
public void fromItem( ForgeDirection d ) public void fromItem( ForgeDirection d )
@@ -18,6 +18,7 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -31,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public class EnergyFx extends EntityBreakingFX public class EnergyFx extends EntityBreakingFX
{ {
@@ -47,7 +49,8 @@ public class EnergyFx extends EntityBreakingFX
return 1; return 1;
} }
public EnergyFx(World par1World, double par2, double par4, double par6, Item par8Item) { public EnergyFx( World par1World, double par2, double par4, double par6, Item par8Item )
{
super( par1World, par2, par4, par6, par8Item ); super( par1World, par2, par4, par6, par8Item );
this.particleGravity = 0; this.particleGravity = 0;
this.particleBlue = 255; this.particleBlue = 255;
@@ -60,6 +63,8 @@ public class EnergyFx extends EntityBreakingFX
this.startBlkX = MathHelper.floor_double( this.posX ); this.startBlkX = MathHelper.floor_double( this.posX );
this.startBlkY = MathHelper.floor_double( this.posY ); this.startBlkY = MathHelper.floor_double( this.posY );
this.startBlkZ = MathHelper.floor_double( this.posZ ); this.startBlkZ = MathHelper.floor_double( this.posZ );
this.noClip = true;
} }
public void fromItem( ForgeDirection d ) public void fromItem( ForgeDirection d )
@@ -18,10 +18,12 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import java.util.Random; import java.util.Random;
import net.minecraft.world.World; import net.minecraft.world.World;
public class LightningArcFX extends LightningFX public class LightningArcFX extends LightningFX
{ {
private static final Random RANDOM_GENERATOR = new Random(); private static final Random RANDOM_GENERATOR = new Random();
@@ -30,8 +32,10 @@ public class LightningArcFX extends LightningFX
final double ry; final double ry;
final double rz; final double rz;
public LightningArcFX(World w, double x, double y, double z, double ex, double ey, double ez, double r, double g, double b) { 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 ); super( w, x, y, z, r, g, b, 6 );
this.noClip = true;
this.rx = ex - x; this.rx = ex - x;
this.ry = ey - y; this.ry = ey - y;
@@ -18,6 +18,7 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import java.util.Random; import java.util.Random;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@@ -27,6 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
public class LightningFX extends EntityFX public class LightningFX extends EntityFX
{ {
@@ -34,13 +36,15 @@ public class LightningFX extends EntityFX
private static final Random RANDOM_GENERATOR = new Random(); private static final Random RANDOM_GENERATOR = new Random();
final double[][] Steps; final double[][] Steps;
protected LightningFX(World w, double x, double y, double z, double r, double g, double b, int maxAge) { 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 ); super( w, x, y, z, r, g, b );
this.Steps = new double[this.steps][3]; this.Steps = new double[this.steps][3];
this.motionX = 0; this.motionX = 0;
this.motionY = 0; this.motionY = 0;
this.motionZ = 0; this.motionZ = 0;
this.particleMaxAge = maxAge; this.particleMaxAge = maxAge;
this.noClip = true;
} }
private int getSteps() private int getSteps()
@@ -48,7 +52,8 @@ public class LightningFX extends EntityFX
return 5; return 5;
} }
public LightningFX(World w, double x, double y, double z, double r, double g, double b) { 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( w, x, y, z, r, g, b, 6 );
this.regen(); this.regen();
} }
@@ -18,6 +18,7 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -27,12 +28,14 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
public class MatterCannonFX extends EntityBreakingFX public class MatterCannonFX extends EntityBreakingFX
{ {
private final IIcon particleTextureIndex; private final IIcon particleTextureIndex;
public MatterCannonFX(World par1World, double par2, double par4, double par6, Item par8Item) { public MatterCannonFX( World par1World, double par2, double par4, double par6, Item par8Item )
{
super( par1World, par2, par4, par6, par8Item ); super( par1World, par2, par4, par6, par8Item );
this.particleGravity = 0; this.particleGravity = 0;
this.particleBlue = 255; this.particleBlue = 255;
@@ -44,6 +47,7 @@ public class MatterCannonFX extends EntityBreakingFX
this.motionY = 0.0f; this.motionY = 0.0f;
this.motionZ = 0.0f; this.motionZ = 0.0f;
this.particleTextureIndex = ExtraBlockTextures.BlockMatterCannonParticle.getIcon(); this.particleTextureIndex = ExtraBlockTextures.BlockMatterCannonParticle.getIcon();
this.noClip = true;
} }
public void fromItem( ForgeDirection d ) public void fromItem( ForgeDirection d )
@@ -18,17 +18,20 @@
package appeng.client.render.effects; package appeng.client.render.effects;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public class VibrantFX extends EntityFX public class VibrantFX extends EntityFX
{ {
public VibrantFX(World par1World, double x, double y, double z, double par8, double par10, double par12) { public VibrantFX( World par1World, double x, double y, double z, double par8, double par10, double par12 )
{
super( par1World, x, y, z, par8, par10, par12 ); super( par1World, x, y, z, par8, par10, par12 );
float f = this.rand.nextFloat() * 0.1F + 0.8F; float f = this.rand.nextFloat() * 0.1F + 0.8F;
this.particleRed = f * 0.7f; this.particleRed = f * 0.7f;