diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers')
10 files changed, 81 insertions, 332 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java index 0338195..6f06f40 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java @@ -16,10 +16,7 @@ public class BossbarHandler { @SubscribeEvent(priority = EventPriority.LOWEST) public void onBossbarRender(RenderGameOverlayEvent.Pre event) { - if ( - event.type == RenderGameOverlayEvent.ElementType.BOSSHEALTH && - BossStatus.bossName != null - ) { + if (event.type == RenderGameOverlayEvent.ElementType.BOSSHEALTH && BossStatus.bossName != null) { bossBarRendered = !event.isCanceled(); if (!SkyblockHud.config.main.bossShiftHud) { bossBarRendered = false; @@ -27,11 +24,8 @@ public class BossbarHandler { String bossName = Utils.removeColor(BossStatus.bossName); if ( SkyblockHud.config.renderer.hideBossBar && - DwarvenMineHandler.currentEvent == - DwarvenMineHandler.Event.NONE && - !LocationHandler - .getCurrentLocation() - .equals(Locations.CATACOMBS) + DwarvenMineHandler.currentEvent == DwarvenMineHandler.Event.NONE && + !LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS) ) { if (bossName.equalsIgnoreCase("wither")) { event.setCanceled(true); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java index ea0ccca..847b6c7 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java @@ -35,19 +35,13 @@ public class CurrencyHandler { @SubscribeEvent public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { if ( - Utils - .removeColor(event.formattedLine.toLowerCase().trim()) - .contains("purse:") || - Utils - .removeColor(event.formattedLine.toLowerCase().trim()) - .contains("piggy:") + Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("purse:") || + Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("piggy:") ) { CurrencyHandler.checkCoins(event.formattedLine); } if ( - Utils - .removeColor(event.formattedLine.toLowerCase().trim()) - .contains("bits:") && + Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("bits:") && !event.formattedLine.toLowerCase().contains("(") ) { CurrencyHandler.checkBits(event.formattedLine); @@ -56,81 +50,50 @@ public class CurrencyHandler { @SubscribeEvent public void onSidebarPost(SidebarPostEvent event) { - if ( - !Arrays.toString(event.arrayScores).toLowerCase().contains("bits:") - ) { + if (!Arrays.toString(event.arrayScores).toLowerCase().contains("bits:")) { CurrencyHandler.setBits(0); } } public static String getCoinsFormatted() { - DecimalFormat formatter = new DecimalFormat( - "#,###.0", - DecimalFormatSymbols.getInstance(Locale.CANADA) - ); + DecimalFormat formatter = new DecimalFormat("#,###.0", DecimalFormatSymbols.getInstance(Locale.CANADA)); String output = formatter.format(coins); - if (output.equals(".0")) output = "0.0"; else if ( - output.equals(",0") - ) output = "0,0"; + if (output.equals(".0")) output = "0.0"; else if (output.equals(",0")) output = "0,0"; return output; } public static String getBitsFormatted() { - DecimalFormat formatter = new DecimalFormat( - "#.#", - DecimalFormatSymbols.getInstance(Locale.CANADA) - ); + DecimalFormat formatter = new DecimalFormat("#.#", DecimalFormatSymbols.getInstance(Locale.CANADA)); formatter.setRoundingMode(RoundingMode.FLOOR); - return bits > 999 - ? formatter.format((double) bits / 1000) + "k" - : String.valueOf(bits); + return bits > 999 ? formatter.format((double) bits / 1000) + "k" : String.valueOf(bits); } public static void checkCoins(String formatedScoreboardLine) { String purse = Utils .removeWhiteSpaceAndRemoveWord( Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), - Utils - .removeColor( - formatedScoreboardLine.toLowerCase().trim() - ) - .contains("purse:") - ? "purse:" - : "piggy:" + Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()).contains("purse:") ? "purse:" : "piggy:" ) .replace(",", ""); if (!purse.contains("(") && !purse.contains("+")) { try { - double coins = Double.parseDouble( - Pattern.compile("[^0-9.]").matcher(purse).replaceAll("") - ); + double coins = Double.parseDouble(Pattern.compile("[^0-9.]").matcher(purse).replaceAll("")); CurrencyHandler.setCoins(coins); } catch (IllegalArgumentException ex) { - System.out.println( - "Failed to parse purse, please report to ThatGravyBoat. Purse Text: " + - purse - ); + System.out.println("Failed to parse purse, please report to ThatGravyBoat. Purse Text: " + purse); } } } public static void checkBits(String formatedScoreboardLine) { String bits = Utils - .removeWhiteSpaceAndRemoveWord( - Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), - "bits:" - ) + .removeWhiteSpaceAndRemoveWord(Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), "bits:") .replace(",", ""); try { - int bit = Integer.parseInt( - Pattern.compile("[^0-9]").matcher(bits).replaceAll("") - ); + int bit = Integer.parseInt(Pattern.compile("[^0-9]").matcher(bits).replaceAll("")); CurrencyHandler.setBits(bit); } catch (IllegalArgumentException ex) { - System.out.println( - "Failed to parse bits, please report to ThatGravyBoat. Bits Text: " + - bits - ); + System.out.println("Failed to parse bits, please report to ThatGravyBoat. Bits Text: " + bits); } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java index e7686d2..fa0d21c 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java @@ -13,21 +13,10 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class HeldItemHandler extends Gui { public void drawFuelBar(Minecraft mc, int current, int max) { - GenericOverlays.drawSmallBar( - mc, - 100, - 100, - (double) current / (double) max, - 1.0d, - 0xff00ff, - 0xffff00, - 0 - ); + GenericOverlays.drawSmallBar(mc, 100, 100, (double) current / (double) max, 1.0d, 0xff00ff, 0xffff00, 0); drawString( mc.fontRendererObj, - "Fuel - " + - Math.round(((double) current / (double) max) * 100) + - "%", + "Fuel - " + Math.round(((double) current / (double) max) * 100) + "%", 100, 100, 0xffffff @@ -37,16 +26,11 @@ public class HeldItemHandler extends Gui { public boolean isDrill(ItemStack stack) { if (stack == null) return false; if (!stack.getTagCompound().hasKey("ExtraAttributes")) return false; - return stack - .getTagCompound() - .getCompoundTag("ExtraAttributes") - .hasKey("drill_fuel"); + return stack.getTagCompound().getCompoundTag("ExtraAttributes").hasKey("drill_fuel"); } public String getDrillFuel(ItemStack stack) { - NBTTagCompound display = stack - .getTagCompound() - .getCompoundTag("display"); + NBTTagCompound display = stack.getTagCompound().getCompoundTag("display"); NBTTagList lore = display.getTagList("Lore", 8); for (int i = lore.tagCount() - 1; i >= 0; i--) { String line = Utils.removeColor(lore.getStringTagAt(i)); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java index ab618af..5bc90d8 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java @@ -44,22 +44,11 @@ public class MapHandler { public String command; public MapIconTypes type; - public MapIcon( - Vector2f pos, - ResourceLocation icon, - String tooltip, - MapIconTypes type - ) { + public MapIcon(Vector2f pos, ResourceLocation icon, String tooltip, MapIconTypes type) { this(pos, icon, tooltip, type, ""); } - public MapIcon( - Vector2f pos, - ResourceLocation icon, - String tooltip, - MapIconTypes type, - String command - ) { + public MapIcon(Vector2f pos, ResourceLocation icon, String tooltip, MapIconTypes type, String command) { this.position = pos; this.icon = icon; this.tooltip = tooltip; @@ -69,32 +58,16 @@ public class MapHandler { public boolean canRender() { SBHConfig.Map mapConfig = SkyblockHud.config.map; - if ( - mapConfig.showInfoIcons && type.equals(MapIconTypes.INFO) - ) return true; else if ( + if (mapConfig.showInfoIcons && type.equals(MapIconTypes.INFO)) return true; else if ( mapConfig.showMiscIcons && type.equals(MapIconTypes.MISC) - ) return true; else if ( - mapConfig.showNpcIcons && type.equals(MapIconTypes.NPC) - ) return true; else if ( + ) return true; else if (mapConfig.showNpcIcons && type.equals(MapIconTypes.NPC)) return true; else if ( mapConfig.showQuestIcons && type.equals(MapIconTypes.QUEST) - ) return true; else return ( - mapConfig.showShopIcons && type.equals(MapIconTypes.SHOPS) - ); + ) return true; else return (mapConfig.showShopIcons && type.equals(MapIconTypes.SHOPS)); } } public enum Maps { - HUB( - 0.5f, - 494, - 444, - 294, - 218, - 294, - 224, - new ResourceLocation("skyblockhud", "maps/hub.png"), - HubIcons.hubIcons - ), + HUB(0.5f, 494, 444, 294, 218, 294, 224, new ResourceLocation("skyblockhud", "maps/hub.png"), HubIcons.hubIcons), MUSHROOM( 1.0f, 318, @@ -206,15 +179,9 @@ public class MapHandler { ) { Minecraft mc = Minecraft.getMinecraft(); if (mc.currentScreen instanceof MapScreen) return; - if ( - LocationHandler.getCurrentLocation().getCategory().getMap() == - null - ) return; + if (LocationHandler.getCurrentLocation().getCategory().getMap() == null) return; if (mc.thePlayer != null) { - MapHandler.Maps map = LocationHandler - .getCurrentLocation() - .getCategory() - .getMap(); + MapHandler.Maps map = LocationHandler.getCurrentLocation().getCategory().getMap(); mc.renderEngine.bindTexture(mapOverlay); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); Position pos = SkyblockHud.config.map.miniMapPosition; @@ -235,16 +202,8 @@ public class MapHandler { float u = (x / (map.width / 256f)) - 33f; float v = (z / (map.height / 256f)) - 28f; - GL11.glTexParameteri( - GL11.GL_TEXTURE_2D, - GL11.GL_TEXTURE_WRAP_S, - GL11.GL_CLAMP - ); - GL11.glTexParameteri( - GL11.GL_TEXTURE_2D, - GL11.GL_TEXTURE_WRAP_T, - GL11.GL_CLAMP - ); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); Gui.drawModalRectWithCustomSizedTexture( pos.getAbsX(event.resolution, 72) + 4, @@ -279,9 +238,7 @@ public class MapHandler { 256, 256 ); - String keyCode = GameSettings.getKeyDisplayString( - KeyBindings.map.getKeyCode() - ); + String keyCode = GameSettings.getKeyDisplayString(KeyBindings.map.getKeyCode()); Utils.drawStringCenteredScaled( keyCode, mc.fontRendererObj, @@ -292,12 +249,7 @@ public class MapHandler { 0xFFFFFF ); BlockPos playerPos = mc.thePlayer.getPosition(); - String position = String.format( - "%d/%d/%d", - playerPos.getX(), - playerPos.getY(), - playerPos.getZ() - ); + String position = String.format("%d/%d/%d", playerPos.getX(), playerPos.getY(), playerPos.getZ()); Utils.drawStringCenteredScaled( position, mc.fontRendererObj, @@ -316,18 +268,14 @@ public class MapHandler { public void clientTick(TickEvent.ClientTickEvent event) { if ( KeyBindings.map.isPressed() && - LocationHandler.getCurrentLocation().getCategory().getMap() != - null && + LocationHandler.getCurrentLocation().getCategory().getMap() != null && SkyblockHud.hasSkyblockScoreboard() ) SkyblockHud.screenToOpen = new MapScreen(); } public static class MapScreen extends GuiScreen { - public MapHandler.Maps map = LocationHandler - .getCurrentLocation() - .getCategory() - .getMap(); + public MapHandler.Maps map = LocationHandler.getCurrentLocation().getCategory().getMap(); @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { @@ -347,10 +295,7 @@ public class MapHandler { (int) (map.height * map.scaleFactor) ); drawIcons((int) mapX, (int) mapY); - if ( - this.mc.thePlayer != null && - SkyblockHud.config.map.showPlayerLocation - ) { + if (this.mc.thePlayer != null && SkyblockHud.config.map.showPlayerLocation) { int x = this.mc.thePlayer.getPosition().getX() + map.xOffset; int z = this.mc.thePlayer.getPosition().getZ() + map.yOffset; fontRendererObj.drawString( @@ -371,24 +316,9 @@ public class MapHandler { GlStateManager.enableBlend(); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); this.mc.renderEngine.bindTexture(icon.icon); - float x = - ((icon.position.x + map.xOffset) * map.scaleFactor) + - startX - - 4; - float y = - ((icon.position.y + map.yOffset) * map.scaleFactor) + - startY - - 4; - Gui.drawModalRectWithCustomSizedTexture( - (int) x, - (int) y, - 0, - 0, - 8, - 8, - 8, - 8 - ); + float x = ((icon.position.x + map.xOffset) * map.scaleFactor) + startX - 4; + float y = ((icon.position.y + map.yOffset) * map.scaleFactor) + startY - 4; + Gui.drawModalRectWithCustomSizedTexture((int) x, (int) y, 0, 0, 8, 8, 8, 8); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); } } @@ -400,36 +330,16 @@ public class MapHandler { if ( Utils.inRangeInclusive( mouseX, - (int) ( - (icon.position.x + map.xOffset) * map.scaleFactor - ) + - startX - - 4, - (int) ( - (icon.position.x + map.xOffset) * map.scaleFactor - ) + - startX + - 4 + (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + startX - 4, + (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + startX + 4 ) && Utils.inRangeInclusive( mouseY, - (int) ( - (icon.position.y + map.yOffset) * map.scaleFactor - ) + - startY - - 4, - (int) ( - (icon.position.y + map.yOffset) * map.scaleFactor - ) + - startY + - 4 + (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + startY - 4, + (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + startY + 4 ) ) { - drawHoveringText( - Arrays.asList(icon.tooltip.split("\n")), - mouseX, - mouseY - ); + drawHoveringText(Arrays.asList(icon.tooltip.split("\n")), mouseX, mouseY); break; } } @@ -437,40 +347,20 @@ public class MapHandler { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { - int mapX = (int) ( - (width / 2f) - ((map.width / 2f) * map.scaleFactor) - ); - int mapY = (int) ( - (height / 2f) - ((map.height / 2f) * map.scaleFactor) - ); + int mapX = (int) ((width / 2f) - ((map.width / 2f) * map.scaleFactor)); + int mapY = (int) ((height / 2f) - ((map.height / 2f) * map.scaleFactor)); for (MapIcon icon : map.icons) { if (!icon.canRender()) continue; if ( Utils.inRangeInclusive( mouseX, - (int) ( - (icon.position.x + map.xOffset) * map.scaleFactor - ) + - mapX - - 4, - (int) ( - (icon.position.x + map.xOffset) * map.scaleFactor - ) + - mapX + - 4 + (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + mapX - 4, + (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + mapX + 4 ) && Utils.inRangeInclusive( mouseY, - (int) ( - (icon.position.y + map.yOffset) * map.scaleFactor - ) + - mapY - - 4, - (int) ( - (icon.position.y + map.yOffset) * map.scaleFactor - ) + - mapY + - 4 + (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + mapY - 4, + (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + mapY + 4 ) ) { if (!icon.command.isEmpty()) { diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java index 6b2c808..627be26 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java @@ -12,12 +12,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class SlayerHandler { //Optional Characters are required because Hypixel dumb and cuts off text - private static final Pattern COMBAT_XP_REGEX = Pattern.compile( - "\\(([\\d,]+)/([\\dkm]+)\\) comb?a?t? x?p?" - ); - private static final Pattern KILLS_REGEX = Pattern.compile( - "(\\d+)/(\\d+) kills?" - ); + private static final Pattern COMBAT_XP_REGEX = Pattern.compile("\\(([\\d,]+)/([\\dkm]+)\\) comb?a?t? x?p?"); + private static final Pattern KILLS_REGEX = Pattern.compile("(\\d+)/(\\d+) kills?"); public enum slayerTypes { ZOMBIE(34, "Revenant Horror"), @@ -63,32 +59,23 @@ public class SlayerHandler { @SubscribeEvent public void onSidebarPost(SidebarPostEvent event) { String arrayString = Arrays.toString(event.arrayScores); - isDoingSlayer = - Arrays.toString(event.arrayScores).contains("Slayer Quest"); + isDoingSlayer = Arrays.toString(event.arrayScores).contains("Slayer Quest"); if ( isDoingSlayer && ( currentSlayer.equals(slayerTypes.NONE) || !arrayString .replace(" ", "") - .contains( - currentSlayer.getDisplayName().replace(" ", "") + - Utils.intToRomanNumeral(slayerTier) - ) + .contains(currentSlayer.getDisplayName().replace(" ", "") + Utils.intToRomanNumeral(slayerTier)) ) ) { for (int i = 0; i < event.scores.size(); i++) { String line = event.scores.get(i); if (line.contains("Slayer Quest") && event.scores.size() > 3) { String slayer = event.scores.get(i - 1).toLowerCase(); - SlayerHandler.slayerTypes selectedSlayer = - SlayerHandler.slayerTypes.NONE; + SlayerHandler.slayerTypes selectedSlayer = SlayerHandler.slayerTypes.NONE; for (slayerTypes types : slayerTypes.values()) { - if ( - slayer.contains( - types.displayName.toLowerCase(Locale.ENGLISH) - ) - ) { + if (slayer.contains(types.displayName.toLowerCase(Locale.ENGLISH))) { selectedSlayer = types; break; } @@ -96,14 +83,7 @@ public class SlayerHandler { SlayerHandler.currentSlayer = selectedSlayer; SlayerHandler.slayerTier = Utils.whatRomanNumeral( - slayer - .replace( - selectedSlayer - .getDisplayName() - .toLowerCase(), - "" - ) - .replace(" ", "") + slayer.replace(selectedSlayer.getDisplayName().toLowerCase(), "").replace(" ", "") ); break; } @@ -117,9 +97,7 @@ public class SlayerHandler { @SubscribeEvent public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { - if ( - !isDoingSlayer && event.formattedLine.equals("Slayer Quest") - ) isDoingSlayer = true; + if (!isDoingSlayer && event.formattedLine.equals("Slayer Quest")) isDoingSlayer = true; if (isDoingSlayer) { String line = event.formattedLine.toLowerCase(); @@ -144,11 +122,7 @@ public class SlayerHandler { try { maxKills = Integer.parseInt(xpMatcher.group(2).replace("k", "")) * - ( - xpMatcher.group(2).contains("k") - ? 1000 - : xpMatcher.group(2).contains("m") ? 1000000 : 1 - ); + (xpMatcher.group(2).contains("k") ? 1000 : xpMatcher.group(2).contains("m") ? 1000000 : 1); } catch (Exception ignored) {} } else if (line.contains("slay the boss")) { SlayerHandler.bossSlain = false; diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java index 1fc3d3f..91b3835 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java @@ -14,34 +14,17 @@ public class TimeHandler { @SubscribeEvent public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { - if ( - Pattern.matches( - "([0-9]*):([0-9]*)(pm|am)", - event.formattedLine.toLowerCase().trim() - ) - ) { - boolean isPm = event.formattedLine - .toLowerCase() - .trim() - .endsWith("pm"); - SimpleDateFormat parseFormat = new SimpleDateFormat( - "hh:mm a", - Locale.CANADA - ); + if (Pattern.matches("([0-9]*):([0-9]*)(pm|am)", event.formattedLine.toLowerCase().trim())) { + boolean isPm = event.formattedLine.toLowerCase().trim().endsWith("pm"); + SimpleDateFormat parseFormat = new SimpleDateFormat("hh:mm a", Locale.CANADA); String currentTimeString = event.formattedLine .replace(" ", "") .replace(isPm ? "pm" : "am", isPm ? " pm" : " am"); try { time = - ( - parseFormat.parse(currentTimeString).getTime() - - parseFormat.parse("00:00 am").getTime() - ) / - 1000L; + (parseFormat.parse(currentTimeString).getTime() - parseFormat.parse("00:00 am").getTime()) / 1000L; } catch (ParseException ignored) { - LogManager - .getLogger() - .warn("timeformat error: " + currentTimeString); + LogManager.getLogger().warn("timeformat error: " + currentTimeString); } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java index abfbd0e..3ef4179 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java @@ -27,9 +27,7 @@ public class DwarvenIcons { new ComponentBuilder() .nl("Puzzler", new char[] { 'a', 'l' }) .nl("Description", 'l') - .nl( - "The Puzzler gives you a small puzzle each day to solve and" - ) + .nl("The Puzzler gives you a small puzzle each day to solve and") .nl("gives you 1000 mithril powder.") .build(), MapHandler.MapIconTypes.NPC @@ -47,12 +45,8 @@ public class DwarvenIcons { new ComponentBuilder() .nl("King", new char[] { 'a', 'l' }) .nl("Description", 'l') - .nl( - "The King allows you to first start commissions and if you click" - ) - .nl( - "each king which change every skyblock day you will get" - ) + .nl("The King allows you to first start commissions and if you click") + .nl("each king which change every skyblock day you will get") .nl("the King Talisman.") .nl() .apd("Click to open HOTM", new char[] { '6', 'l' }) @@ -67,10 +61,7 @@ public class DwarvenIcons { dwarvenIcons.add( new MapHandler.MapIcon( new Vector2f(4, 8), - new ResourceLocation( - "skyblockhud", - "maps/icons/blacksmith.png" - ), + new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder() .nl("Forge", new char[] { 'a', 'l' }) .nl("Description", 'l') @@ -78,9 +69,7 @@ public class DwarvenIcons { .nl("and fuel your drill.") .nl("NPCS", new char[] { 'c', 'l' }) .nl(" Forger - Allows you to forge special items") - .nl( - " Jotraeline Greatforge - Allows you to refuel your drill." - ) + .nl(" Jotraeline Greatforge - Allows you to refuel your drill.") .nl() .apd("Click to warp", new char[] { '6', 'l' }) .build(), diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java index 2eafaec..4539f35 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java @@ -78,9 +78,7 @@ public class HubIcons { .nl(" Bartender") .nl(" Maddox the slayer") .nl("Description", 'l') - .nl( - "The Tavern is where maddox the slayer is located you can" - ) + .nl("The Tavern is where maddox the slayer is located you can") .nl("start slayer quests with them to unlock") .apd("new items the more slayer bosses you kill.") .build(), @@ -110,10 +108,7 @@ public class HubIcons { hubIcons.add( new MapHandler.MapIcon( new Vector2f(58, -73), - new ResourceLocation( - "skyblockhud", - "maps/icons/fishing_merchant.png" - ), + new ResourceLocation("skyblockhud", "maps/icons/fishing_merchant.png"), new ComponentBuilder() .nl("Fishing Merchant", new char[] { 'a', 'l' }) .nl("Description", 'l') @@ -141,10 +136,7 @@ public class HubIcons { hubIcons.add( new MapHandler.MapIcon( new Vector2f(-4, -128), - new ResourceLocation( - "skyblockhud", - "maps/icons/metal_merchants.png" - ), + new ResourceLocation("skyblockhud", "maps/icons/metal_merchants.png"), new ComponentBuilder() .nl("Blacksmith Merchants", new char[] { 'a', 'l' }) .nl("Merchants", new char[] { 'c', 'l' }) @@ -158,10 +150,7 @@ public class HubIcons { hubIcons.add( new MapHandler.MapIcon( new Vector2f(-30, -120), - new ResourceLocation( - "skyblockhud", - "maps/icons/blacksmith.png" - ), + new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder() .nl("Blacksmith", new char[] { 'a', 'l' }) .nl("NPCS", new char[] { 'c', 'l' }) @@ -170,9 +159,7 @@ public class HubIcons { .nl(" Smithmonger") .nl("Description", 'l') .nl("The Blacksmith lets you reforge your items") - .nl( - "while the Smithmonger allows you to buy reforge stones" - ) + .nl("while the Smithmonger allows you to buy reforge stones") .apd("and Dusk allows you to combine and apply runes.") .build(), MapHandler.MapIconTypes.SHOPS @@ -253,9 +240,7 @@ public class HubIcons { new ComponentBuilder() .nl("Bank", new char[] { 'a', 'l' }) .nl("Description", 'l') - .nl( - "The Bank is where you can store your money on skyblock" - ) + .nl("The Bank is where you can store your money on skyblock") .apd("you can also store some items in the vault.") .build(), MapHandler.MapIconTypes.MISC diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java index f5e7c2f..eda0b6f 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java @@ -17,17 +17,9 @@ public class EntityTypeHelper { .getBaseValue(); if ( maxHealthBase == 13000d || - ( - maxHealthBase == 2000d && - enderman - .getHeldBlockState() - .getBlock() - .equals(Blocks.end_portal_frame) - ) + (maxHealthBase == 2000d && enderman.getHeldBlockState().getBlock().equals(Blocks.end_portal_frame)) ) { - return LocationHandler - .getCurrentLocation() - .equals(Locations.DRAGONSNEST); + return LocationHandler.getCurrentLocation().equals(Locations.DRAGONSNEST); } } return false; diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java index a2b70ef..83c6a70 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java @@ -12,19 +12,14 @@ public class EntityTypeRegistry { private static final Map<Class<? extends Entity>, List<SkyBlockEntity>> entities = Maps.newHashMap(); static { - entities.put( - EntityEnderman.class, - ImmutableList.of( - SkyBlockEntity.of("zealot", EntityTypeHelper::isZealot) - ) - ); + entities.put(EntityEnderman.class, ImmutableList.of(SkyBlockEntity.of("zealot", EntityTypeHelper::isZealot))); } public static String getEntityId(Entity entity) { if (!entities.containsKey(entity.getClass())) return null; - for (SkyBlockEntity skyBlockEntity : entities.get( - entity.getClass() - )) if (skyBlockEntity.isEntity(entity)) return skyBlockEntity.getName(); + for (SkyBlockEntity skyBlockEntity : entities.get(entity.getClass())) if ( + skyBlockEntity.isEntity(entity) + ) return skyBlockEntity.getName(); return null; } } |