diff --git a/MODSRC/vazkii/botania/client/core/handler/TiaraWingRenderHandler.java b/MODSRC/vazkii/botania/client/core/handler/TiaraWingRenderHandler.java index 5aec181eb..f982ce6f5 100644 --- a/MODSRC/vazkii/botania/client/core/handler/TiaraWingRenderHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/TiaraWingRenderHandler.java @@ -16,18 +16,22 @@ import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara; import baubles.common.container.InventoryBaubles; import baubles.common.lib.PlayerHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; public final class TiaraWingRenderHandler { - + @SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Specials.Post event) { InventoryBaubles inv = PlayerHandler.getPlayerBaubles(event.entityPlayer); @@ -132,7 +136,53 @@ public final class TiaraWingRenderHandler { GL11.glColor3f(1F, 1F, 1F); GL11.glPopMatrix(); + + // Jibril's Halo + if(meta == 1) renderHalo(event.entityPlayer, event.partialRenderTick); } } } + + private static ResourceLocation textureHalo = new ResourceLocation(LibResources.MISC_HALO); + + private void renderHalo(EntityPlayer player, float partialTicks) { + + float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks; + float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks; + float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks; + + GL11.glPushMatrix(); + GL11.glRotatef(yawOffset, 0, -1, 0); + GL11.glRotatef(yaw - 270, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, 1); + + GL11.glShadeModel(GL11.GL_SMOOTH); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1F, 1F, 1F, 1F); + + Minecraft.getMinecraft().renderEngine.bindTexture(textureHalo); + + GL11.glTranslated(0, -player.eyeHeight + (player.isSneaking() ? 0.0625 : 0), 0); + GL11.glRotated(30, 1, 0, -1); + GL11.glTranslatef(-0.1F, -0.5F, -0.1F); + GL11.glRotatef(player.ticksExisted + partialTicks, 0, 1, 0); + + Tessellator tes = Tessellator.instance; + tes.startDrawingQuads(); + tes.addVertexWithUV(-0.5, 0, -0.5, 0, 0); + tes.addVertexWithUV(-0.5, 0, 0.5, 0, 1); + tes.addVertexWithUV(0.5, 0, 0.5, 1, 1); + tes.addVertexWithUV(0.5, 0, -0.5, 1, 0); + + tes.addVertexWithUV(-0.5, 0, -0.5, 0, 0); + tes.addVertexWithUV(0.5, 0, -0.5, 1, 0); + tes.addVertexWithUV(0.5, 0, 0.5, 1, 1); + tes.addVertexWithUV(-0.5, 0, 0.5, 0, 1); + tes.draw(); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glPopMatrix(); + } } diff --git a/MODSRC/vazkii/botania/client/lib/LibResources.java b/MODSRC/vazkii/botania/client/lib/LibResources.java index b48657441..d1cf3402b 100644 --- a/MODSRC/vazkii/botania/client/lib/LibResources.java +++ b/MODSRC/vazkii/botania/client/lib/LibResources.java @@ -90,10 +90,11 @@ public final class LibResources { public static final String MODEL_SPAWNER_CLAW = PREFIX_MODEL + "spawnerClaw.png"; public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png"; - + public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png"; public static final String MISC_WISP_LARGE = PREFIX_MISC + "wispLarge.png"; public static final String MISC_WISP_SMALL = PREFIX_MISC + "wispSmall.png"; + public static final String MISC_HALO = PREFIX_MISC + "halo.png"; public static final String OBJ_MODEL_PYLON = PREFIX_OBJ_MODEL + "pylon.obj"; diff --git a/resources/assets/botania/textures/misc/halo.png b/resources/assets/botania/textures/misc/halo.png new file mode 100644 index 000000000..e4ad88b07 Binary files /dev/null and b/resources/assets/botania/textures/misc/halo.png differ