Fixes EnergyFX particles
This commit is contained in:
@@ -18,12 +18,10 @@
|
||||
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.particle.*;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
@@ -34,7 +32,7 @@ import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.AppEng;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class EnergyFx extends BreakingParticle {
|
||||
public class EnergyFx extends SpriteTexturedParticle {
|
||||
|
||||
public static final BasicParticleType TYPE = new BasicParticleType(false);
|
||||
|
||||
@@ -48,7 +46,7 @@ public class EnergyFx extends BreakingParticle {
|
||||
|
||||
public EnergyFx(final World par1World, final double par2, final double par4, final double par6,
|
||||
final IAnimatedSprite sprite) {
|
||||
super(par1World, par2, par4, par6, new ItemStack(Items.DIAMOND));
|
||||
super(par1World, par2, par4, par6);
|
||||
this.particleGravity = 0;
|
||||
this.particleBlue = 1;
|
||||
this.particleGreen = 1;
|
||||
@@ -62,65 +60,31 @@ public class EnergyFx extends BreakingParticle {
|
||||
this.startBlkZ = MathHelper.floor(this.posZ);
|
||||
}
|
||||
|
||||
// FIXME @Override
|
||||
// FIXME public int getFXLayer()
|
||||
// FIXME {
|
||||
// FIXME return 1;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME @Override
|
||||
// FIXME public IParticleRenderType getRenderType() {
|
||||
// FIXME // TODO: FIXME
|
||||
// FIXME return IParticleRenderType.NO_RENDER;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME @Override
|
||||
// FIXME public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
// FIXME {
|
||||
// FIXME final float f6 = this.particleTextureIndex.getMinU();
|
||||
// FIXME final float f7 = this.particleTextureIndex.getMaxU();
|
||||
// FIXME final float f8 = this.particleTextureIndex.getMinV();
|
||||
// FIXME final float f9 = this.particleTextureIndex.getMaxV();
|
||||
// FIXME final float f10 = 0.1F * this.particleScale;
|
||||
// FIXME
|
||||
// FIXME final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
|
||||
// FIXME final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
|
||||
// FIXME final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
|
||||
// FIXME
|
||||
// FIXME final int blkX = MathHelper.floor( this.getPosX() );
|
||||
// FIXME final int blkY = MathHelper.floor( this.getPosY() );
|
||||
// FIXME final int blkZ = MathHelper.floor( this.getPosZ() );
|
||||
// FIXME
|
||||
// FIXME if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
|
||||
// FIXME {
|
||||
// FIXME int i = this.getBrightnessForRender( partialTicks );
|
||||
// FIXME int j = i >> 16 & 65535;
|
||||
// FIXME int k = i & 65535;
|
||||
// FIXME
|
||||
// FIXME final float f14 = 1.0F;
|
||||
// FIXME par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
|
||||
// FIXME .tex( f7, f9 )
|
||||
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
// FIXME .lightmap( j, k )
|
||||
// FIXME .endVertex();
|
||||
// FIXME par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
|
||||
// FIXME .tex( f7, f8 )
|
||||
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
// FIXME .lightmap( j, k )
|
||||
// FIXME .endVertex();
|
||||
// FIXME par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
|
||||
// FIXME .tex( f6, f8 )
|
||||
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
// FIXME .lightmap( j, k )
|
||||
// FIXME .endVertex();
|
||||
// FIXME par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
|
||||
// FIXME .tex( f6, f9 )
|
||||
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
|
||||
// FIXME .lightmap( j, k )
|
||||
// FIXME .endVertex();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScale(float scaleFactor) {
|
||||
return 0.1f * this.particleScale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
|
||||
float x = (float) (this.prevPosX + (this.posX - this.prevPosX) * partialTicks);
|
||||
float y = (float) (this.prevPosY + (this.posY - this.prevPosY) * partialTicks);
|
||||
float z = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * partialTicks);
|
||||
|
||||
final int blkX = MathHelper.floor(x);
|
||||
final int blkY = MathHelper.floor(y);
|
||||
final int blkZ = MathHelper.floor(z);
|
||||
|
||||
if (blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ) {
|
||||
super.renderParticle(buffer, renderInfo, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
public void fromItem(final AEPartLocation d) {
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
@@ -128,29 +92,15 @@ public class EnergyFx extends BreakingParticle {
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
// FIXME @Override
|
||||
// FIXME public void tick()
|
||||
// FIXME {
|
||||
// FIXME this.prevPosX = this.getPosX();
|
||||
// FIXME this.prevPosY = this.getPosY();
|
||||
// FIXME this.prevPosZ = this.getPosZ();
|
||||
// FIXME
|
||||
// FIXME if( this.age++ >= this.maxAge )
|
||||
// FIXME {
|
||||
// FIXME this.setExpired();
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME this.motionY -= 0.04D * this.particleGravity;
|
||||
// FIXME this.move( this.motionX, this.motionY, this.motionZ );
|
||||
// FIXME this.motionX *= 0.9800000190734863D;
|
||||
// FIXME this.motionY *= 0.9800000190734863D;
|
||||
// FIXME this.motionZ *= 0.9800000190734863D;
|
||||
// FIXME
|
||||
// FIXME this.particleScale *= 0.89f;
|
||||
// FIXME this.particleAlpha *= 0.89f;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
this.onGround = false;
|
||||
|
||||
this.particleScale *= 0.89f;
|
||||
this.particleAlpha *= 0.89f;
|
||||
}
|
||||
|
||||
public void setMotionX(float motionX) {
|
||||
this.motionX = motionX;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user