From b20f108efbc09c895b781089aafc04dc185db233 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 16 Nov 2013 17:40:49 -0500 Subject: [PATCH] Made pixies "glow" --- .../entities/render/RenderPixie.java | 44 ++++++++++++++++++ .../biomesoplenty/textures/mobs/pixie.png | Bin 505 -> 487 bytes 2 files changed, 44 insertions(+) diff --git a/common/biomesoplenty/entities/render/RenderPixie.java b/common/biomesoplenty/entities/render/RenderPixie.java index b72ed71da..7a5647e0d 100644 --- a/common/biomesoplenty/entities/render/RenderPixie.java +++ b/common/biomesoplenty/entities/render/RenderPixie.java @@ -1,5 +1,6 @@ package biomesoplenty.entities.render; +import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -7,6 +8,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import biomesoplenty.entities.EntityPixie; import biomesoplenty.entities.models.ModelPixie; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -17,6 +19,7 @@ public class RenderPixie extends RenderLiving public RenderPixie() { super(new ModelPixie(), 0.25F); + this.setRenderPassModel(new ModelPixie()); this.shadowSize = 0.0F; } @@ -25,4 +28,45 @@ public class RenderPixie extends RenderLiving { return new ResourceLocation("biomesoplenty:textures/mobs/pixie.png"); } + + protected int setPixieBrightness(EntityPixie par1EntityPixie, int par2, float par3) + { + if (par2 != 0) + { + return -1; + } + else + { + this.bindTexture(new ResourceLocation("biomesoplenty:textures/mobs/pixie.png")); + float f1 = 1.0F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + + if (par1EntityPixie.isInvisible()) + { + GL11.glDepthMask(false); + } + else + { + GL11.glDepthMask(true); + } + + char c0 = 61680; + int j = c0 % 65536; + int k = c0 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f1); + return 1; + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) + { + return this.setPixieBrightness((EntityPixie)par1EntityLivingBase, par2, par3); + } } diff --git a/resources/assets/biomesoplenty/textures/mobs/pixie.png b/resources/assets/biomesoplenty/textures/mobs/pixie.png index a5b5befce3fe77ee65cb4c7d0256d4e1f175e08f..9ccd05c4f203f0d37e4602e7ac1370124a2632dd 100644 GIT binary patch delta 399 zcmV;A0dW5L1Lp&fJPN@801m+cxRGn^kwz(hV@X6oRA@u(mFr5wKoEuV&>~){qA#IV zh58;ofR`Uyl%m#KwRmq)L=n@?@tobwAAgArfyDV>VKzIN?3|t1BtOB-DX=jB)}Mj7 zbD(h+=Bp3DY!}h3zW8Lj04_LMFBF3FE7~UX~kKqo`oghIZ!qPP`aTL}zU%hV( zQ(aWnxMg{(@73=TgZZJ)kzan)2GqhQE}t9P)J?uIOm*=IsmHftf)Ygiu4gTtvINs0t)~D002ovPDHLkV1mxaz!3ld delta 418 zcmV;T0bTy*1Nj4xJPN`901m~YOS+roYqZAq(49N^DG8Q?Gs_Pj^QR(iuyiFgPQer(t$NY}*b^8K1|e8H zM{{gf_OMeGTjwUbFs;#o)V%A~G&pu{JI;w>J+P6Ry#J-nq#x?TMm@rWmF>d%&>fhtHs7fejS*rDXUz zSexF$S!w|Y`v!4rFT&!M{zOuKQiBJLOo&F&gI}u4!HL@*8UB-mpHwlQefZ@%I^Hu( z&-N&X+a8&u{G?8|=7TBw-@_*5M^O|-Q4~c{6h%=KMNt$b;}i;C{RHB>XpY