public static void drawRoundFace(float x, float y, float width, float height, float radius, float alpha, AbstractClientPlayerEntity target) {
try {
ResourceLocation skin = target.getLocationSkin();
mc.getTextureManager().bindTexture(skin);
// Вычисляем процент повреждения
float hurtPercent = getHurtPercent(target);
RenderSystem.pushMatrix();
RenderSystem.enableBlend();
RenderSystem.blendFunc(770, 771);
// Подключаем шейдер для округлой головы
ShaderUtil.FACE_ROUND.attach();
// Передаем данные в шейдер
ShaderUtil.FACE_ROUND.setUniform("location", x * 2, sr.getHeight() - height * 2 - y * 2);
ShaderUtil.FACE_ROUND.setUniform("size", width * 2, height * 2);
ShaderUtil.FACE_ROUND.setUniform("texture", 0);
ShaderUtil.FACE_ROUND.setUniform("radius", radius * 2);
ShaderUtil.FACE_ROUND.setUniform("alpha", alpha);
ShaderUtil.FACE_ROUND.setUniform("hurtPercent", hurtPercent); // Передаем процент повреждений в шейдер
ShaderUtil.FACE_ROUND.setUniform("u", (1f / 64) * 8);
ShaderUtil.FACE_ROUND.setUniform("v", (1f / 64) * 8);
ShaderUtil.FACE_ROUND.setUniform("w", 1f / 8);
ShaderUtil.FACE_ROUND.setUniform("h", 1f / 8);
quadsBegin(x, y, width, height, 7);
// Отключаем шейдер
ShaderUtil.FACE_ROUND.detach();
RenderSystem.disableBlend();
RenderSystem.popMatrix();
} catch(Exception e){
e.printStackTrace();
}
}