diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:20:49 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:20:49 -0400 |
commit | c04ca523f9fb9f7adefa74587db61f76deeae9f0 (patch) | |
tree | f148e7bcd9105813d3fe781badcb2cf3892712fd /src/main/java/com/thatgravyboat/skyblockhud/overlay | |
parent | a8e475fa0a7977f64f072548459d592274169d66 (diff) | |
download | skyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.gz skyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.bz2 skyblockhud-c04ca523f9fb9f7adefa74587db61f76deeae9f0.zip |
Increase line width
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay')
4 files changed, 77 insertions, 417 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java index 9d8556d..b4eb8db 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java @@ -24,40 +24,21 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class DungeonOverlay extends Gui { - private static final FontRenderer font = Minecraft.getMinecraft() - .fontRendererObj; + private static final FontRenderer font = Minecraft.getMinecraft().fontRendererObj; private static boolean bossBarVisible = false; - public void drawDungeonPlayer( - String name, - int health, - boolean isDead, - Classes dungeonClass, - int x, - int y - ) { + public void drawDungeonPlayer(String name, int health, boolean isDead, Classes dungeonClass, int x, int y) { if (!SkyblockHud.config.dungeon.hideDeadDungeonPlayers || !isDead) { GlStateManager.enableBlend(); Minecraft mc = Minecraft.getMinecraft(); mc.renderEngine.bindTexture(GuiTextures.dungeon); String healthString = isDead ? "DEAD" : Integer.toString(health); - GlStateManager.color( - 1.0F, - 1.0F, - 1.0F, - (float) SkyblockHud.config.dungeon.dungeonPlayerOpacity / 100 - ); + GlStateManager.color(1.0F, 1.0F, 1.0F, (float) SkyblockHud.config.dungeon.dungeonPlayerOpacity / 100); drawTexturedModalRect(x, y, 0, dungeonClass.getTextureY(), 120, 32); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); drawString(font, name, x + 50, y + 6, 0xFFFFFF); - drawString( - font, - healthString, - x + 50, - y + font.FONT_HEIGHT + 9, - 0xFF2B2B - ); + drawString(font, healthString, x + 50, y + font.FONT_HEIGHT + 9, 0xFF2B2B); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); } } @@ -69,50 +50,15 @@ public class DungeonOverlay extends Gui { int dungeonTime = DungeonHandler.getDungeonTime(); int dungeonTimeMin = dungeonTime / 60; int dungeonTimeSec = dungeonTime - dungeonTimeMin * 60; - drawTexturedModalRect( - (width / 2) - 17, - offset + (bossBarVisible ? 17 : 0), - 0, - 0, - 34, - 34 - ); + drawTexturedModalRect((width / 2) - 17, offset + (bossBarVisible ? 17 : 0), 0, 0, 34, 34); mc.renderEngine.bindTexture(GuiTextures.dungeon); - drawTexturedModalRect( - (width / 2) - 7, - offset + (bossBarVisible ? 20 : 3), - 16, - 50, - 3, - 8 - ); - drawTexturedModalRect( - (width / 2) - 7, - offset + (bossBarVisible ? 30 : 13), - 19, - 50, - 3, - 8 - ); + drawTexturedModalRect((width / 2) - 7, offset + (bossBarVisible ? 20 : 3), 16, 50, 3, 8); + drawTexturedModalRect((width / 2) - 7, offset + (bossBarVisible ? 30 : 13), 19, 50, 3, 8); String dungeonTimeElapsed = - ( - dungeonTimeMin > 9 - ? String.valueOf(dungeonTimeMin) - : "0" + dungeonTimeMin - ) + + (dungeonTimeMin > 9 ? String.valueOf(dungeonTimeMin) : "0" + dungeonTimeMin) + ":" + - ( - dungeonTimeSec > 9 - ? String.valueOf(dungeonTimeSec) - : "0" + dungeonTimeSec - ); - drawCenteredString( - font, - dungeonTimeElapsed, - (width / 2), - offset + (bossBarVisible ? 40 : 23), - 0xFFFF55 - ); + (dungeonTimeSec > 9 ? String.valueOf(dungeonTimeSec) : "0" + dungeonTimeSec); + drawCenteredString(font, dungeonTimeElapsed, (width / 2), offset + (bossBarVisible ? 40 : 23), 0xFFFF55); //KEYS drawString( font, @@ -134,11 +80,7 @@ public class DungeonOverlay extends Gui { int clearPercent = DungeonHandler.getDungeonCleared(); String clearPercentage = "Dungeon Cleared: \u00A7" + - ( - clearPercent <= 20 - ? "4" - : clearPercent <= 50 ? "6" : clearPercent <= 80 ? "e" : "a" - ) + + (clearPercent <= 20 ? "4" : clearPercent <= 50 ? "6" : clearPercent <= 80 ? "e" : "a") + clearPercent + "%"; drawTexturedModalRect( @@ -157,13 +99,7 @@ public class DungeonOverlay extends Gui { 4, 14 ); - drawString( - font, - clearPercentage, - (width / 2) + 18, - offset + (bossBarVisible ? 23 : 6), - 0xAAAAAA - ); + drawString(font, clearPercentage, (width / 2) + 18, offset + (bossBarVisible ? 23 : 6), 0xAAAAAA); //DEATHS GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -186,13 +122,7 @@ public class DungeonOverlay extends Gui { 4, 14 ); - drawString( - font, - deathText, - (width / 2) + 18, - offset + (bossBarVisible ? 38 : 21), - 0xAAAAAA - ); + drawString(font, deathText, (width / 2) + 18, offset + (bossBarVisible ? 38 : 21), 0xAAAAAA); //SECRETS GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -200,14 +130,7 @@ public class DungeonOverlay extends Gui { int maxSecrets = DungeonHandler.getMaxSecrets(); int secrets = DungeonHandler.getSecrets(); int totalSecrets = DungeonHandler.getTotalSecrets(); - String secretsText = - "Secrets: " + - secrets + - "/" + - maxSecrets + - " (" + - totalSecrets + - ")"; + String secretsText = "Secrets: " + secrets + "/" + maxSecrets + " (" + totalSecrets + ")"; drawTexturedModalRect( (width / 2) - 17 - (font.getStringWidth(secretsText)) - 4, offset + (bossBarVisible ? 20 : 3), @@ -295,9 +218,7 @@ public class DungeonOverlay extends Gui { ) ) { bossBarVisible = - BossStatus.statusBarTime > 0 && - GuiIngameForge.renderBossHealth && - BossbarHandler.bossBarRendered; + BossStatus.statusBarTime > 0 && GuiIngameForge.renderBossHealth && BossbarHandler.bossBarRendered; GlStateManager.enableBlend(); drawUltimateBar(mc, event.resolution); @@ -310,19 +231,8 @@ public class DungeonOverlay extends Gui { SkyblockHud.config.dungeon.dungeonPlayer3, SkyblockHud.config.dungeon.dungeonPlayer4 }; - for ( - int i = 0; - i < - Math.min( - DungeonHandler.getDungeonPlayers().values().size(), - 4 - ); - i++ - ) { - DungeonPlayer player = (DungeonPlayer) DungeonHandler - .getDungeonPlayers() - .values() - .toArray()[i]; + for (int i = 0; i < Math.min(DungeonHandler.getDungeonPlayers().values().size(), 4); i++) { + DungeonPlayer player = (DungeonPlayer) DungeonHandler.getDungeonPlayers().values().toArray()[i]; int posX; int posY; try { @@ -347,10 +257,7 @@ public class DungeonOverlay extends Gui { } drawDungeonClock( event.resolution.getScaledWidth(), - SkyblockHud.config.main.mainHudPos.getAbsY( - event.resolution, - 34 - ), + SkyblockHud.config.main.mainHudPos.getAbsY(event.resolution, 34), mc ); } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java index 45fd243..b249362 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java @@ -22,9 +22,7 @@ public class GenericOverlays extends Gui { ) { if (SkyblockHud.hasSkyblockScoreboard()) { mc.renderEngine.bindTexture(GuiTextures.bars); - Color color = new Color( - percentage == max ? fullColor : loadingColor - ); + Color color = new Color(percentage == max ? fullColor : loadingColor); RenderUtils.drawTexturedModalRect(x, y, 0, 0, 182, 5); GlStateManager.color( @@ -34,23 +32,9 @@ public class GenericOverlays extends Gui { color.getAlpha() / 255f ); RenderUtils.drawTexturedModalRect(x, y, 0, 30, 182, 5); - RenderUtils.drawTexturedModalRect( - x, - y, - 0, - 5, - (int) (182 * percentage), - 5 - ); + RenderUtils.drawTexturedModalRect(x, y, 0, 5, (int) (182 * percentage), 5); if (barStyle != 0) { - RenderUtils.drawTexturedModalRect( - x, - y, - 0, - 5 + (barStyle * 5), - 182, - 5 - ); + RenderUtils.drawTexturedModalRect(x, y, 0, 5 + (barStyle * 5), 182, 5); } } } @@ -67,9 +51,7 @@ public class GenericOverlays extends Gui { ) { if (SkyblockHud.hasSkyblockScoreboard()) { mc.renderEngine.bindTexture(GuiTextures.bars); - Color color = new Color( - percentage == max ? fullColor : loadingColor - ); + Color color = new Color(percentage == max ? fullColor : loadingColor); GlStateManager.enableBlend(); RenderUtils.drawTexturedModalRect(x, y, 0, 35, 62, 5); GlStateManager.color( @@ -79,23 +61,9 @@ public class GenericOverlays extends Gui { color.getAlpha() / 255f ); RenderUtils.drawTexturedModalRect(x, y, 0, 65, 62, 5); - RenderUtils.drawTexturedModalRect( - x, - y, - 0, - 40, - (int) (62 * percentage), - 5 - ); + RenderUtils.drawTexturedModalRect(x, y, 0, 40, (int) (62 * percentage), 5); if (barStyle != 0) { - RenderUtils.drawTexturedModalRect( - x, - y, - 0, - 45 + (barStyle * 5), - 62, - 5 - ); + RenderUtils.drawTexturedModalRect(x, y, 0, 45 + (barStyle * 5), 62, 5); } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java index cba60eb..5560ff7 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java @@ -25,8 +25,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class OverlayHud extends Gui { - private static final FontRenderer font = Minecraft.getMinecraft() - .fontRendererObj; + private static final FontRenderer font = Minecraft.getMinecraft().fontRendererObj; //STATS private static boolean eventToggle; @@ -41,8 +40,7 @@ public class OverlayHud extends Gui { int timeMin = (int) (TimeHandler.time / 60); int timeHour = timeMin / 60; timeMin = timeMin - (timeHour * 60); - String militaryTime = - timeHour + ":" + (timeMin == 0 ? timeMin + "0" : timeMin); + String militaryTime = timeHour + ":" + (timeMin == 0 ? timeMin + "0" : timeMin); int time12Hour = timeHour >= 12 ? timeHour - 12 : timeHour; String normalTime = (time12Hour == 0 ? "00" : String.valueOf(time12Hour)) + @@ -50,14 +48,7 @@ public class OverlayHud extends Gui { (timeMin == 0 ? "00" : timeMin) + (timeHour >= 12 ? "pm" : "am"); - drawTexturedModalRect( - (width / 2) - 17, - offset + (bossBarVisible ? 17 : 0), - 0, - 0, - 34, - 34 - ); + drawTexturedModalRect((width / 2) - 17, offset + (bossBarVisible ? 17 : 0), 0, 0, 34, 34); drawTexturedModalRect( (width / 2) - 4, offset + (bossBarVisible ? 24 : 7), @@ -94,43 +85,20 @@ public class OverlayHud extends Gui { //EXTRA SLOT if (LocationHandler.getCurrentLocation().equals(Locations.YOURISLAND)) { - if (IslandHandler.flightTime > 0) drawFlightDuration( - width, - offset, - mc - ); - } else if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.MUSHROOMDESERT) - ) { + if (IslandHandler.flightTime > 0) drawFlightDuration(width, offset, mc); + } else if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.MUSHROOMDESERT)) { drawTrapperOrPelts(width, offset, mc); - } else if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.DWARVENMINES) - ) { - if ( - DwarvenMineHandler.currentEvent != DwarvenMineHandler.Event.NONE - ) { + } else if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.DWARVENMINES)) { + if (DwarvenMineHandler.currentEvent != DwarvenMineHandler.Event.NONE) { drawDwarvenEvent(width, offset, mc); } else { drawMithril(width, offset, mc); } } else if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.PARK) && + LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.PARK) && ParkIslandHandler.isRaining() ) { - if ( - LocationHandler - .getCurrentLocation() - .equals(Locations.HOWLINGCAVE) - ) { + if (LocationHandler.getCurrentLocation().equals(Locations.HOWLINGCAVE)) { drawSlayer(width, offset, mc); } else drawRainDuration(width, offset, mc); } else if (SlayerHandler.isDoingSlayer) { @@ -141,9 +109,7 @@ public class OverlayHud extends Gui { public void drawSeasonAndDate(int width, int offset, Minecraft mc) { if (SeasonDateHandler.getCurrentSeason() != Season.ERROR) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - if ( - mc.thePlayer.ticksExisted % 100 == 0 && eventToggle - ) eventToggle = false; + if (mc.thePlayer.ticksExisted % 100 == 0 && eventToggle) eventToggle = false; if (mc.thePlayer.ticksExisted % 600 == 0) eventToggle = true; mc.renderEngine.bindTexture(GuiTextures.overlay); String dateText = SeasonDateHandler.getFancySeasonAndDate(); @@ -152,9 +118,7 @@ public class OverlayHud extends Gui { !SeasonDateHandler.getCurrentEvent().isEmpty() && !SeasonDateHandler.getCurrentEventTime().isEmpty() ) dateText = - SeasonDateHandler.getCurrentEvent().trim() + - " " + - SeasonDateHandler.getCurrentEventTime().trim(); + SeasonDateHandler.getCurrentEvent().trim() + " " + SeasonDateHandler.getCurrentEventTime().trim(); drawTexturedModalRect( (width / 2) + 17, offset + (bossBarVisible ? 20 : 3), @@ -179,13 +143,7 @@ public class OverlayHud extends Gui { 8, 8 ); - drawString( - font, - dateText, - (width / 2) + 18, - offset + (bossBarVisible ? 23 : 6), - 0xffffff - ); + drawString(font, dateText, (width / 2) + 18, offset + (bossBarVisible ? 23 : 6), 0xffffff); } } @@ -193,13 +151,7 @@ public class OverlayHud extends Gui { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); drawTexturedModalRect( - (width / 2) - - 33 - - ( - font.getStringWidth( - LocationHandler.getCurrentLocation().getDisplayName() - ) - ), + (width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())), offset + (bossBarVisible ? 20 : 3), 0, 34, @@ -207,36 +159,15 @@ public class OverlayHud extends Gui { 14 ); drawTexturedModalRect( - ( - (width / 2) - - 33 - - ( - font.getStringWidth( - LocationHandler.getCurrentLocation().getDisplayName() - ) - ) - ) + - 2, + ((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 2, offset + (bossBarVisible ? 20 : 3), 2, 34, - font.getStringWidth( - LocationHandler.getCurrentLocation().getDisplayName() - ) + - 14, + font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()) + 14, 14 ); drawTexturedModalRect( - ( - (width / 2) - - 33 - - ( - font.getStringWidth( - LocationHandler.getCurrentLocation().getDisplayName() - ) - ) - ) + - 4, + ((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 4, offset + (bossBarVisible ? 23 : 6), LocationHandler.getCurrentLocation().getCategory().getTexturePos(), 8, @@ -246,13 +177,7 @@ public class OverlayHud extends Gui { drawString( font, LocationHandler.getCurrentLocation().getDisplayName(), - (width / 2) - - 19 - - ( - font.getStringWidth( - LocationHandler.getCurrentLocation().getDisplayName() - ) - ), + (width / 2) - 19 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())), offset + (bossBarVisible ? 23 : 6), 0xFFFFFF ); @@ -263,29 +188,10 @@ public class OverlayHud extends Gui { mc.renderEngine.bindTexture(GuiTextures.overlay); int redstoneColor = IslandHandler.redstone > 90 ? 0xFF0000 - : IslandHandler.redstone > 75 - ? 0xC45B00 - : IslandHandler.redstone > 50 ? 0xFFFF55 : 0x55FF55; - if ( - IslandHandler.redstone > 0 && - Utils.isPlayerHoldingRedstone(mc.thePlayer) - ) { - drawTexturedModalRect( - (width / 2) - 15, - offset + (bossBarVisible ? 51 : 34), - 0, - 48, - 30, - 18 - ); - drawTexturedModalRect( - (width / 2) - 4, - offset + (bossBarVisible ? 51 : 34), - 59, - 0, - 8, - 8 - ); + : IslandHandler.redstone > 75 ? 0xC45B00 : IslandHandler.redstone > 50 ? 0xFFFF55 : 0x55FF55; + if (IslandHandler.redstone > 0 && Utils.isPlayerHoldingRedstone(mc.thePlayer)) { + drawTexturedModalRect((width / 2) - 15, offset + (bossBarVisible ? 51 : 34), 0, 48, 30, 18); + drawTexturedModalRect((width / 2) - 4, offset + (bossBarVisible ? 51 : 34), 59, 0, 8, 8); drawCenteredString( mc.fontRendererObj, IslandHandler.redstone + "%", @@ -310,21 +216,8 @@ public class OverlayHud extends Gui { font.getStringWidth(CurrencyHandler.getCoinsFormatted()) + 11, 14 ); - drawTexturedModalRect( - xPos + 1, - offset + (bossBarVisible ? 37 : 20), - 34, - 0, - 8, - 8 - ); - drawString( - font, - CurrencyHandler.getCoinsFormatted(), - xPos + 10, - offset + (bossBarVisible ? 38 : 21), - 0xFFAA00 - ); + drawTexturedModalRect(xPos + 1, offset + (bossBarVisible ? 37 : 20), 34, 0, 8, 8); + drawString(font, CurrencyHandler.getCoinsFormatted(), xPos + 10, offset + (bossBarVisible ? 38 : 21), 0xFFAA00); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); xPos += font.getStringWidth(CurrencyHandler.getCoinsFormatted()) + 11; @@ -339,14 +232,7 @@ public class OverlayHud extends Gui { font.getStringWidth(CurrencyHandler.getBitsFormatted()) + 11, 14 ); - drawTexturedModalRect( - xPos + 1, - offset + (bossBarVisible ? 37 : 20), - 75, - 0, - 8, - 8 - ); + drawTexturedModalRect(xPos + 1, offset + (bossBarVisible ? 37 : 20), 75, 0, 8, 8); drawString( font, CurrencyHandler.getBitsFormatted(), @@ -356,40 +242,25 @@ public class OverlayHud extends Gui { ); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); - xPos += - font.getStringWidth(CurrencyHandler.getBitsFormatted()) + 11; + xPos += font.getStringWidth(CurrencyHandler.getBitsFormatted()) + 11; } - drawTexturedModalRect( - xPos, - offset + (bossBarVisible ? 35 : 18), - 252, - 34, - 4, - 14 - ); + drawTexturedModalRect(xPos, offset + (bossBarVisible ? 35 : 18), 252, 34, 4, 14); } public void drawFlightDuration(int width, int offset, Minecraft mc) { if (LocationHandler.getCurrentLocation().equals(Locations.YOURISLAND)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - DecimalFormat flightFormat = new DecimalFormat( - "#.#", - DecimalFormatSymbols.getInstance(Locale.CANADA) - ); + DecimalFormat flightFormat = new DecimalFormat("#.#", DecimalFormatSymbols.getInstance(Locale.CANADA)); String duration; - if (IslandHandler.flightTime < 60) duration = - IslandHandler.flightTime + "s"; else if ( + if (IslandHandler.flightTime < 60) duration = IslandHandler.flightTime + "s"; else if ( IslandHandler.flightTime < 3600 - ) duration = - flightFormat.format((double) IslandHandler.flightTime / 60) + - "m"; else if (IslandHandler.flightTime < 86400) duration = - flightFormat.format((double) IslandHandler.flightTime / 3600) + - "hr"; else if (IslandHandler.flightTime < 86460) duration = - flightFormat.format((double) IslandHandler.flightTime / 86400) + - "day"; else duration = - flightFormat.format((double) IslandHandler.flightTime / 86400) + - "days"; + ) duration = flightFormat.format((double) IslandHandler.flightTime / 60) + "m"; else if ( + IslandHandler.flightTime < 86400 + ) duration = flightFormat.format((double) IslandHandler.flightTime / 3600) + "hr"; else if ( + IslandHandler.flightTime < 86460 + ) duration = flightFormat.format((double) IslandHandler.flightTime / 86400) + "day"; else duration = + flightFormat.format((double) IslandHandler.flightTime / 86400) + "days"; mc.renderEngine.bindTexture(GuiTextures.overlay); drawTexturedModalRect( (width / 2) - 33 - (font.getStringWidth(duration)), @@ -426,12 +297,7 @@ public class OverlayHud extends Gui { } public void drawRainDuration(int width, int offset, Minecraft mc) { - if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.PARK) - ) { + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.PARK)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); String duration = "Rain: " + ParkIslandHandler.getRainTime(); @@ -536,12 +402,7 @@ public class OverlayHud extends Gui { } public void drawMithril(int width, int offset, Minecraft mc) { - if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.DWARVENMINES) - ) { + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.DWARVENMINES)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); String mithril = DwarvenMineHandler.getMithrilFormatted(); @@ -580,12 +441,7 @@ public class OverlayHud extends Gui { } public void drawTrapperOrPelts(int width, int offset, Minecraft mc) { - if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.MUSHROOMDESERT) - ) { + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.MUSHROOMDESERT)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); String duration = FarmingIslandHandler.location != Locations.NONE @@ -626,19 +482,11 @@ public class OverlayHud extends Gui { } public void drawDwarvenEvent(int width, int offset, Minecraft mc) { - if ( - LocationHandler - .getCurrentLocation() - .getCategory() - .equals(LocationCategory.DWARVENMINES) - ) { + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.DWARVENMINES)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); if (DwarvenMineHandler.eventMax > 0) { - String duration = - DwarvenMineHandler.eventProgress + - "/" + - DwarvenMineHandler.eventMax; + String duration = DwarvenMineHandler.eventProgress + "/" + DwarvenMineHandler.eventMax; drawTexturedModalRect( (width / 2) - 33 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 35 : 18), @@ -709,25 +557,15 @@ public class OverlayHud extends Gui { @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { - if ( - Utils.overlayShouldRender( - event.type, - SkyblockHud.hasSkyblockScoreboard() - ) - ) { + if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard())) { bossBarVisible = - BossStatus.statusBarTime > 0 && - GuiIngameForge.renderBossHealth && - BossbarHandler.bossBarRendered; + BossStatus.statusBarTime > 0 && GuiIngameForge.renderBossHealth && BossbarHandler.bossBarRendered; Minecraft mc = Minecraft.getMinecraft(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (LocationHandler.getCurrentLocation() != Locations.CATACOMBS) { drawClock( event.resolution.getScaledWidth(), - SkyblockHud.config.main.mainHudPos.getAbsY( - event.resolution, - 34 - ), + SkyblockHud.config.main.mainHudPos.getAbsY(event.resolution, 34), mc ); } @@ -735,21 +573,9 @@ public class OverlayHud extends Gui { } } - public void drawScaledString( - float factor, - int x, - int y, - String text, - int color - ) { + public void drawScaledString(float factor, int x, int y, String text, int color) { GlStateManager.scale(factor, factor, 1); - drawCenteredString( - font, - text, - (int) (x / factor), - (int) (y / factor), - color - ); + drawCenteredString(font, text, (int) (x / factor), (int) (y / factor), color); GlStateManager.scale(1 / factor, 1 / factor, 1); } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java index 885ff7a..dce51a9 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java @@ -40,15 +40,10 @@ public class RPGHud extends Gui { } public static void manaPredictionUpdate(boolean isIncrease, int decrease) { - mana = - isIncrease - ? Math.min(mana + (maxMana / 50), maxMana) - : mana - decrease; + mana = isIncrease ? Math.min(mana + (maxMana / 50), maxMana) : mana - decrease; } - private static final DecimalFormat decimalFormat = new DecimalFormat( - "#.##" - ); + private static final DecimalFormat decimalFormat = new DecimalFormat("#.##"); static { decimalFormat.setGroupingUsed(true); @@ -65,10 +60,7 @@ public class RPGHud extends Gui { ) ) MinecraftForge.EVENT_BUS.post( new RenderGameOverlayEvent.Post( - new RenderGameOverlayEvent( - event.partialTicks, - event.resolution - ), + new RenderGameOverlayEvent(event.partialTicks, event.resolution), RenderGameOverlayEvent.ElementType.EXPERIENCE ) ); @@ -84,17 +76,7 @@ public class RPGHud extends Gui { GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); FontRenderer font = mc.fontRendererObj; if (mc.thePlayer.getHealth() < mc.thePlayer.getMaxHealth()) { - health = - Math.max( - (int) ( - maxHealth * - ( - mc.thePlayer.getHealth() / - mc.thePlayer.getMaxHealth() - ) - ), - health - ); + health = Math.max((int) (maxHealth * (mc.thePlayer.getHealth() / mc.thePlayer.getMaxHealth())), health); } mc.renderEngine.bindTexture(GuiTextures.playerStat); @@ -107,10 +89,7 @@ public class RPGHud extends Gui { drawTexturedModalRect(x, y, rightAligned ? 131 : 5, 6, 120, 47); - float manaWidth = Math.min( - 57 * ((float) mana / (float) maxMana), - 57 - ); + float manaWidth = Math.min(57 * ((float) mana / (float) maxMana), 57); drawTexturedModalRect( rightAligned ? x + 16 : 47 + x, 17 + y, @@ -120,10 +99,7 @@ public class RPGHud extends Gui { 4 ); - float healthWidth = Math.min( - 70 * ((float) health / (float) maxHealth), - 70 - ); + float healthWidth = Math.min(70 * ((float) health / (float) maxHealth), 70); drawTexturedModalRect( rightAligned ? x + 3 : 47 + x, 22 + y, @@ -134,10 +110,7 @@ public class RPGHud extends Gui { ); if (health > maxHealth) { - float absorptionWidth = Math.min( - 70 * ((float) (health - maxHealth) / (float) maxHealth), - 70 - ); + float absorptionWidth = Math.min(70 * ((float) (health - maxHealth) / (float) maxHealth), 70); drawTexturedModalRect( rightAligned ? x + 3 : 47 + x, 22 + y, @@ -149,27 +122,13 @@ public class RPGHud extends Gui { } float xpWidth = 67 * mc.thePlayer.experience; - drawTexturedModalRect( - rightAligned ? x + 7 : 45 + x, - 28 + y, - rightAligned ? 189 : 0, - 73, - (int) xpWidth, - 4 - ); + drawTexturedModalRect(rightAligned ? x + 7 : 45 + x, 28 + y, rightAligned ? 189 : 0, 73, (int) xpWidth, 4); //Air in water NumberFormat myFormat = NumberFormat.getInstance(); myFormat.setGroupingUsed(true); if (mc.thePlayer.getAir() < 300) { float airWidth = 60 * ((float) mc.thePlayer.getAir() / 300); - drawTexturedModalRect( - rightAligned ? x + 17 : 39 + x, - 33 + y, - rightAligned ? 192 : 0, - 82, - 64, - 6 - ); + drawTexturedModalRect(rightAligned ? x + 17 : 39 + x, 33 + y, rightAligned ? 192 : 0, 82, 64, 6); drawTexturedModalRect( rightAligned ? x + 19 : 41 + x, 33 + y, |