Привет. Хочу сделать свой худ, однако что бы я ни делал, всегда остаётся полоска брони. Помогите, люди добрые.
Java:
@SubscribeEvent
public void onOverlayPre(RenderGameOverlayEvent.Pre event) {
if (LevelData.getData(Minecraft.getMinecraft().thePlayer).getHideHealth()
&& !Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int width = resolution.getScaledWidth();
int height = resolution.getScaledHeight();
EntityPlayer player = mc.thePlayer;
mc.getTextureManager().bindTexture(ClientProxy.hudTexture);
GL11.glPushMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(3042);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3008);
TickHandlerClient.drawTexturedModalRect((int) (width / 2) - 92, height - 41 + 3, 8, 3, 102, 4);
TickHandlerClient.drawTexturedModalRect((int) (width / 2) - 92, height - 41 + 3, 8, 24,
(int) (102 * (player.getHealth() / player.getMaxHealth())), 4);
TickHandlerClient.drawTexturedModalRect((int) (width / 2) - 91, height - 40 + 8, 11, 8, 80, 3);
for (int i = 0; i < player.getFoodStats().getFoodLevel(); i++) {
TickHandlerClient.drawTexturedModalRect((int) (width / 2) - 91 + i * 4, height - 40 + 8, 11 + i * 4, 18, 4, 3);
}
if (player.getAir() != 300 && player.getAir() >= 0) {
TickHandlerClient.drawTexturedModalRect((int) (width / 2) - 91, height - 39 + 12, 10, 32,
(int) (60 * ((float) player.getAir() / 300.0F)), 2);
}
TickHandlerClient.drawTexturedModalRect((int) (width / 2) + 24, height - 41, 121, 0, 10, 11);
GL11.glScalef(1.25F, 1.25F, 1.25F);
mc.fontRenderer.drawString(String.valueOf(ForgeHooks.getTotalArmorValue(player)), (int) (((width / 2) + 36) * (1 / 1.25F)), (int) ((height - 47 + 6) * (1 / 1.25F)), 16777215);
GL11.glScalef(0.9F, 0.9F, 0.9F);
mc.fontRenderer.drawString(player.getHealth() + "/" + player.getMaxHealth(), (int) (((width / 2) - 94 + 39) * (1 / 0.9F)), (int) ((height - 43 + 5) * (1 / 0.9F)), 16777215);
GL11.glScalef(1.0F, 1.0F, 1.0F);
GL11.glDepthMask(true);
GL11.glEnable(2929);
GL11.glEnable(3008);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
if (event.type == ElementType.ARMOR || event.type == ElementType.AIR || event.type == ElementType.FOOD || event.type == ElementType.HEALTH) {
event.setCanceled(true);
}
}
}