Вид из шлема

Версия Minecraft
1.12.2
API
Forge
Хочу сделать вид из шлема или HUD, как в pumpkinblur, но не знаю как это сделать
 
отрисовка худа
Java:
@SideOnly(Side.CLIENT)
    public void renderHelmetOverlay(ItemStack itemstack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
        if (player.getCurrentArmor(3) != null) {
            GL11.glPushMatrix();
            GL11.glEnable(3042);
            GL11.glClearDepth(1.0D);
            GL11.glDisable(2929);
            GL11.glDisable(3008);
            GL11.glDepthMask(false);
            GL11.glBlendFunc(770, 771);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            ResourceLocation defaultHud = new ResourceLocation("путь к текстуре");
            (Minecraft.getMinecraft()).renderEngine.bindTexture(defaultHud);
            Tessellator tessellator = Tessellator.instance;
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, resolution.getScaledHeight(), -90.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV(resolution.getScaledWidth(), resolution.getScaledHeight(), -90.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV(resolution.getScaledWidth(), 0.0D, -90.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
            tessellator.draw();
            GL11.glDepthMask(true);
            GL11.glEnable(2929);
            GL11.glEnable(3008);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(3042);
            GL11.glPopMatrix();
        }
    }
 
отрисовка худа
Java:
@SideOnly(Side.CLIENT)
    public void renderHelmetOverlay(ItemStack itemstack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
        if (player.getCurrentArmor(3) != null) {
            GL11.glPushMatrix();
            GL11.glEnable(3042);
            GL11.glClearDepth(1.0D);
            GL11.glDisable(2929);
            GL11.glDisable(3008);
            GL11.glDepthMask(false);
            GL11.glBlendFunc(770, 771);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            ResourceLocation defaultHud = new ResourceLocation("путь к текстуре");
            (Minecraft.getMinecraft()).renderEngine.bindTexture(defaultHud);
            Tessellator tessellator = Tessellator.instance;
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, resolution.getScaledHeight(), -90.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV(resolution.getScaledWidth(), resolution.getScaledHeight(), -90.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV(resolution.getScaledWidth(), 0.0D, -90.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
            tessellator.draw();
            GL11.glDepthMask(true);
            GL11.glEnable(2929);
            GL11.glEnable(3008);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(3042);
            GL11.glPopMatrix();
        }
    }
это на 1.7.10 по-моему, но, кажется, я уже разобрался
 
Назад
Сверху