Made pixies "glow"

This commit is contained in:
Matt Caughey 2013-11-16 17:40:49 -05:00
parent 5f3eedd795
commit b20f108efb
2 changed files with 44 additions and 0 deletions

View file

@ -1,5 +1,6 @@
package biomesoplenty.entities.render; package biomesoplenty.entities.render;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -7,6 +8,7 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import biomesoplenty.entities.EntityPixie;
import biomesoplenty.entities.models.ModelPixie; import biomesoplenty.entities.models.ModelPixie;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -17,6 +19,7 @@ public class RenderPixie extends RenderLiving
public RenderPixie() public RenderPixie()
{ {
super(new ModelPixie(), 0.25F); super(new ModelPixie(), 0.25F);
this.setRenderPassModel(new ModelPixie());
this.shadowSize = 0.0F; this.shadowSize = 0.0F;
} }
@ -25,4 +28,45 @@ public class RenderPixie extends RenderLiving
{ {
return new ResourceLocation("biomesoplenty:textures/mobs/pixie.png"); 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);
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 487 B