Если ArmorRender тебе нужен то держи
ss-
Code:
package im.Exo.ui.display.impl;
import im.Exo.Exo;
import im.Exo.events.EventDisplay;
import im.Exo.functions.api.FunctionRegistry;
import im.Exo.functions.impl.render.HUD;
import im.Exo.functions.impl.render.Hotbar;
import im.Exo.ui.display.ElementRenderer;
import im.Exo.utils.math.Vector4i;
import im.Exo.utils.render.ColorUtils;
import im.Exo.utils.render.DisplayUtils;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.HandSide;
import net.minecraft.util.math.vector.Vector4f;
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class ArmorRenderer implements ElementRenderer {
@Override
public void render(EventDisplay eventDisplay) {
PlayerEntity playerentity = this.getRenderViewPlayer();
HandSide handside = playerentity.getPrimaryHand().opposite();
int posX = window.getScaledWidth() / 2 + 97;
int posX2 = window.getScaledWidth() / 2 - 97;
int posY = window.getScaledHeight() - (16 + 2);
FunctionRegistry functionRegistry = Exo.getInstance().getFunctionRegistry();
Hotbar hotbar = functionRegistry.getHotbar();
boolean bl = hotbar.bron.get();
int y2 = 17;
Vector4i colors = new Vector4i(HUD.getColor(0, 1), HUD.getColor(90, 1), HUD.getColor(180, 1), HUD.getColor(270, 1));
if (bl){
if (handside == HandSide.LEFT) {
DisplayUtils.drawShadow(posX - 1.5f, posY - 1.5f, 72.5f, y2 + 1.5F, 5, HUD.getColor(0), HUD.getColor(90));
DisplayUtils.drawRoundedRect(posX - 1.5f, posY - 1.5f, 72.5f, y2 + 1.5F, new Vector4f(5, 5, 5, 5), colors);
DisplayUtils.drawRoundedRect(posX - 0.5F, posY - 0.5F, 70.5F, y2 - 0.5F, new Vector4f(5, 5, 5, 5), ColorUtils.rgba(15, 15, 15, 175));
}else {
DisplayUtils.drawShadow(posX2 - 71.5f, posY - 1.5f, 72.5f, y2 + 1.5F, 5, HUD.getColor(0), HUD.getColor(90));
DisplayUtils.drawRoundedRect(posX2 - 71.5f, posY - 1.5f, 72.5f, y2 + 1.5F, new Vector4f(5, 5, 5, 5), colors);
DisplayUtils.drawRoundedRect(posX2 - 70.5F, posY - 0.5F, 70.5F, y2 - 0.5F, new Vector4f(5, 5, 5, 5), ColorUtils.rgba(15, 15, 15, 175));
}
}
for (ItemStack itemStack : mc.player.getArmorInventoryList()) {
if (handside == HandSide.LEFT) {
if (itemStack.isEmpty()) continue;
mc.getItemRenderer().renderItemAndEffectIntoGUI(itemStack, posX, posY);
mc.getItemRenderer().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, posX, posY, null);
posX += 16 + 2;
}else {
if (itemStack.isEmpty()) continue;
posX2 += -16 - 2; // Смещаем позицию перед отрисовкой
mc.getItemRenderer().renderItemAndEffectIntoGUI(itemStack, posX2, posY);
mc.getItemRenderer().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, posX2, posY, null);
}
}
}
private PlayerEntity getRenderViewPlayer() {
return !(this.mc.getRenderViewEntity() instanceof PlayerEntity) ? null
: (PlayerEntity) this.mc.getRenderViewEntity();
}
}