protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
PlayerEntity playerentity = this.getRenderViewPlayer();
if (playerentity != null) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
ItemStack itemstack = playerentity.getHeldItemOffhand();
HandSide handside = playerentity.getPrimaryHand().opposite();
int i = this.scaledWidth / 2;
int j = this.getBlitOffset();
int k = 182;
int l = 91;
int firstColor = ColorUtil.getColorStyle(0);
int secondColor = ColorUtil.getColorStyle(90);
boolean customHotbar = Managment.FUNCTION_MANAGER.hotbar.state;
int blitStandartY = this.scaledHeight - 22;
int blitItemY = blitStandartY + 3;
this.setBlitOffset(-90);
if (customHotbar) {
{
int x = i - 91;
int y = blitStandartY;
int x2 = 182;
int y2 = 22;
Runnable round = () -> RenderUtil.Render2D.drawRoundedRect(x, y, x2, y2 - 2, 4, java.awt.Color.WHITE.getRGB());
//RenderUtil.Render2D.drawShadow(x, y, x2, y2 - 2, 10, firstColor, secondColor, firstColor, secondColor);
//RenderUtil.Render2D.drawGradientRound(x, y, x2, y2 - 2, 3, firstColor, secondColor, firstColor, secondColor);
RenderUtil.Render2D.drawRoundedRect(x, y, x2, y2 - 2, 2.5f, new java.awt.Color(0, 0, 0, 100).getRGB());
}
{
int x = i - 91 - 1 + playerentity.inventory.currentItem * 20;
int y = blitStandartY - 1;
int x2 = 24;
int y2 = 22;
RenderUtil.Render2D.drawShadow(x + 2, y + 2, x2 - 4, y2 - 4, 15, firstColor, secondColor, firstColor, secondColor);
RenderUtil.Render2D.drawGradientRound(x + 2, y + 2, x2 - 4, y2 - 4, 3, firstColor, secondColor, firstColor, secondColor);
RenderUtil.Render2D.drawRoundedRect(x + 2, y + 2, x2 - 4, y2 - 4, 3, new java.awt.Color(0, 0, 0,100).getRGB());
}
} else {
this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
this.blit(matrixStack, i - 91 - 1 + playerentity.inventory.currentItem * 20, blitStandartY - 1, 0, 22, 24, 22);
}
if (!itemstack.isEmpty()) {
if (handside == HandSide.LEFT) {
if (!customHotbar)
this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
else {
int x = i - 91 - 28;
int y = blitStandartY;
int x2 = 20;
int y2 = 21;
Runnable round = () -> RenderUtil.Render2D.drawRoundedRect(x, y, x2, y2 - 1, 3, java.awt.Color.WHITE.getRGB());
RenderUtil.Render2D.drawShadow(x, y, x2, y2 - 1, 7, firstColor, secondColor, firstColor, secondColor);
RenderUtil.Render2D.drawGradientRound(x, y, x2, y2 - 1, 3, firstColor, secondColor, firstColor, secondColor);
RenderUtil.Render2D.drawRoundedRect(x, y, x2, y2 - 1, 2.5f, ColorUtil.rgba(0, 0, 0, 100));
this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
}
} else {
this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
}
}
this.setBlitOffset(j);
RenderSystem.enableRescaleNormal();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
GL11.glEnable(GL11.GL_DEPTH_TEST);
CustomItems.setRenderOffHand(false);
for (int i1 = 0; i1 < 9; ++i1) {
int j1 = i - 90 + i1 * 20 + 2;
int k1 = blitItemY - 1;
this.renderHotbarItem(j1, k1, partialTicks, playerentity, playerentity.inventory.mainInventory.get(i1));
}
if (!itemstack.isEmpty()) {
CustomItems.setRenderOffHand(true);
int i2 = blitItemY - 1;
if (handside == HandSide.LEFT) {
this.renderHotbarItem(i - 91 - 26, i2, partialTicks, playerentity, itemstack);
} else {
this.renderHotbarItem(i + 91 + 10, i2, partialTicks, playerentity, itemstack);
}
CustomItems.setRenderOffHand(false);
}
if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
float f = this.mc.player.getCooledAttackStrength(0.0F);
if (f < 1.0F) {
int j2 = blitStandartY - 2;
int k2 = i + 91 + 6;
if (handside == HandSide.RIGHT) {
k2 = i - 91 - 22;
}
this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
int l1 = (int) (f * 19.0F);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
}
}
RenderSystem.disableRescaleNormal();
RenderSystem.disableBlend();
}
}