aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/utils
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-11 23:31:02 -0500
committerGitHub <noreply@github.com>2020-12-11 23:31:02 -0500
commitefa27de89b1cdaf738446837160deebb81c70331 (patch)
tree28f58dd4128f088f0b9b748dbdddf519b51ef5b3 /src/main/java/me/Danker/utils
parent13908c49c3743c22dcfb465215bcc7425b711598 (diff)
parent47910bc70961bd39d43cfdcbee103949559459c1 (diff)
downloadSkyblockMod-efa27de89b1cdaf738446837160deebb81c70331.tar.gz
SkyblockMod-efa27de89b1cdaf738446837160deebb81c70331.tar.bz2
SkyblockMod-efa27de89b1cdaf738446837160deebb81c70331.zip
Merge pull request #2 from bowser0000/development
Merge commits from development
Diffstat (limited to 'src/main/java/me/Danker/utils')
-rw-r--r--src/main/java/me/Danker/utils/Utils.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index e0a7454..e4f7873 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -64,7 +64,7 @@ public class Utils {
}
public static String returnGoldenEnchants(String line) {
- Matcher matcher = DankersSkyblockMod.pattern.matcher(line);
+ Matcher matcher = DankersSkyblockMod.t6EnchantPattern.matcher(line);
StringBuffer out = new StringBuffer();
while (matcher.find()) {
@@ -103,16 +103,21 @@ public class Utils {
int height = scaledResolution.getScaledHeight();
int width = scaledResolution.getScaledWidth();
- int textLength = mc.fontRendererObj.getStringWidth(text);
-
- double scale = 4;
- if (textLength * scale > (width * 0.9F)) {
- scale = (width * 0.9F) / (float) textLength;
+ int drawHeight = 0;
+ String[] splitText = text.split("\n");
+ for (String title : splitText) {
+ int textLength = mc.fontRendererObj.getStringWidth(title);
+
+ double scale = 4;
+ if (textLength * scale > (width * 0.9F)) {
+ scale = (width * 0.9F) / (float) textLength;
+ }
+
+ int titleX = (int) ((width / 2) - (textLength * scale / 2));
+ int titleY = (int) ((height * 0.45) / scale) + (int) (drawHeight * scale);
+ new TextRenderer(mc, title, titleX, titleY, scale);
+ drawHeight += mc.fontRendererObj.FONT_HEIGHT;
}
-
- int titleX = (int) ((width / 2) - (textLength * scale / 2));
- int titleY = (int) ((height * 0.45) / scale);
- new TextRenderer(mc, text, titleX, titleY, scale);
}
public static void checkForSkyblock() {
@@ -275,7 +280,7 @@ public class Utils {
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glLineWidth(2);
- GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue()/ 255f, colour.getAlpha() / 255f);
+ GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f);
worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex();