Merge PR #7 from MoreThanHidden/1.10-rv3-rendering - Particle Texture Atlas Added

Merge PR #7 from MoreThanHidden/1.10-rv3-rendering - Particle Texture Atlas Added.
Closes #6.
This commit is contained in:
John Hannan
2016-06-29 21:30:08 +08:00
committed by Elix_x
parent 03aa59521c
commit 4c4bdff55c
5 changed files with 65 additions and 38 deletions
@@ -30,6 +30,7 @@ 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 )
@@ -51,8 +52,7 @@ public class CraftingFx extends ParticleBreaking
this.particleRed = 1;
this.particleAlpha = 1.3f;
this.particleScale = 1.5f;
//TODO 1.10-R - Find exact atlas it was holding and replace this broken code with the atlas.
this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon().getAtlas();
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
this.particleMaxAge /= 1.2;
this.startBlkX = MathHelper.floor_double( this.posX );
@@ -114,19 +114,19 @@ public class CraftingFx extends ParticleBreaking
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
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 * (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
this.motionY -= 0.04D * (double) this.particleGravity;
this.moveEntity( 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;
}
@@ -30,6 +30,7 @@ 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 )
@@ -51,8 +52,7 @@ public class EnergyFx extends ParticleBreaking
this.particleRed = 255;
this.particleAlpha = 1.4f;
this.particleScale = 3.5f;
//TODO 1.10-R - Find exact atlas it was holding and replace this broken code with the atlas.
this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon().getAtlas();
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
this.startBlkX = MathHelper.floor_double( this.posX );
this.startBlkY = MathHelper.floor_double( this.posY );
@@ -104,22 +104,22 @@ public class EnergyFx extends ParticleBreaking
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
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 * (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
this.motionY -= 0.04D * (double) this.particleGravity;
this.moveEntity( this.motionX, this.motionY, this.motionZ );
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
this.particleScale *= 0.89f;
this.particleAlpha *= 0.89f;
this.particleScale *= 0.89f;
this.particleAlpha *= 0.89f;
}
public void setMotionX( float motionX )
@@ -27,6 +27,7 @@ import net.minecraft.item.Item;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.client.render.textures.ParticleTextures;
public class MatterCannonFX extends ParticleBreaking
@@ -46,8 +47,7 @@ public class MatterCannonFX extends ParticleBreaking
this.motionX = 0.0f;
this.motionY = 0.0f;
this.motionZ = 0.0f;
//TODO 1.10-R - Find exact atlas it was holding and replace this broken code with the atlas.
this.particleTextureIndex = ExtraBlockTextures.BlockMatterCannonParticle.getIcon().getAtlas();
this.particleTextureIndex = ParticleTextures.BlockMatterCannonParticle;
}
public void fromItem( final AEPartLocation d )
@@ -62,13 +62,13 @@ public class MatterCannonFX extends ParticleBreaking
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
if( this.particleAge++ >= this.particleMaxAge )
{
this.setExpired();
}
this.motionY -= 0.04D * (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionY -= 0.04D * (double) this.particleGravity;
this.moveEntity( this.motionX, this.motionY, this.motionZ );
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
@@ -0,0 +1,19 @@
package appeng.client.render.textures;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.TextureStitchEvent;
public class ParticleTextures
{
public static TextureAtlasSprite BlockEnergyParticle;
public static TextureAtlasSprite BlockMatterCannonParticle;
public static void registerSprite( TextureStitchEvent.Pre event )
{
BlockEnergyParticle = event.getMap().registerSprite( new ResourceLocation( "appliedenergistics2:blocks/BlockEnergyParticle" ) );
BlockMatterCannonParticle = event.getMap().registerSprite( new ResourceLocation( "appliedenergistics2:blocks/BlockMatterCannonParticle" ) );
}
}