From d6cf9a8e904647b04ac316fb511880b848e5f8d2 Mon Sep 17 00:00:00 2001 From: Tonius Date: Mon, 28 Jul 2014 15:01:27 +0200 Subject: [PATCH] Various fixes to rendering Fixed: - Jetpack particles being too dark - Jetpack particles flickering towards the world origin - Jetpack HUD showing in almost every screen - RenderTickHandler still ticking when the game is paused --- .../render/particle/EntityJetpackFlameFX.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/mekanism/client/render/particle/EntityJetpackFlameFX.java diff --git a/src/main/java/mekanism/client/render/particle/EntityJetpackFlameFX.java b/src/main/java/mekanism/client/render/particle/EntityJetpackFlameFX.java new file mode 100644 index 000000000..f08ee5bcc --- /dev/null +++ b/src/main/java/mekanism/client/render/particle/EntityJetpackFlameFX.java @@ -0,0 +1,32 @@ +package mekanism.client.render.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class EntityJetpackFlameFX extends EntityFlameFX { + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public EntityJetpackFlameFX(World world, double posX, double posY, double posZ, double velX, double velY, double velZ) { + super(world, posX, posY, posZ, velX, velY, velZ); + this.noClip = false; + } + + @Override + public int getBrightnessForRender(float p_70013_1_) { + return 190 + (int) (20F * (1.0F - mc.gameSettings.gammaSetting)); + } + + @Override + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + if (this.particleAge > 0) + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + +}