Начинающий
- Статус
- Оффлайн
- Регистрация
- 17 Апр 2023
- Сообщения
- 287
- Реакции
- 3
- Выберите загрузчик игры
- Fabric
каде:
double healthWid = (curTarget.getHealth() / curTarget.getMaxHealth() * 120);
healthWid = MathHelper.clamp(healthWid, 0.0D, 120.0D);
double check = health < (curTarget instanceof PlayerEntity ? 18 : 10) && health > 1 ? 8 : 0;
healthBarWidth = (float) MathUtil.lerp(healthBarWidth, healthWid, 0.15f);
int cc1 = ColorUtil.multAlpha(ClientHelper.getColor1(), alpha);
context.getMatrices().push();
context.getMatrices().translate(posX + width / 2f, posY + height / 2f, 0);
context.getMatrices().scale(targetHud.animation.getValue(), targetHud.animation.getValue(), 1);
context.getMatrices().translate(-posX - width / 2f, -posY - height / 2f, 0);
RenderUtil.rectFilled(context.getMatrices(), posX, posY, 155, 60, ColorUtil.rgba(20, 20, 20, 200 * alpha / 255f));
if (!curTarget.getNameForScoreboard().isEmpty()) {
context.drawText(mc.textRenderer, curTarget.getNameForScoreboard(), (int) (posX + 31), (int) (posY + 5), -1, true);
}
context.getMatrices().push();
context.getMatrices().translate(posX, posY, 1);
context.getMatrices().scale(2.5f, 2.5f, 2.5f);
context.getMatrices().translate(-posX - 3, -posY - 2, 1);
context.drawText(mc.textRenderer, MathHelper.roundUpToMultiple((int) (health / 2f), 1) + " ❤", (int) posX + 16, (int) posY + 10, cc1, true);
context.getMatrices().pop();
context.drawItem(curTarget.getOffHandStack(), (int) posX + 137, (int) posY + 7);
context.drawItemInSlot(mc.textRenderer, curTarget.getOffHandStack(), (int) posX + 137, (int) posY + 7);
InventoryScreen.drawEntity(context, (int) (posX - 10), (int) (posY), (int) (posX + 39), (int) (posY + 70), 25, 0, mc.getWindow().getScaledWidth() / 2f, mc.getWindow().getScaledHeight() / 2f, curTarget);
RenderUtil.rectFilled(context.getMatrices(), posX + 30, posY + 48, 120, 8, ColorUtil.multDark(cc1, 0.7f * 0.7f * 0.7f));
RenderUtil.rectFilled(context.getMatrices(), posX + 30, posY + 48, (float) (healthBarWidth + check), 8, ColorUtil.multDark(cc1, 0.7f * 0.7f));
RenderUtil.rectFilled(context.getMatrices(), posX + 30, posY + 48, (float) healthWid, 8, cc1);
context.getMatrices().pop();