aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/core
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
commitc04ca523f9fb9f7adefa74587db61f76deeae9f0 (patch)
treef148e7bcd9105813d3fe781badcb2cf3892712fd /src/main/java/com/thatgravyboat/skyblockhud/core
parenta8e475fa0a7977f64f072548459d592274169d66 (diff)
downloadskyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.gz
skyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.bz2
skyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.zip
Increase line width
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/core')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/BackgroundBlur.java88
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/ChromaColour.java40
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/GlScissorStack.java19
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementBoolean.java29
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementColour.java350
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementTextField.java302
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/GuiScreenElementWrapper.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/Position.java22
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditor.java42
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorAccordion.java29
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorBoolean.java9
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorButton.java11
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorColour.java19
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java101
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDropdown.java72
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorSlider.java44
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorText.java26
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java113
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/struct/ConfigProcessor.java127
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java87
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/MiscUtils.java41
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/StringUtils.java5
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/lerp/LerpUtils.java6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/lerp/LerpingFloat.java3
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/lerp/LerpingInteger.java3
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/render/RenderUtils.java193
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/render/TextRenderUtils.java69
27 files changed, 324 insertions, 1533 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/BackgroundBlur.java b/src/main/java/com/thatgravyboat/skyblockhud/core/BackgroundBlur.java
index e95e896..7c252ad 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/BackgroundBlur.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/BackgroundBlur.java
@@ -66,10 +66,8 @@ public class BackgroundBlur {
}
);
- output.framebufferWidth =
- output.framebufferTextureWidth = width;
- output.framebufferHeight =
- output.framebufferTextureHeight = height;
+ output.framebufferWidth = output.framebufferTextureWidth = width;
+ output.framebufferHeight = output.framebufferTextureHeight = height;
blurBackground(output, blur);
}
@@ -129,10 +127,7 @@ public class BackgroundBlur {
}
private static void blurBackground(Framebuffer output, float blurFactor) {
- if (
- !OpenGlHelper.isFramebufferEnabled() ||
- !OpenGlHelper.areShadersSupported()
- ) return;
+ if (!OpenGlHelper.isFramebufferEnabled() || !OpenGlHelper.areShadersSupported()) return;
int width = Minecraft.getMinecraft().displayWidth;
int height = Minecraft.getMinecraft().displayHeight;
@@ -151,14 +146,9 @@ public class BackgroundBlur {
if (blurOutputHorz == null || output == null) {
return;
}
- if (
- blurOutputHorz.framebufferWidth != width ||
- blurOutputHorz.framebufferHeight != height
- ) {
+ if (blurOutputHorz.framebufferWidth != width || blurOutputHorz.framebufferHeight != height) {
blurOutputHorz.createBindFramebuffer(width, height);
- blurShaderHorz.setProjectionMatrix(
- createProjectionMatrix(width, height)
- );
+ blurShaderHorz.setProjectionMatrix(createProjectionMatrix(width, height));
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
}
@@ -170,47 +160,22 @@ public class BackgroundBlur {
Minecraft.getMinecraft().getFramebuffer(),
blurOutputHorz
);
- blurShaderHorz
- .getShaderManager()
- .getShaderUniform("BlurDir")
- .set(1, 0);
- blurShaderHorz.setProjectionMatrix(
- createProjectionMatrix(width, height)
- );
+ blurShaderHorz.getShaderManager().getShaderUniform("BlurDir").set(1, 0);
+ blurShaderHorz.setProjectionMatrix(createProjectionMatrix(width, height));
} catch (Exception ignored) {}
try {
- blurShaderVert =
- new Shader(
- Minecraft.getMinecraft().getResourceManager(),
- "blur",
- blurOutputHorz,
- output
- );
- blurShaderVert
- .getShaderManager()
- .getShaderUniform("BlurDir")
- .set(0, 1);
- blurShaderVert.setProjectionMatrix(
- createProjectionMatrix(width, height)
- );
+ blurShaderVert = new Shader(Minecraft.getMinecraft().getResourceManager(), "blur", blurOutputHorz, output);
+ blurShaderVert.getShaderManager().getShaderUniform("BlurDir").set(0, 1);
+ blurShaderVert.setProjectionMatrix(createProjectionMatrix(width, height));
} catch (Exception ignored) {}
if (blurShaderHorz != null && blurShaderVert != null) {
- if (
- blurShaderHorz.getShaderManager().getShaderUniform("Radius") ==
- null
- ) {
+ if (blurShaderHorz.getShaderManager().getShaderUniform("Radius") == null) {
//Corrupted shader?
return;
}
- blurShaderHorz
- .getShaderManager()
- .getShaderUniform("Radius")
- .set(blurFactor);
- blurShaderVert
- .getShaderManager()
- .getShaderUniform("Radius")
- .set(blurFactor);
+ blurShaderHorz.getShaderManager().getShaderUniform("Radius").set(blurFactor);
+ blurShaderVert.getShaderManager().getShaderUniform("Radius").set(blurFactor);
GL11.glPushMatrix();
/*GL30.glBindFramebuffer(GL30.GL_READ_FRAMEBUFFER, Minecraft.getMinecraft().getFramebuffer().framebufferObject);
@@ -237,16 +202,7 @@ public class BackgroundBlur {
int blurWidth,
int blurHeight
) {
- renderBlurredBackground(
- blurStrength,
- screenWidth,
- screenHeight,
- x,
- y,
- blurWidth,
- blurHeight,
- false
- );
+ renderBlurredBackground(blurStrength, screenWidth, screenHeight, x, y, blurWidth, blurHeight, false);
}
/**
@@ -263,10 +219,7 @@ public class BackgroundBlur {
int blurHeight,
boolean forcedUpdate
) {
- if (
- !OpenGlHelper.isFramebufferEnabled() ||
- !OpenGlHelper.areShadersSupported()
- ) return;
+ if (!OpenGlHelper.isFramebufferEnabled() || !OpenGlHelper.areShadersSupported()) return;
if (blurStrength < 0.5) return;
requestedBlurs.add(blurStrength);
@@ -292,16 +245,7 @@ public class BackgroundBlur {
Gui.drawRect(x, y, x + blurWidth, y + blurHeight, fogColour);
fb.bindFramebufferTexture();
GlStateManager.color(1f, 1f, 1f, 1f);
- RenderUtils.drawTexturedRect(
- x,
- y,
- blurWidth,
- blurHeight,
- uMin,
- uMax,
- vMin,
- vMax
- );
+ RenderUtils.drawTexturedRect(x, y, blurWidth, blurHeight, uMin, uMax, vMin, vMax);
fb.unbindFramebufferTexture();
GlStateManager.depthMask(true);
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/ChromaColour.java b/src/main/java/com/thatgravyboat/skyblockhud/core/ChromaColour.java
index b8e97ee..3137153 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/ChromaColour.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/ChromaColour.java
@@ -5,24 +5,12 @@ import java.awt.*;
public class ChromaColour {
public static String special(int chromaSpeed, int alpha, int rgb) {
- return special(
- chromaSpeed,
- alpha,
- (rgb & 0xFF0000) >> 16,
- (rgb & 0x00FF00) >> 8,
- (rgb & 0x0000FF)
- );
+ return special(chromaSpeed, alpha, (rgb & 0xFF0000) >> 16, (rgb & 0x00FF00) >> 8, (rgb & 0x0000FF));
}
private static final int RADIX = 10;
- public static String special(
- int chromaSpeed,
- int alpha,
- int r,
- int g,
- int b
- ) {
+ public static String special(int chromaSpeed, int alpha, int r, int g, int b) {
StringBuilder sb = new StringBuilder();
sb.append(Integer.toString(chromaSpeed, RADIX)).append(":");
sb.append(Integer.toString(alpha, RADIX)).append(":");
@@ -51,9 +39,7 @@ public class ChromaColour {
int a = d[3];
int chr = d[4];
- return (
- (a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF)
- );
+ return ((a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF));
}
public static int getSpeed(String special) {
@@ -61,12 +47,7 @@ public class ChromaColour {
}
public static float getSecondsForSpeed(int speed) {
- return (
- (255 - speed) /
- 254f *
- (MAX_CHROMA_SECS - MIN_CHROMA_SECS) +
- MIN_CHROMA_SECS
- );
+ return ((255 - speed) / 254f * (MAX_CHROMA_SECS - MIN_CHROMA_SECS) + MIN_CHROMA_SECS);
}
private static final int MIN_CHROMA_SECS = 1;
@@ -88,16 +69,12 @@ public class ChromaColour {
if (chr > 0) {
float seconds = getSecondsForSpeed(chr);
- hsv[0] +=
- (System.currentTimeMillis() - startTime) / 1000f / seconds;
+ hsv[0] += (System.currentTimeMillis() - startTime) / 1000f / seconds;
hsv[0] %= 1;
if (hsv[0] < 0) hsv[0] += 1;
}
- return (
- (a & 0xFF) << 24 |
- (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF)
- );
+ return ((a & 0xFF) << 24 | (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF));
}
public static int rotateHue(int argb, int degrees) {
@@ -111,9 +88,6 @@ public class ChromaColour {
hsv[0] += degrees / 360f;
hsv[0] %= 1;
- return (
- (a & 0xFF) << 24 |
- (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF)
- );
+ return ((a & 0xFF) << 24 | (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF));
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/GlScissorStack.java b/src/main/java/com/thatgravyboat/skyblockhud/core/GlScissorStack.java
index 306565e..0e1694e 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/GlScissorStack.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/GlScissorStack.java
@@ -40,24 +40,13 @@ public class GlScissorStack {
public void set(ScaledResolution scaledResolution) {
int height = Minecraft.getMinecraft().displayHeight;
int scale = scaledResolution.getScaleFactor();
- GL11.glScissor(
- left * scale,
- height - bottom * scale,
- (right - left) * scale,
- (bottom - top) * scale
- );
+ GL11.glScissor(left * scale, height - bottom * scale, (right - left) * scale, (bottom - top) * scale);
}
}
private static final LinkedList<Bounds> boundsStack = new LinkedList<>();
- public static void push(
- int left,
- int top,
- int right,
- int bottom,
- ScaledResolution scaledResolution
- ) {
+ public static void push(int left, int top, int right, int bottom, ScaledResolution scaledResolution) {
if (right < left) {
int temp = right;
right = left;
@@ -71,9 +60,7 @@ public class GlScissorStack {
if (boundsStack.isEmpty()) {
boundsStack.push(new Bounds(left, top, right, bottom));
} else {
- boundsStack.push(
- boundsStack.peek().createSubBound(left, top, right, bottom)
- );
+ boundsStack.push(boundsStack.peek().createSubBound(left, top, right, bottom));
}
if (!boundsStack.isEmpty()) {
boundsStack.peek().set(scaledResolution);
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementBoolean.java b/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementBoolean.java
index a8ed7d5..e41b7b3 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementBoolean.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementBoolean.java
@@ -24,22 +24,11 @@ public class GuiElementBoolean extends GuiElement {
private static final int xSize = 48;
private static final int ySize = 14;
- public GuiElementBoolean(
- int x,
- int y,
- boolean value,
- Consumer<Boolean> toggleCallback
- ) {
+ public GuiElementBoolean(int x, int y, boolean value, Consumer<Boolean> toggleCallback) {
this(x, y, value, 0, toggleCallback);
}
- public GuiElementBoolean(
- int x,
- int y,
- boolean value,
- int clickRadius,
- Consumer<Boolean> toggleCallback
- ) {
+ public GuiElementBoolean(int x, int y, boolean value, int clickRadius, Consumer<Boolean> toggleCallback) {
this.x = x;
this.y = y;
this.value = value;
@@ -54,10 +43,7 @@ public class GuiElementBoolean extends GuiElement {
@Override
public void render() {
GlStateManager.color(1, 1, 1, 1);
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(GuiTextures.BAR);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(GuiTextures.BAR);
RenderUtils.drawTexturedRect(x, y, xSize, ySize);
ResourceLocation buttonLoc = GuiTextures.ON;
@@ -66,10 +52,7 @@ public class GuiElementBoolean extends GuiElement {
lastMillis = currentMillis;
boolean passedLimit = false;
if (previewValue != value) {
- if (
- (previewValue && animation > 12) ||
- (!previewValue && animation < 24)
- ) {
+ if ((previewValue && animation > 12) || (!previewValue && animation < 24)) {
passedLimit = true;
}
}
@@ -96,9 +79,7 @@ public class GuiElementBoolean extends GuiElement {
}
}
- int animation = (int) (
- LerpUtils.sigmoidZeroOne(this.animation / 36f) * 36
- );
+ int animation = (int) (LerpUtils.sigmoidZeroOne(this.animation / 36f) * 36);
if (animation < 3) {
buttonLoc = GuiTextures.OFF;
} else if (animation < 13) {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementColour.java b/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementColour.java
index 8b5c2d6..a7db23b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementColour.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/GuiElementColour.java
@@ -31,9 +31,7 @@ public class GuiElementColour extends GuiElement {
"skyblockhud:core/colour_selector_chroma.png"
);
- private static final ResourceLocation colourPickerLocation = new ResourceLocation(
- "mbcore:dynamic/colourpicker"
- );
+ private static final ResourceLocation colourPickerLocation = new ResourceLocation("mbcore:dynamic/colourpicker");
private static final ResourceLocation colourPickerBarValueLocation = new ResourceLocation(
"mbcore:dynamic/colourpickervalue"
);
@@ -42,9 +40,7 @@ public class GuiElementColour extends GuiElement {
);
private final GuiElementTextField hexField = new GuiElementTextField(
"",
- GuiElementTextField.SCALE_TEXT |
- GuiElementTextField.FORCE_CAPS |
- GuiElementTextField.NO_SPACE
+ GuiElementTextField.SCALE_TEXT | GuiElementTextField.FORCE_CAPS | GuiElementTextField.NO_SPACE
);
private int x;
@@ -68,20 +64,10 @@ public class GuiElementColour extends GuiElement {
Consumer<String> colourChangedCallback,
Runnable closeCallback
) {
- final ScaledResolution scaledResolution = new ScaledResolution(
- Minecraft.getMinecraft()
- );
+ final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
- this.y =
- Math.max(
- 10,
- Math.min(scaledResolution.getScaledHeight() - ySize - 10, y)
- );
- this.x =
- Math.max(
- 10,
- Math.min(scaledResolution.getScaledWidth() - xSize - 10, x)
- );
+ this.y = Math.max(10, Math.min(scaledResolution.getScaledHeight() - ySize - 10, y));
+ this.x = Math.max(10, Math.min(scaledResolution.getScaledWidth() - xSize - 10, x));
this.colour = initialColour;
this.colourChangedCallback = colourChangedCallback;
@@ -89,12 +75,7 @@ public class GuiElementColour extends GuiElement {
int colour = ChromaColour.specialToSimpleRGB(initialColour);
Color c = new Color(colour);
- float[] hsv = Color.RGBtoHSB(
- c.getRed(),
- c.getGreen(),
- c.getBlue(),
- null
- );
+ float[] hsv = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
updateAngleAndRadius(hsv);
}
@@ -108,51 +89,25 @@ public class GuiElementColour extends GuiElement {
int currentColour = ChromaColour.specialToSimpleRGB(colour);
Color c = new Color(currentColour, true);
- float[] hsv = Color.RGBtoHSB(
- c.getRed(),
- c.getGreen(),
- c.getBlue(),
- null
- );
+ float[] hsv = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
- BufferedImage bufferedImage = new BufferedImage(
- 288,
- 288,
- BufferedImage.TYPE_INT_ARGB
- );
+ BufferedImage bufferedImage = new BufferedImage(288, 288, BufferedImage.TYPE_INT_ARGB);
float borderRadius = 0.05f;
if (Keyboard.isKeyDown(Keyboard.KEY_N)) borderRadius = 0;
for (int x = -16; x < 272; x++) {
for (int y = -16; y < 272; y++) {
- float radius = (float) Math.sqrt(
- ((x - 128) * (x - 128) + (y - 128) * (y - 128)) / 16384f
- );
- float angle = (float) Math.toDegrees(
- Math.atan((128 - x) / (y - 128 + 1E-5)) + Math.PI / 2
- );
+ float radius = (float) Math.sqrt(((x - 128) * (x - 128) + (y - 128) * (y - 128)) / 16384f);
+ float angle = (float) Math.toDegrees(Math.atan((128 - x) / (y - 128 + 1E-5)) + Math.PI / 2);
if (y < 128) angle += 180;
if (radius <= 1) {
- int rgb = Color
- .getHSBColor(
- angle / 360f,
- (float) Math.pow(radius, 1.5f),
- hsv[2]
- )
- .getRGB();
+ int rgb = Color.getHSBColor(angle / 360f, (float) Math.pow(radius, 1.5f), hsv[2]).getRGB();
bufferedImage.setRGB(x + 16, y + 16, rgb);
} else if (radius <= 1 + borderRadius) {
- float invBlackAlpha =
- Math.abs(radius - 1 - borderRadius / 2) /
- borderRadius *
- 2;
+ float invBlackAlpha = Math.abs(radius - 1 - borderRadius / 2) / borderRadius * 2;
float blackAlpha = 1 - invBlackAlpha;
if (radius > 1 + borderRadius / 2) {
- bufferedImage.setRGB(
- x + 16,
- y + 16,
- (int) (blackAlpha * 255) << 24
- );
+ bufferedImage.setRGB(x + 16, y + 16, (int) (blackAlpha * 255) << 24);
} else {
Color col = Color.getHSBColor(angle / 360f, 1, hsv[2]);
int rgb = (int) (col.getRed() * invBlackAlpha) << 16 |
@@ -164,34 +119,22 @@ public class GuiElementColour extends GuiElement {
}
}
- BufferedImage bufferedImageValue = new BufferedImage(
- 10,
- 64,
- BufferedImage.TYPE_INT_ARGB
- );
+ BufferedImage bufferedImageValue = new BufferedImage(10, 64, BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < 10; x++) {
for (int y = 0; y < 64; y++) {
if ((x == 0 || x == 9) && (y == 0 || y == 63)) continue;
- int rgb = Color
- .getHSBColor(wheelAngle / 360, wheelRadius, (64 - y) / 64f)
- .getRGB();
+ int rgb = Color.getHSBColor(wheelAngle / 360, wheelRadius, (64 - y) / 64f).getRGB();
bufferedImageValue.setRGB(x, y, rgb);
}
}
- BufferedImage bufferedImageOpacity = new BufferedImage(
- 10,
- 64,
- BufferedImage.TYPE_INT_ARGB
- );
+ BufferedImage bufferedImageOpacity = new BufferedImage(10, 64, BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < 10; x++) {
for (int y = 0; y < 64; y++) {
if ((x == 0 || x == 9) && (y == 0 || y == 63)) continue;
- int rgb =
- (currentColour & 0x00FFFFFF) |
- (Math.min(255, (64 - y) * 4) << 24);
+ int rgb = (currentColour & 0x00FFFFFF) | (Math.min(255, (64 - y) * 4) << 24);
bufferedImageOpacity.setRGB(x, y, rgb);
}
}
@@ -200,68 +143,30 @@ public class GuiElementColour extends GuiElement {
int selx = (int) (Math.cos(Math.toRadians(wheelAngle)) * selradius);
int sely = (int) (Math.sin(Math.toRadians(wheelAngle)) * selradius);
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colour_selector_bar_alpha);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colour_selector_bar_alpha);
GlStateManager.color(1, 1, 1, 1);
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5 + 10 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5 + 10 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
Minecraft
.getMinecraft()
.getTextureManager()
- .loadTexture(
- colourPickerBarValueLocation,
- new DynamicTexture(bufferedImageValue)
- );
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colourPickerBarValueLocation);
+ .loadTexture(colourPickerBarValueLocation, new DynamicTexture(bufferedImageValue));
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colourPickerBarValueLocation);
GlStateManager.color(1, 1, 1, 1);
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
Minecraft
.getMinecraft()
.getTextureManager()
- .loadTexture(
- colourPickerBarOpacityLocation,
- new DynamicTexture(bufferedImageOpacity)
- );
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colourPickerBarOpacityLocation);
+ .loadTexture(colourPickerBarOpacityLocation, new DynamicTexture(bufferedImageOpacity));
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colourPickerBarOpacityLocation);
GlStateManager.color(1, 1, 1, 1);
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5 + 10 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5 + 10 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
int chromaSpeed = ChromaColour.getSpeed(colour);
int currentColourChroma = ChromaColour.specialToChromaRGB(colour);
Color cChroma = new Color(currentColourChroma, true);
- float hsvChroma[] = Color.RGBtoHSB(
- cChroma.getRed(),
- cChroma.getGreen(),
- cChroma.getBlue(),
- null
- );
+ float hsvChroma[] = Color.RGBtoHSB(cChroma.getRed(), cChroma.getGreen(), cChroma.getBlue(), null);
if (chromaSpeed > 0) {
Gui.drawRect(
@@ -278,58 +183,23 @@ public class GuiElementColour extends GuiElement {
x + 5 + 64 + 5 + 10 + 5 + 10 + 5 + 10 - 1,
y + 5 + 37 - 1,
Color.HSBtoRGB(
- (
- hsvChroma[0] +
- (System.currentTimeMillis() - ChromaColour.startTime) /
- 1000f
- ) %
- 1,
+ (hsvChroma[0] + (System.currentTimeMillis() - ChromaColour.startTime) / 1000f) % 1,
0.8f,
0.8f
)
);
}
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colour_selector_bar);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colour_selector_bar);
GlStateManager.color(1, 1, 1, 1);
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5 + 10 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5 + 10 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
if (chromaSpeed > 0) {
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5 + 10 + 5 + 10 + 5,
- y + 5,
- 10,
- 64,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5 + 10 + 5 + 10 + 5, y + 5, 10, 64, GL11.GL_NEAREST);
} else {
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colour_selector_chroma);
- RenderUtils.drawTexturedRect(
- x + 5 + 64 + 5 + 10 + 5 + 10 + 5,
- y + 5 + 27,
- 10,
- 10,
- GL11.GL_NEAREST
- );
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colour_selector_chroma);
+ RenderUtils.drawTexturedRect(x + 5 + 64 + 5 + 10 + 5 + 10 + 5, y + 5 + 27, 10, 10, GL11.GL_NEAREST);
}
Gui.drawRect(
@@ -359,29 +229,14 @@ public class GuiElementColour extends GuiElement {
Minecraft
.getMinecraft()
.getTextureManager()
- .loadTexture(
- colourPickerLocation,
- new DynamicTexture(bufferedImage)
- );
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colourPickerLocation);
+ .loadTexture(colourPickerLocation, new DynamicTexture(bufferedImage));
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colourPickerLocation);
GlStateManager.color(1, 1, 1, 1);
RenderUtils.drawTexturedRect(x + 1, y + 1, 72, 72, GL11.GL_LINEAR);
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(colour_selector_dot);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(colour_selector_dot);
GlStateManager.color(1, 1, 1, 1);
- RenderUtils.drawTexturedRect(
- x + 5 + 32 + selx - 4,
- y + 5 + 32 + sely - 4,
- 8,
- 8,
- GL11.GL_NEAREST
- );
+ RenderUtils.drawTexturedRect(x + 5 + 32 + selx - 4, y + 5 + 32 + sely - 4, 8, 8, GL11.GL_NEAREST);