public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
Minecraft minecraft = Minecraft.getInstance();
FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
int i = this.getYImage(this.isHovered());
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.enableDepthTest();
int j = this.active ? 16777215 : 10526880;
this.renderBg(matrixStack, minecraft, mouseX, mouseY);
DisplayUtils.drawStyledRect( this.x, this.y, this.width, this.height , 4);
Fonts.sfbold2.drawCenteredText(matrixStack, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, 8);
/**
* [USER=804731]@param[/USER] Цикл я добавил чтобы не занимало слишком много места
* [USER=804731]@param[/USER] Кстати, к сожалению я о isHovered узнал только сегодня :(
* */
if (MathUtil.isHovered(mouseX, mouseY, x,y,width,height)) {
for (int xd = 0; xd < 2; xd++) {
DisplayUtils.drawShadow(this.x, this.y, this.width + 0.7f, this.height + 3f, 20, ColorUtils.setAlpha(HUD.getColor(1), 55));
}
DisplayUtils.drawRoundedRect( this.x, this.y, this.width, this.height , 4, ColorUtils.setAlpha(HUD.getColor(1), 55));
}
else if (SelfDestruct.unhooked) {
minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.enableDepthTest();
this.blit(matrixStack, this.x, this.y, 0, 46 + i * 20, this.width / 2, this.height);
this.blit(matrixStack, this.x + this.width / 2, this.y, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
this.renderBg(matrixStack, minecraft, mouseX, mouseY);
drawCenteredString(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
}
this.renderBg(matrixStack, minecraft, mouseX, mouseY);
}