diff --git a/block/misc/BlockCharger.java b/block/misc/BlockCharger.java index e1907053..39bf9e86 100644 --- a/block/misc/BlockCharger.java +++ b/block/misc/BlockCharger.java @@ -17,7 +17,7 @@ import appeng.api.AEApi; import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.render.blocks.RenderBlockCharger; -import appeng.client.render.effects.LightningEffect; +import appeng.client.render.effects.LightningFX; import appeng.core.AEConfig; import appeng.core.CommonHelper; import appeng.core.features.AEFeature; @@ -88,7 +88,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision { if ( CommonHelper.proxy.shouldAddParticles( r ) ) { - LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); + LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } } diff --git a/block/misc/BlockQuartzGrowthAccelerator.java b/block/misc/BlockQuartzGrowthAccelerator.java index 7396d36b..f65e4ca8 100644 --- a/block/misc/BlockQuartzGrowthAccelerator.java +++ b/block/misc/BlockQuartzGrowthAccelerator.java @@ -14,7 +14,7 @@ import appeng.api.util.IOrientableBlock; import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.render.blocks.RenderBlockQuartzAccelerator; -import appeng.client.render.effects.LightningEffect; +import appeng.client.render.effects.LightningFX; import appeng.core.AEConfig; import appeng.core.CommonHelper; import appeng.core.features.AEFeature; @@ -112,7 +112,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient ry += dz * forward.offsetY; rz += dz * forward.offsetZ; - LightningEffect fx = new LightningEffect( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); + LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } } diff --git a/block/misc/BlockQuartzTorch.java b/block/misc/BlockQuartzTorch.java index 920a39e1..35afc8e7 100644 --- a/block/misc/BlockQuartzTorch.java +++ b/block/misc/BlockQuartzTorch.java @@ -19,7 +19,7 @@ import appeng.api.util.IOrientableBlock; import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.render.blocks.RenderQuartzTorch; -import appeng.client.render.effects.LightningEffect; +import appeng.client.render.effects.LightningFX; import appeng.core.AEConfig; import appeng.core.CommonHelper; import appeng.core.features.AEFeature; @@ -124,7 +124,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I { if ( CommonHelper.proxy.shouldAddParticles( r ) ) { - LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); + LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } diff --git a/block/solids/BlockQuartzLamp.java b/block/solids/BlockQuartzLamp.java index 83b39c06..5e3fa28b 100644 --- a/block/solids/BlockQuartzLamp.java +++ b/block/solids/BlockQuartzLamp.java @@ -6,7 +6,7 @@ import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; -import appeng.client.render.effects.VibrantEffect; +import appeng.client.render.effects.VibrantFX; import appeng.core.CommonHelper; import appeng.core.AEConfig; import appeng.core.features.AEFeature; @@ -36,7 +36,7 @@ public class BlockQuartzLamp extends BlockQuartzGlass double d1 = (double) (r.nextFloat() - 0.5F) * 0.96D; double d2 = (double) (r.nextFloat() - 0.5F) * 0.96D; - VibrantEffect fx = new VibrantEffect( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D ); + VibrantFX fx = new VibrantFX( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } diff --git a/block/solids/OreQuartzCharged.java b/block/solids/OreQuartzCharged.java index 12527c88..cfc2c546 100644 --- a/block/solids/OreQuartzCharged.java +++ b/block/solids/OreQuartzCharged.java @@ -7,7 +7,7 @@ import net.minecraft.client.particle.EntityFX; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import appeng.api.AEApi; -import appeng.client.render.effects.ChargedOreEffect; +import appeng.client.render.effects.ChargedOreFX; import appeng.core.CommonHelper; import appeng.core.AEConfig; import cpw.mods.fml.relauncher.Side; @@ -66,7 +66,7 @@ public class OreQuartzCharged extends OreQuartz if ( CommonHelper.proxy.shouldAddParticles( r ) ) { - ChargedOreEffect fx = new ChargedOreEffect( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f ); + ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } } diff --git a/client/ClientHelper.java b/client/ClientHelper.java index a1eb34ca..d1a4024c 100644 --- a/client/ClientHelper.java +++ b/client/ClientHelper.java @@ -20,7 +20,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.client.ForgeHooksClient; @@ -36,9 +35,10 @@ import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.render.TESRWrapper; import appeng.client.render.WorldRender; +import appeng.client.render.effects.CraftingFx; import appeng.client.render.effects.EnergyFx; -import appeng.client.render.effects.LightningEffect; -import appeng.client.render.effects.VibrantEffect; +import appeng.client.render.effects.LightningFX; +import appeng.client.render.effects.VibrantFX; import appeng.client.texture.CableBusTextures; import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraItemTextures; @@ -47,7 +47,9 @@ import appeng.core.AELog; import appeng.core.CommonHelper; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; +import appeng.entity.EntityFloatingItem; import appeng.entity.EntityTinyTNTPrimed; +import appeng.entity.RenderFloatingItem; import appeng.entity.RenderTinyTNTPrimed; import appeng.helpers.IMouseWheelItem; import appeng.server.ServerHelper; @@ -63,11 +65,11 @@ public class ClientHelper extends ServerHelper private static RenderBlocks blockRenderer = new RenderBlocks(); @Override - public void doRenderItem(ItemStack itemstack, TileEntity par1EntityItemFrame) + public void doRenderItem(ItemStack itemstack, World w) { if ( itemstack != null ) { - EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack ); + EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack ); entityitem.getEntityItem().stackSize = 1; // set all this stuff and then do shit? meh? @@ -153,6 +155,7 @@ public class ClientHelper extends ServerHelper { RenderingRegistry.registerBlockHandler( WorldRender.instance ); RenderManager.instance.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed() ); + RenderManager.instance.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem() ); } @SubscribeEvent @@ -238,6 +241,9 @@ public class ClientHelper extends ServerHelper case Vibrant: spawnVibrant( worldObj, posX, posY, posZ ); return; + case Crafting: + spawnCrafting( worldObj, posX, posY, posZ ); + return; case Energy: spawnEnergy( worldObj, posX, posY, posZ ); return; @@ -256,14 +262,14 @@ public class ClientHelper extends ServerHelper double d1 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; double d2 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; - VibrantEffect fx = new VibrantEffect( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); + VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } } private void spawnLightning(World worldObj, double posX, double posY, double posZ) { - LightningEffect fx = new LightningEffect( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); + LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } @@ -282,6 +288,21 @@ public class ClientHelper extends ServerHelper Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } + private void spawnCrafting(World w, double posX, double posY, double posZ) + { + float x = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f; + float y = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f; + float z = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f; + + CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond ); + + fx.motionX = -x * 0.2; + fx.motionY = -y * 0.2; + fx.motionZ = -z * 0.2; + + Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + } + @Override public boolean shouldAddParticles(Random r) { diff --git a/client/EffectType.java b/client/EffectType.java index 9476b5b7..64c234a4 100644 --- a/client/EffectType.java +++ b/client/EffectType.java @@ -2,5 +2,5 @@ package appeng.client; public enum EffectType { - Energy, Lightning, Vibrant + Energy, Lightning, Vibrant, Crafting } diff --git a/client/render/effects/AssemblerFX.java b/client/render/effects/AssemblerFX.java new file mode 100644 index 00000000..7c36e83f --- /dev/null +++ b/client/render/effects/AssemblerFX.java @@ -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 ); + } + } + +} diff --git a/client/render/effects/ChargedOreEffect.java b/client/render/effects/ChargedOreFX.java similarity index 70% rename from client/render/effects/ChargedOreEffect.java rename to client/render/effects/ChargedOreFX.java index d36999ad..00bc1b07 100644 --- a/client/render/effects/ChargedOreEffect.java +++ b/client/render/effects/ChargedOreFX.java @@ -1,25 +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; - } - -} +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; + } + +} diff --git a/client/render/effects/CraftingFx.java b/client/render/effects/CraftingFx.java new file mode 100644 index 00000000..5c38dfae --- /dev/null +++ b/client/render/effects/CraftingFx.java @@ -0,0 +1,103 @@ +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 par2, float par3, float par4, float par5, float par6, float par7) + { + /* + * Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture ); + * + * GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); + * + * GL11.glDepthMask( false ); GL11.glEnable( GL11.GL_BLEND ); GL11.glBlendFunc( GL11.GL_SRC_ALPHA, + * GL11.GL_ONE_MINUS_SRC_ALPHA ); GL11.glAlphaFunc( GL11.GL_GREATER, 0.003921569F ); + */ + + 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 ); + } + + // GL11.glPopAttrib(); + // GL11.glPopMatrix(); + } + +} diff --git a/client/render/effects/LightningEffect.java b/client/render/effects/LightningFX.java similarity index 93% rename from client/render/effects/LightningEffect.java rename to client/render/effects/LightningFX.java index 9e5c0d81..7db1e220 100644 --- a/client/render/effects/LightningEffect.java +++ b/client/render/effects/LightningFX.java @@ -1,199 +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; - -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; - - 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; - } -} +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; + +import org.lwjgl.opengl.GL11; + +public class LightningFX extends EntityFX +{ + + final int steps = 5; + static Random rng = new Random(); + double[][] Steps; + + public LightningFX(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; + + 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; + } +} diff --git a/client/render/effects/MatterCannonEffect.java b/client/render/effects/MatterCannonFX.java similarity index 94% rename from client/render/effects/MatterCannonEffect.java rename to client/render/effects/MatterCannonFX.java index 4f9d83a1..eb2a4012 100644 --- a/client/render/effects/MatterCannonEffect.java +++ b/client/render/effects/MatterCannonFX.java @@ -10,12 +10,12 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import appeng.client.texture.ExtraBlockTextures; -public class MatterCannonEffect extends EntityBreakingFX +public class MatterCannonFX extends EntityBreakingFX { private IIcon particleTextureIndex; - public MatterCannonEffect(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 ); particleGravity = 0; this.particleBlue = 255; diff --git a/client/render/effects/VibrantEffect.java b/client/render/effects/VibrantFX.java similarity index 88% rename from client/render/effects/VibrantEffect.java rename to client/render/effects/VibrantFX.java index 19f749e1..0492784c 100644 --- a/client/render/effects/VibrantEffect.java +++ b/client/render/effects/VibrantFX.java @@ -6,10 +6,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class VibrantEffect extends EntityFX +public class VibrantFX extends EntityFX { - public VibrantEffect(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 ); float f = this.rand.nextFloat() * 0.1F + 0.8F; this.particleRed = f * 0.7f; diff --git a/core/CommonHelper.java b/core/CommonHelper.java index e1b9a0e1..5e981909 100644 --- a/core/CommonHelper.java +++ b/core/CommonHelper.java @@ -5,7 +5,6 @@ import java.util.Random; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import appeng.block.AEBaseBlock; @@ -35,8 +34,13 @@ public abstract class CommonHelper public abstract MovingObjectPosition getMOP(); - public abstract void doRenderItem(ItemStack sis, TileEntity tile); + public abstract void doRenderItem(ItemStack itemstack, World w); public abstract void postinit(); + { + // TODO Auto-generated method stub + + } + } diff --git a/core/sync/AppEngPacketHandlerBase.java b/core/sync/AppEngPacketHandlerBase.java index 0b4ff7df..da9fdf27 100644 --- a/core/sync/AppEngPacketHandlerBase.java +++ b/core/sync/AppEngPacketHandlerBase.java @@ -7,6 +7,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import appeng.core.sync.packets.PacketAssemblerAnimation; import appeng.core.sync.packets.PacketClick; import appeng.core.sync.packets.PacketCompassRequest; import appeng.core.sync.packets.PacketCompassResponse; @@ -76,7 +77,9 @@ public class AppEngPacketHandlerBase PACKET_PARTIAL_ITEM(PacketPartialItem.class), - PAKCET_CRAFTING_REQUEST(PacketCraftRequest.class); + PACKET_CRAFTING_REQUEST(PacketCraftRequest.class), + + PAKCET_ASSEMBLER_ANIMATION(PacketAssemblerAnimation.class); final public Class pc; final public Constructor con; diff --git a/core/sync/packets/PacketAssemblerAnimation.java b/core/sync/packets/PacketAssemblerAnimation.java new file mode 100644 index 00000000..75c6487e --- /dev/null +++ b/core/sync/packets/PacketAssemblerAnimation.java @@ -0,0 +1,59 @@ +package appeng.core.sync.packets; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +import java.io.IOException; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.entity.player.EntityPlayer; +import appeng.api.storage.data.IAEItemStack; +import appeng.client.render.effects.AssemblerFX; +import appeng.core.sync.AppEngPacket; +import appeng.core.sync.network.INetworkInfo; +import appeng.util.item.AEItemStack; + +public class PacketAssemblerAnimation extends AppEngPacket +{ + + int x, y, z; + byte rate; + IAEItemStack is; + + // automatic. + public PacketAssemblerAnimation(ByteBuf stream) throws IOException { + x = stream.readInt(); + y = stream.readInt(); + z = stream.readInt(); + rate = stream.readByte(); + is = AEItemStack.loadItemStackFromPacket( stream ); + } + + @Override + public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) + { + double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + + AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D, rate, is ); + Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + } + + // api + public PacketAssemblerAnimation(int x, int y, int z, byte rate, IAEItemStack is) throws IOException { + + ByteBuf data = Unpooled.buffer(); + + data.writeInt( getPacketID() ); + data.writeInt( this.x = x ); + data.writeInt( this.y = y ); + data.writeInt( this.z = z ); + data.writeByte( this.rate = rate ); + is.writeToPacket( data ); + this.is = is; + + configureWrite( data ); + } +} diff --git a/core/sync/packets/PacketLightning.java b/core/sync/packets/PacketLightning.java index 29cf964c..4c2e27f3 100644 --- a/core/sync/packets/PacketLightning.java +++ b/core/sync/packets/PacketLightning.java @@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import appeng.client.ClientHelper; -import appeng.client.render.effects.LightningEffect; +import appeng.client.render.effects.LightningFX; import appeng.core.AEConfig; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -39,7 +39,7 @@ public class PacketLightning extends AppEngPacket { if ( Platform.isClient() && AEConfig.instance.enableEffects ) { - LightningEffect fx = new LightningEffect( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f ); + LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } } diff --git a/core/sync/packets/PacketMatterCannon.java b/core/sync/packets/PacketMatterCannon.java index 9259a738..993994d8 100644 --- a/core/sync/packets/PacketMatterCannon.java +++ b/core/sync/packets/PacketMatterCannon.java @@ -10,7 +10,7 @@ import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.world.World; -import appeng.client.render.effects.MatterCannonEffect; +import appeng.client.render.effects.MatterCannonFX; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import cpw.mods.fml.client.FMLClientHandler; @@ -49,7 +49,7 @@ public class PacketMatterCannon extends AppEngPacket World world = FMLClientHandler.instance().getClient().theWorld; for (int a = 1; a < len; a++) { - MatterCannonEffect fx = new MatterCannonEffect( world, x + dx * a, y + dy * a, z + dz * a, Items.diamond ); + MatterCannonFX fx = new MatterCannonFX( world, x + dx * a, y + dy * a, z + dz * a, Items.diamond ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } diff --git a/entity/EntityFloatingItem.java b/entity/EntityFloatingItem.java new file mode 100644 index 00000000..705f4284 --- /dev/null +++ b/entity/EntityFloatingItem.java @@ -0,0 +1,45 @@ +package appeng.entity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +final public class EntityFloatingItem extends EntityItem +{ + + public static int ageStatic = 0; + + int superDeath = 0; + private Entity parent; + float progress = 0; + + public EntityFloatingItem(Entity parent, World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { + super( p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_, p_i1710_8_ ); + motionX = motionY = motionZ = 0.0d; + this.hoverStart = 0.5f; + this.rotationYaw = 0; + this.parent = parent; + } + + // public boolean isEntityAlive() + + public void onUpdate() + { + if ( !isDead && parent.isDead ) + this.setDead(); + + if ( superDeath++ > 100 ) + setDead(); + + this.age = ageStatic; + } + + public void setProgress(float progress) + { + this.progress = progress; + if ( this.progress > 0.99 ) + this.setDead(); + } + +} diff --git a/entity/RenderFloatingItem.java b/entity/RenderFloatingItem.java new file mode 100644 index 00000000..212edc14 --- /dev/null +++ b/entity/RenderFloatingItem.java @@ -0,0 +1,52 @@ +package appeng.entity; + +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RenderFloatingItem extends RenderItem +{ + + public static DoubleBuffer buffer = ByteBuffer.allocateDirect( 8 * 4 ).asDoubleBuffer(); + + public RenderFloatingItem() { + this.shadowOpaque = 0.0F; + this.renderManager = RenderManager.instance; + } + + @Override + public boolean shouldBob() + { + return false; + } + + @Override + public void doRender(EntityItem p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + if ( p_76986_1_ instanceof EntityFloatingItem ) + { + EntityFloatingItem efi = (EntityFloatingItem) p_76986_1_; + if ( efi.progress > 0.0 ) + { + GL11.glPushMatrix(); + + if ( !(efi.getEntityItem().getItem() instanceof ItemBlock) ) + GL11.glTranslatef( 0, -0.15f, 0 ); + + super.doRender( efi, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_ ); + GL11.glPopMatrix(); + } + } + } + +} diff --git a/hooks/TickHandler.java b/hooks/TickHandler.java index e038b9d4..6997654c 100644 --- a/hooks/TickHandler.java +++ b/hooks/TickHandler.java @@ -12,6 +12,7 @@ import net.minecraftforge.event.world.WorldEvent; import appeng.api.networking.IGridNode; import appeng.core.AELog; import appeng.crafting.CraftingJob; +import appeng.entity.EntityFloatingItem; import appeng.me.Grid; import appeng.me.NetworkList; import appeng.tile.AEBaseTile; @@ -127,6 +128,12 @@ public class TickHandler @SubscribeEvent public void onTick(TickEvent ev) { + + if ( ev.type == Type.CLIENT && ev.phase == Phase.START ) + { + EntityFloatingItem.ageStatic = (EntityFloatingItem.ageStatic + 1) % 60000; + } + // rwar! if ( ev.type == Type.WORLD && ev.phase == Phase.END ) { diff --git a/parts/reporting/PartStorageMonitor.java b/parts/reporting/PartStorageMonitor.java index df4b6184..0e5ec56c 100644 --- a/parts/reporting/PartStorageMonitor.java +++ b/parts/reporting/PartStorageMonitor.java @@ -281,7 +281,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit // RenderHelper.enableGUIStandardItemLighting(); tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f ); - ClientHelper.proxy.doRenderItem( sis, this.tile ); + ClientHelper.proxy.doRenderItem( sis, this.tile.getWorldObj() ); } catch (Exception e) diff --git a/server/ServerHelper.java b/server/ServerHelper.java index 7e8ae23b..04c98661 100644 --- a/server/ServerHelper.java +++ b/server/ServerHelper.java @@ -8,7 +8,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import appeng.block.AEBaseBlock; @@ -23,7 +22,7 @@ public class ServerHelper extends CommonHelper { @Override - public void doRenderItem(ItemStack sis, TileEntity tile) + public void doRenderItem(ItemStack sis, World tile) { } diff --git a/tile/crafting/TileMolecularAssembler.java b/tile/crafting/TileMolecularAssembler.java index 8c650d81..d21863b9 100644 --- a/tile/crafting/TileMolecularAssembler.java +++ b/tile/crafting/TileMolecularAssembler.java @@ -31,10 +31,13 @@ import appeng.api.networking.ticking.IGridTickable; import appeng.api.networking.ticking.TickRateModulation; import appeng.api.networking.ticking.TickingRequest; import appeng.api.parts.ISimplifiedBundle; +import appeng.api.storage.data.IAEItemStack; import appeng.api.util.AECableType; import appeng.api.util.DimensionalCoord; import appeng.api.util.IConfigManager; import appeng.container.ContainerNull; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketAssemblerAnimation; import appeng.items.misc.ItemEncodedPattern; import appeng.me.GridAccessException; import appeng.parts.automation.UpgradeInventory; @@ -48,7 +51,9 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.InventoryAdaptor; import appeng.util.Platform; +import appeng.util.item.AEItemStack; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEngInventory, ISidedInventory, IUpgradeableHost, IConfigManagerHost, IGridTickable, ICraftingMachine, IPowerChannelState @@ -388,25 +393,26 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn TicksSinceLastCall = 1; reboot = false; + int speed = 10; switch (upgrades.getInstalledUpgrades( Upgrades.SPEED )) { case 0: - progress += userPower( TicksSinceLastCall, 10, 1.0 ); + progress += userPower( TicksSinceLastCall, speed = 10, 1.0 ); break; case 1: - progress += userPower( TicksSinceLastCall, 13, 1.3 ); + progress += userPower( TicksSinceLastCall, speed = 13, 1.3 ); break; case 2: - progress += userPower( TicksSinceLastCall, 17, 1.7 ); + progress += userPower( TicksSinceLastCall, speed = 17, 1.7 ); break; case 3: - progress += userPower( TicksSinceLastCall, 20, 2.0 ); + progress += userPower( TicksSinceLastCall, speed = 20, 2.0 ); break; case 4: - progress += userPower( TicksSinceLastCall, 25, 2.5 ); + progress += userPower( TicksSinceLastCall, speed = 25, 2.5 ); break; case 5: - progress += userPower( TicksSinceLastCall, 50, 5.0 ); + progress += userPower( TicksSinceLastCall, speed = 50, 5.0 ); break; } @@ -433,6 +439,17 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn } ejectHeldItems(); + try + { + TargetPoint where = new TargetPoint( worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32 ); + IAEItemStack item = AEItemStack.create( output ); + NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( xCoord, yCoord, zCoord, (byte) speed, item ), where ); + } + catch (IOException e) + { + // ;P + } + updateSleepyness(); return isAwake ? TickRateModulation.SLEEP : TickRateModulation.IDLE; }