From 63dfed9d83c99b6851a305a50c794d525559f85c Mon Sep 17 00:00:00 2001 From: LexManos Date: Sun, 30 Jun 2013 18:13:01 -0700 Subject: [PATCH] Small fixup, need to Update GuiIngameForge for new HUD changes. --- .../client/ForgeHooksClient.java | 6 ----- .../minecraftforge/client/GuiIngameForge.java | 22 ++++++++++++++----- .../client/event/TextureLoadEvent.java | 17 -------------- .../minecraftforge/event/ServerChatEvent.java | 2 +- 4 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 client/net/minecraftforge/client/event/TextureLoadEvent.java diff --git a/client/net/minecraftforge/client/ForgeHooksClient.java b/client/net/minecraftforge/client/ForgeHooksClient.java index 01b276348..91319b407 100644 --- a/client/net/minecraftforge/client/ForgeHooksClient.java +++ b/client/net/minecraftforge/client/ForgeHooksClient.java @@ -36,7 +36,6 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.client.event.TextureLoadEvent; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.MinecraftForge; import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; @@ -221,11 +220,6 @@ public class ForgeHooksClient MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, partialTicks)); } - public static void onTextureLoad(String texture, ITexturePack pack) - { - MinecraftForge.EVENT_BUS.post(new TextureLoadEvent(texture, pack)); - } - public static void onTextureStitchedPre(TextureMap map) { MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Pre(map)); diff --git a/client/net/minecraftforge/client/GuiIngameForge.java b/client/net/minecraftforge/client/GuiIngameForge.java index 7fafa44c8..c8fae1276 100644 --- a/client/net/minecraftforge/client/GuiIngameForge.java +++ b/client/net/minecraftforge/client/GuiIngameForge.java @@ -16,6 +16,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.gui.GuiPlayerInfo; @@ -27,6 +28,8 @@ import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.resources.ResourceLocation; import net.minecraft.crash.CallableMinecraftVersion; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeInstance; import net.minecraft.entity.boss.BossStatus; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -52,6 +55,10 @@ import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType public class GuiIngameForge extends GuiIngame { + private static final ResourceLocation VIGNETTE = new ResourceLocation("textures/misc/vignette.png"); + private static final ResourceLocation WIDGITS = new ResourceLocation("textures/gui/widgets.png"); + private static final ResourceLocation PUMPKIN_BLUR = new ResourceLocation("textures/misc/pumpkinblur.png"); + private static final int WHITE = 0xFFFFFF; //Flags to toggle the rendering of certain aspects of the HUD, valid conditions @@ -169,7 +176,7 @@ public class GuiIngameForge extends GuiIngame GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_110577_a("/gui/gui.png"); + mc.renderEngine.func_110577_a(WIDGITS); InventoryPlayer inv = mc.thePlayer.inventory; drawTexturedModalRect(width / 2 - 91, height - 22, 0, 0, 182, 22); @@ -271,7 +278,7 @@ public class GuiIngameForge extends GuiIngame if (f1 > 0.0F) { - renderPortalOverlay(f1, width, height); + func_130015_b(f1, width, height); } post(PORTAL); @@ -312,8 +319,11 @@ public class GuiIngameForge extends GuiIngame highlight = false; } - int health = mc.thePlayer.getHealth(); - float healthLast = mc.thePlayer.prevHealth; + AttributeInstance attrMaxHealth = this.mc.thePlayer.func_110148_a(SharedMonsterAttributes.field_111267_a); + float maxHealth = (float)attrMaxHealth.func_111126_e(); + + int health = MathHelper.ceiling_float_int(mc.thePlayer.func_110143_aJ()); + int healthLast = MathHelper.ceiling_float_int(mc.thePlayer.prevHealth); int left = width / 2 - 91; int top = height - 39; @@ -449,7 +459,7 @@ public class GuiIngameForge extends GuiIngame if (mc.playerController.shouldDrawHUD()) { mc.mcProfiler.startSection("expBar"); - mc.renderEngine.bindTexture("/gui/icons.png"); + mc.func_110434_K().func_110577_a(WIDGITS); int cap = this.mc.thePlayer.xpBarCap(); int left = width / 2 - 91; @@ -721,7 +731,7 @@ public class GuiIngameForge extends GuiIngame GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture("/gui/icons.png"); + mc.func_110434_K().func_110577_a(Gui.field_110324_m); int pingIndex = 4; int ping = player.responseTime; if (ping < 0) pingIndex = 5; diff --git a/client/net/minecraftforge/client/event/TextureLoadEvent.java b/client/net/minecraftforge/client/event/TextureLoadEvent.java deleted file mode 100644 index b483db111..000000000 --- a/client/net/minecraftforge/client/event/TextureLoadEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.minecraftforge.client.event; - -import net.minecraft.client.texturepacks.ITexturePack; -import net.minecraftforge.event.Event; - -public class TextureLoadEvent extends Event -{ - - public final String texture; - public final ITexturePack pack; - - public TextureLoadEvent(String texture, ITexturePack pack) - { - this.texture = texture; - this.pack = pack; - } -} diff --git a/common/net/minecraftforge/event/ServerChatEvent.java b/common/net/minecraftforge/event/ServerChatEvent.java index efce522ef..9d50a1496 100644 --- a/common/net/minecraftforge/event/ServerChatEvent.java +++ b/common/net/minecraftforge/event/ServerChatEvent.java @@ -9,7 +9,7 @@ public class ServerChatEvent extends Event public final String message, username; public final EntityPlayerMP player; public ChatMessageComponent component; - public ServerChatEvent(EntityPlayerMP player, String message, ChatMessageComponent line) + public ServerChatEvent(EntityPlayerMP player, String message, ChatMessageComponent component) { super(); this.message = message;