[1.7.10] Проблемы с отрисовкой

Версия Minecraft
1.7.10
API
Forge
27
2
При рисовании drawRect у меня либо текстуры ломается
Screenshot_1.png
Либо цвет меняет.
Screenshot_2.png
Вот код отрисовки:
Java:
GL11.glPushMatrix();
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                Gui.drawRect((w / 2) - 100, 0, (w / 2) + 100, 10, new Color(0x3a3a3a).getRGB());
                Gui.drawRect((w / 2) - 100, 0, (w / 2) - 100 + (int) (100 / max * cur), 10, new Color(0x60000b).getRGB());
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glPopMatrix();
И второй:
Java:
Gui.drawRect((w / 2) - mc.fontRenderer.getStringWidth(s) / 2 - 5, (h / 2) + 13, (w / 2) - mc.fontRenderer.getStringWidth(s) / 2 - 6, (h / 2) + 28, new Color(0xffffff).getRGB());
                Gui.drawRect((w / 2) + mc.fontRenderer.getStringWidth(s) / 2 + 5, (h / 2) + 15, (w / 2) + mc.fontRenderer.getStringWidth(s) / 2 + 6, (h / 2) + 31, new Color(0xffffff).getRGB());
                Gui.drawRect((w / 2) - mc.fontRenderer.getStringWidth(s) / 2 - 5, (h / 2) + 13, ((w / 2) - mc.fontRenderer.getStringWidth(s) / 2) + 10, (h / 2) + 14, new Color(0xffffff).getRGB());
                Gui.drawRect(((w / 2) + mc.fontRenderer.getStringWidth(s) / 2) - 10, (h / 2) + 30, (w / 2) + mc.fontRenderer.getStringWidth(s) / 2 + 5, (h / 2) + 31, new Color(0xffffff).getRGB());
 
27
2
Отрисовка Лого в drawScreen
Java:
GL11.glPushMatrix();
        RenderUtils.renderTextures(50/4, 50/4, 506/4, 163/4, logo);
        GL11.glPopMatrix();
Java:
    public static void renderTextures(float x, float y, float w, float h, ResourceLocation texture) {
        Minecraft.func_71410_x().func_110434_K().func_110577_a(texture);
        GL11.glPushMatrix();
        GL11.glTranslatef(x, y, 1.0F);
        GL11.glEnable(3042);
        OpenGlHelper.func_148821_a(770, 771, 1, 0);
        GL11.glBlendFunc(770, 771);
        drawTexturedQuadFit(0.0D, 0.0D, (double)w, (double)h, 1.0D);
        GL11.glDisable(3042);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }
Java:
    public static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel) {
        Tessellator tessellator = Tessellator.field_78398_a;
        tessellator.func_78382_b();
        tessellator.func_78374_a(x, y + height, zLevel, 0.0D, 1.0D);
        tessellator.func_78374_a(x + width, y + height, zLevel, 1.0D, 1.0D);
        tessellator.func_78374_a(x + width, y, zLevel, 1.0D, 0.0D);
        tessellator.func_78374_a(x, y, zLevel, 0.0D, 0.0D);
        tessellator.func_78381_a();
    }
Отрисовка drawRect
Java:
    @SubscribeEvent
    public void renderGameOverlay(RenderGameOverlayEvent.Post event)
    {
        EntityClientPlayerMP player = mc.thePlayer;
        int w = event.resolution.getScaledWidth();
        int h = event.resolution.getScaledHeight();
        if (event.type.equals(RenderGameOverlayEvent.ElementType.ALL)) {
            if (Minecraft.getMinecraft().objectMouseOver.entityHit != null && Minecraft.getMinecraft().objectMouseOver.entityHit instanceof EntityLivingBase) {
                float max = ((EntityLivingBase) Minecraft.getMinecraft().objectMouseOver.entityHit).getMaxHealth();
                float cur = ((EntityLivingBase) Minecraft.getMinecraft().objectMouseOver.entityHit).getHealth();
                if (((EntityLivingBase) Minecraft.getMinecraft().objectMouseOver.entityHit).hurtTime >= 0) {
                    RenderUtils.drawCenteredString(mc, (int) cur + "/" + (int) max, (w >> 1), 0, 23, 1, new Color(0xffffff).getRGB());
                    Gui.drawRect((w / 2) - 100, 0, (w / 2) + 100, 10, new Color(0x3a3a3a).getRGB());
                    Gui.drawRect((w / 2) - 100, 0, (w / 2) - 100 + (int) (100 / max * cur), 10, new Color(0x60000b).getRGB());
                }
            }
 
27
2
У меня другой теперь вопросик) Я хочу убрать отрисовку эффектов и сдвиг инвентаря, я нашел где это происходит в InventoryEffectRenderer
Java:
public void initGui()
    {
        super.initGui();

        if (!this.mc.thePlayer.getActivePotionEffects().isEmpty())
        {
            this.guiLeft = 160 + (this.width - this.xSize - 200) / 2;
            this.field_147045_u = true;
        }
    }
Я Хуком влажу в метод но естественно super.init(); сделать нельзя так как метод статический поэтому рисую прямо в хуке координаты. Но вылезло то что guiTop как и guiLeft - protected и использовать их нельзя. Я так же через хук и META-INF сделал их Public
META-INF файл _at.cfg:
public net.minecraft.client.gui.inventory.GuiContainer guiLeft
public net.minecraft.client.gui.inventory.GuiContainer guiTop
и сделал ХУК
Java:
    @Hook(returnCondition = ReturnCondition.ALWAYS)
    public static void initGui(InventoryEffectRenderer hook){
        hook.mc.thePlayer.openContainer = hook.inventorySlots;
    }
    @Hook(returnCondition = ReturnCondition.ALWAYS)
    public static int guiLeft(InventoryEffectRenderer hook){
        return (hook.width - 176) / 2;
    }
    @Hook(returnCondition = ReturnCondition.ALWAYS)
    public static int guiTop(InventoryEffectRenderer hook){
        return (hook.height - 166) / 2;
    }
Но не пашет, не пойму что именно я не так сделал
 
Сверху