diff --git a/java/net/torocraft/torohealthmod/display/EntityDisplay.java b/java/net/torocraft/torohealthmod/display/EntityDisplay.java index 8a9592a..1bb67f5 100644 --- a/java/net/torocraft/torohealthmod/display/EntityDisplay.java +++ b/java/net/torocraft/torohealthmod/display/EntityDisplay.java @@ -1,6 +1,7 @@ package net.torocraft.torohealthmod.display; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; @@ -8,11 +9,18 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; +import net.torocraft.torohealthmod.ToroHealthMod; public class EntityDisplay implements ToroHealthDisplay { - + private static final ResourceLocation TEXTURE = new ResourceLocation(ToroHealthMod.MODID, "textures/gui/entityStatus.png"); private static final int RENDER_HEIGHT = 20; + private static final int WIDTH = 40; + private static final int HEIGHT = 40; + + private final Minecraft mc; + private final Gui gui; private int x = 50; private int y = 50; @@ -26,6 +34,11 @@ public class EntityDisplay implements ToroHealthDisplay { private float prevPrevYahHead; private int scale = 1; + public EntityDisplay(Minecraft mc, Gui gui) { + this.mc = mc; + this.gui = gui; + } + @Override public void setPosition(int x, int y) { this.x = x; @@ -46,6 +59,9 @@ public void draw() { glDraw(); popEntityRotations(); popEntityLeasedTo(); + + mc.renderEngine.bindTexture(TEXTURE); + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0f, 0.0f, WIDTH, HEIGHT, 200.0f, 200.0f); } catch (Throwable ignore) { } @@ -56,6 +72,9 @@ private void updateScale() { } private void glDraw() { + + + GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); @@ -74,6 +93,8 @@ private void glDraw() { rendermanager.setRenderShadow(false); rendermanager.doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false); rendermanager.setRenderShadow(true); + + GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); diff --git a/java/net/torocraft/torohealthmod/display/HeartsDisplay.java b/java/net/torocraft/torohealthmod/display/HeartsDisplay.java index f8dd7c2..119be1b 100644 --- a/java/net/torocraft/torohealthmod/display/HeartsDisplay.java +++ b/java/net/torocraft/torohealthmod/display/HeartsDisplay.java @@ -11,7 +11,7 @@ public class HeartsDisplay implements ToroHealthDisplay { private static final ResourceLocation TEXTURE = new ResourceLocation(ToroHealthMod.MODID, "textures/gui/entityStatus.png"); - private static final int WIDTH = 84; + private static final int WIDTH = 100; private static final int HEIGHT = 34; private final Minecraft mc; @@ -40,9 +40,15 @@ public void draw() { resetToOrigin(); + + + mc.renderEngine.bindTexture(TEXTURE); Gui.drawModalRectWithCustomSizedTexture(x, y , 0.0f, 0.0f, WIDTH, HEIGHT, 200.0f, 200.0f); + x += 2; + y += 2; + drawName(); drawHearts(); drawArmor(); diff --git a/java/net/torocraft/torohealthmod/display/NumericDisplay.java b/java/net/torocraft/torohealthmod/display/NumericDisplay.java index 6968c6a..03a6dc9 100644 --- a/java/net/torocraft/torohealthmod/display/NumericDisplay.java +++ b/java/net/torocraft/torohealthmod/display/NumericDisplay.java @@ -14,8 +14,8 @@ public class NumericDisplay implements ToroHealthDisplay { private final Minecraft mc; private final Gui gui; - private int x = 100; - private int y = 140; + private int x = 220; + private int y = 100; private EntityLivingBase entity; public NumericDisplay(Minecraft mc, Gui gui) { diff --git a/java/net/torocraft/torohealthmod/gui/GuiEntityStatus.java b/java/net/torocraft/torohealthmod/gui/GuiEntityStatus.java index 9e9cdbe..3856163 100644 --- a/java/net/torocraft/torohealthmod/gui/GuiEntityStatus.java +++ b/java/net/torocraft/torohealthmod/gui/GuiEntityStatus.java @@ -38,9 +38,14 @@ public GuiEntityStatus() { public GuiEntityStatus(Minecraft mc) { this.mc = mc; - entityDisplay = new EntityDisplay(); + entityDisplay = new EntityDisplay(mc, this); heartsDisplay = new HeartsDisplay(mc, this); numericDisplay = new NumericDisplay(mc, this); + + entityDisplay.setPosition(50, 50); + + heartsDisplay.setPosition(100, 150); + numericDisplay.setPosition(210, 150); } @SubscribeEvent