From 7a1cf35934ef14c04f884fe6ae34282e1d6243ba Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 17 Jan 2020 14:31:30 +0800 Subject: 3.3.12 --- .../java/me/shedaniel/rei/gui/widget/PanelWidget.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java') diff --git a/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java index e6b534dcd..310d62263 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java @@ -28,6 +28,12 @@ public class PanelWidget extends WidgetWithBounds { this.bounds = bounds; } + public static void render(Rectangle bounds, int color) { + TEMP.bounds = bounds; + TEMP.color = color; + TEMP.render(); + } + @Override public Rectangle getBounds() { return bounds; @@ -38,12 +44,6 @@ public class PanelWidget extends WidgetWithBounds { return Collections.emptyList(); } - public static void render(Rectangle bounds, int color) { - TEMP.bounds = bounds; - TEMP.color = color; - TEMP.render(); - } - public void render() { render(0, 0, 0); } @@ -60,10 +60,10 @@ public class PanelWidget extends WidgetWithBounds { public void render(int mouseX, int mouseY, float delta) { if (!isRendering()) return; + float alpha = ((color >> 24) & 0xFF) / 255f; float red = ((color >> 16) & 0xFF) / 255f; float green = ((color >> 8) & 0xFF) / 255f; - float blue = ((color >> 0) & 0xFF) / 255f; - float alpha = ((color >> 32) & 0xFF) / 255f; + float blue = (color & 0xFF) / 255f; RenderSystem.color4f(red, green, blue, alpha); minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; -- cgit