From 4ff0a7de8109b748cdaa707e9714478140095171 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 22 Nov 2023 11:50:00 +0000 Subject: Internal Change: Reformat Code to match .editorconfig (#628) Code cleanup done everywhere #628 --- src/main/java/SkyHanniInstallerFrame.java | 34 +++--- .../java/at/hannibal2/skyhanni/data/HypixelData.kt | 2 +- .../skyhanni/events/RenderEntityOutlineEvent.kt | 4 +- .../skyhanni/features/bingo/BingoCardDisplay.kt | 1 + .../skyhanni/features/bingo/BingoNextStepHelper.kt | 27 +++-- .../skyhanni/features/bingo/MinionCraftHelper.kt | 1 + .../skyhanni/features/chat/PlayerDeathMessages.kt | 11 +- .../skyhanni/features/chat/WatchdogHider.kt | 2 + .../skyhanni/features/chroma/ChromaFontRenderer.kt | 8 +- .../skyhanni/features/chroma/ChromaShader.kt | 5 +- .../features/combat/ghostcounter/GhostData.kt | 26 ++-- .../skyhanni/features/dungeon/DungeonCleanEnd.kt | 3 +- .../features/dungeon/DungeonDeathCounter.kt | 5 +- .../features/dungeon/DungeonFinderFeatures.kt | 7 +- .../skyhanni/features/dungeon/DungeonHideItems.kt | 8 +- .../features/dungeon/DungeonMilestonesDisplay.kt | 7 +- .../features/dungeon/DungeonTeammateOutlines.kt | 4 +- .../event/anniversary/Year300RaffleEvent.kt | 6 +- .../skyhanni/features/event/diana/BurrowType.kt | 10 +- .../skyhanni/features/event/diana/DianaAPI.kt | 2 +- .../hannibal2/skyhanni/features/garden/CropType.kt | 11 +- .../skyhanni/features/garden/GardenAPI.kt | 2 +- .../features/garden/GardenNextJacobContest.kt | 4 +- .../features/garden/composter/ComposterAPI.kt | 6 +- .../contest/JacobFarmingContestsInventory.kt | 6 +- .../features/garden/farming/CropMoneyDisplay.kt | 4 +- .../features/garden/fortuneguide/pages/CropPage.kt | 31 +++-- .../garden/fortuneguide/pages/OverviewPage.kt | 134 ++++++++++++++------- .../garden/fortuneguide/pages/UpgradePage.kt | 76 +++++++++--- .../garden/visitor/VisitorTooltipParser.kt | 2 +- .../mining/HighlightMiningCommissionMobs.kt | 2 +- .../skyhanni/features/misc/CollectionTracker.kt | 2 +- .../skyhanni/features/misc/MiscFeatures.kt | 5 +- .../features/misc/NonGodPotEffectDisplay.kt | 1 + .../skyhanni/features/misc/PlayerChatSymbols.kt | 17 +-- .../features/misc/SuperpairsClicksAlert.kt | 4 +- .../skyhanni/features/misc/TimeFeatures.kt | 5 +- .../features/misc/compacttablist/TabListReader.kt | 3 +- .../features/misc/discordrpc/DiscordStatus.kt | 4 +- .../features/misc/trevor/TrevorFeatures.kt | 3 +- .../skyhanni/features/misc/trevor/TrevorTracker.kt | 5 +- .../misc/update/GuiOptionEditorUpdateCheck.kt | 4 +- .../features/misc/visualwords/VisualWordGui.kt | 85 ++++++++++--- .../features/nether/ashfang/AshfangBlazingSouls.kt | 4 +- .../nether/ashfang/AshfangFreezeCooldown.kt | 4 +- .../features/nether/ashfang/AshfangGravityOrbs.kt | 6 +- .../nether/ashfang/AshfangHideDamageIndicator.kt | 4 +- .../nether/ashfang/AshfangNextResetCooldown.kt | 4 +- .../dailykuudra/DailyKuudraBossHelper.kt | 6 +- .../miniboss/DailyMiniBossHelper.kt | 8 +- .../at/hannibal2/skyhanni/features/rift/RiftAPI.kt | 4 +- .../area/livingcave/LivingCaveDefenseBlocks.kt | 6 +- .../area/livingcave/LivingCaveLivingMetalHelper.kt | 6 +- .../rift/everywhere/RiftHorsezookaHider.kt | 2 +- .../features/slayer/SlayerRngMeterDisplay.kt | 3 +- .../skyhanni/features/slayer/SlayerType.kt | 5 +- .../slayer/blaze/BlazeSlayerFirePitsWarning.kt | 3 +- .../features/summonings/SummoningMobManager.kt | 2 +- .../features/summonings/SummoningSoulsName.kt | 10 +- .../skyhanni/mixins/hooks/FontRendererHook.kt | 13 +- .../mixins/transformers/MixinFontRenderer.java | 4 +- .../mixins/transformers/gui/MixinGuiContainer.java | 12 +- .../test/SkyHanniConfigSearchResetCommand.kt | 2 +- .../test/command/CopyNearbyParticlesCommand.kt | 2 +- .../skyhanni/test/command/CopyScoreboardCommand.kt | 4 +- .../java/at/hannibal2/skyhanni/utils/APIUtil.kt | 8 +- .../at/hannibal2/skyhanni/utils/CachedItemData.kt | 23 ++-- .../skyhanni/utils/EntityOutlineRenderer.kt | 20 +-- .../at/hannibal2/skyhanni/utils/GuiRenderUtils.kt | 16 ++- .../at/hannibal2/skyhanni/utils/InventoryUtils.kt | 2 +- .../skyhanni/utils/MinecraftConsoleFilter.kt | 26 ++-- .../java/at/hannibal2/skyhanni/utils/NEUItems.kt | 4 +- .../at/hannibal2/skyhanni/utils/ParkourHelper.kt | 6 +- .../java/at/hannibal2/skyhanni/utils/SoundUtils.kt | 2 +- .../at/hannibal2/skyhanni/utils/StringUtils.kt | 3 +- src/main/java/at/hannibal2/skyhanni/utils/Timer.kt | 4 +- .../utils/jsonobjects/ContributorListJson.java | 3 +- .../skyhanni/utils/jsonobjects/MayorJson.java | 16 +-- .../utils/jsonobjects/SeaCreatureJson.java | 3 +- .../skyhanni/utils/renderables/Renderable.kt | 2 +- .../at/hannibal2/skyhanni/utils/shader/Shader.kt | 4 +- .../skyhanni/utils/shader/ShaderHelper.kt | 62 +++++++--- .../skyhanni/utils/shader/ShaderManager.kt | 12 +- .../at/hannibal2/skyhanni/utils/shader/Uniform.kt | 3 +- .../at/hannibal2/skyhanni/test/ItemUtilsTest.kt | 24 ++-- 85 files changed, 611 insertions(+), 335 deletions(-) diff --git a/src/main/java/SkyHanniInstallerFrame.java b/src/main/java/SkyHanniInstallerFrame.java index fa8868254..a9584dedf 100644 --- a/src/main/java/SkyHanniInstallerFrame.java +++ b/src/main/java/SkyHanniInstallerFrame.java @@ -166,8 +166,8 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo margin = 5; BufferedImage myPicture = ImageIO.read(Objects.requireNonNull(getClass() - .getClassLoader() - .getResourceAsStream("assets/skyhanni/logo.png"), "Logo not found.")); + .getClassLoader() + .getResourceAsStream("assets/skyhanni/logo.png"), "Logo not found.")); Image scaled = myPicture.getScaledInstance(w - margin * 2, h - margin, Image.SCALE_SMOOTH); logo = new JLabel(new ImageIcon(scaled)); logo.setName("Logo"); @@ -222,8 +222,8 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo descriptionText.setOpaque(false); descriptionText.setPreferredSize(new Dimension(w - margin * 2, h - margin)); descriptionText.setText( - "This installer will copy SkyHanni into your forge mods folder for you, and replace any old versions that already exist. " + - "Close this if you prefer to do this yourself!"); + "This installer will copy SkyHanni into your forge mods folder for you, and replace any old versions that already exist. " + + "Close this if you prefer to do this yourself!"); descriptionText.setWrapStyleWord(true); y += h; @@ -251,7 +251,7 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo forgeDescriptionText.setOpaque(false); forgeDescriptionText.setPreferredSize(new Dimension(w - margin * 2, h - margin)); forgeDescriptionText.setText( - "However, you still need to install Forge client in order to be able to run this mod. Click here to visit the download page for Forge 1.8.9!"); + "However, you still need to install Forge client in order to be able to run this mod. Click here to visit the download page for Forge 1.8.9!"); forgeDescriptionText.setForeground(Color.BLUE.darker()); forgeDescriptionText.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); forgeDescriptionText.setWrapStyleWord(true); @@ -315,8 +315,8 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo try { BufferedImage myPicture = ImageIO.read(Objects.requireNonNull(getClass() - .getClassLoader() - .getResourceAsStream("assets/skyhanni/folder.png"), "Folder icon not found.")); + .getClassLoader() + .getResourceAsStream("assets/skyhanni/folder.png"), "Folder icon not found.")); Image scaled = myPicture.getScaledInstance(w - 8, h - 6, Image.SCALE_SMOOTH); buttonChooseFolder = new JButton(new ImageIcon(scaled)); buttonChooseFolder.setName("ButtonFolder"); @@ -430,7 +430,7 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo if (e.getSource() == getForgeTextArea()) { try { Desktop.getDesktop().browse(new URI( - "http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html")); + "http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html")); } catch (IOException | URISyntaxException ex) { showErrorPopup(ex); } @@ -519,10 +519,10 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo } catch (Exception ex) { ex.printStackTrace(); showErrorMessage("Was not able to delete the other SkyHanni files found in your mods folder!" + - System.lineSeparator() + - "Please make sure that your minecraft is currently closed and try again, or feel" + - System.lineSeparator() + - "free to open your mods folder and delete those files manually."); + System.lineSeparator() + + "Please make sure that your minecraft is currently closed and try again, or feel" + + System.lineSeparator() + + "free to open your mods folder and delete those files manually."); return true; } continue; @@ -667,10 +667,10 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo private File getThisFile() { try { return new File(SkyHanniInstallerFrame.class - .getProtectionDomain() - .getCodeSource() - .getLocation() - .toURI()); + .getProtectionDomain() + .getCodeSource() + .getLocation() + .toURI()); } catch (URISyntaxException ex) { showErrorPopup(ex); } @@ -700,4 +700,4 @@ public class SkyHanniInstallerFrame extends JFrame implements ActionListener, Mo MACOS, UNKNOWN } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 22beb125e..aa78bec09 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -190,6 +190,6 @@ class HypixelData { val displayName = objective.displayName val scoreboardTitle = displayName.removeColor() return scoreboardTitle.contains("SKYBLOCK") || - scoreboardTitle.contains("SKIBLOCK") // April 1st jokes are so funny + scoreboardTitle.contains("SKIBLOCK") // April 1st jokes are so funny } } diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt index 21e18bd6c..6a197de6c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt @@ -7,7 +7,7 @@ import net.minecraft.entity.item.EntityItemFrame import java.util.function.Consumer class RenderEntityOutlineEvent(theType: Type?, potentialEntities: HashSet?) : - LorenzEvent() { + LorenzEvent() { /** * The phase of the event (see [Type] @@ -115,4 +115,4 @@ class RenderEntityOutlineEvent(theType: Type?, potentialEntities: HashSet() + // TODO USE SH-REPO private val goalCompletePattern = "§6§lBINGO GOAL COMPLETE! §r§e(?.*)".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index 8e74b434f..2960b2d22 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -28,6 +28,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BingoNextStepHelper { private val config get() = SkyHanniMod.feature.event.bingo.bingoCard private var dirty = true + // TODO USE SH-REPO private val crystalObtainedPattern = " *§r§e(?Topaz|Sapphire|Jade|Amethyst|Amber) Crystal".toPattern() private val itemIslandRequired = mutableMapOf() @@ -85,7 +86,7 @@ class BingoNextStepHelper { } if (!step.done && !parentDone && requirementsToDo == 0 && !currentSteps.contains(step)) { - currentSteps = currentSteps.editCopy { add(step) } + currentSteps = currentSteps.editCopy { add(step) } } } @@ -248,22 +249,22 @@ class BingoNextStepHelper { if (description == "Craft an Emerald Ring.") { return CraftStep("Emerald Ring") requires ( - ItemsStep( - "32x Enchanted Emerald", - "Emerald", - 160 * 32, - mapOf("Emerald" to 1, "Enchanted Emerald" to 160) - ) requires IslandType.DWARVEN_MINES.getStep()) + ItemsStep( + "32x Enchanted Emerald", + "Emerald", + 160 * 32, + mapOf("Emerald" to 1, "Enchanted Emerald" to 160) + ) requires IslandType.DWARVEN_MINES.getStep()) } if (description == "Obtain a Mathematical Hoe Blueprint.") { return CraftStep("Mathematical Hoe Blueprint") requires ( - ItemsStep( - "32x Jacob's Ticket", - "Jacob's Ticket", - 32, - mapOf("Jacob's Ticket" to 1) - ).addItemRequirements() requires IslandType.GARDEN.getStep()) + ItemsStep( + "32x Jacob's Ticket", + "Jacob's Ticket", + 32, + mapOf("Jacob's Ticket" to 1) + ).addItemRequirements() requires IslandType.GARDEN.getStep()) } crystalPattern.matchMatcher(description) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 0dc99f595..8657f76ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -23,6 +23,7 @@ import kotlin.time.Duration.Companion.seconds class MinionCraftHelper { private val config get() = SkyHanniMod.feature.event.bingo + // TODO USE SH-REPO private var minionNamePattern = "(?.*) Minion (?.*)".toPattern() private var display = emptyList() diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt index 87692135e..b9088bac6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -37,7 +37,10 @@ class PlayerDeathMessages { val message = event.message deathMessagePattern.matchMatcher(message) { val name = group("name") - if (SkyHanniMod.feature.markedPlayers.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer(name)) { + if (SkyHanniMod.feature.markedPlayers.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer( + name + ) + ) { val reason = group("reason").removeColor() LorenzUtils.chat(" §c☠ §e$name §7$reason", false) event.blockedReason = "marked_player_death" @@ -45,7 +48,11 @@ class PlayerDeathMessages { } - if (isHideFarDeathsEnabled() && System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault(name, 0) + 30_000) { + if (isHideFarDeathsEnabled() && System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault( + name, + 0 + ) + 30_000 + ) { event.blockedReason = "far_away_player_death" } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt index 739eaa123..c5eefc603 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt @@ -23,11 +23,13 @@ class WatchdogHider { startLineComponent = event.chatComponent blockedLines = 0 } + watchdogAnnouncementLine -> { ChatManager.retractMessage(startLineComponent, "watchdog") startLineComponent = null inWatchdog = true } + watchdogEndLine -> { event.blockedReason = "watchdog" inWatchdog = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaFontRenderer.kt b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaFontRenderer.kt index 981b7b33a..469fc2f3c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaFontRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaFontRenderer.kt @@ -36,7 +36,7 @@ class ChromaFontRenderer(private val baseColor: Int) { } } - fun newChromaEnv() : ChromaFontRenderer { + fun newChromaEnv(): ChromaFontRenderer { if (ShaderHelper.areShadersSupported()) { ChromaShaderManager.begin() GlStateManager.shadeModel(GL11.GL_SMOOTH) @@ -44,7 +44,7 @@ class ChromaFontRenderer(private val baseColor: Int) { return this } - fun bindActualColor() : ChromaFontRenderer { + fun bindActualColor(): ChromaFontRenderer { GlStateManager.color( ColorUtils.getRed(baseColor).toFloat() / 255f, ColorUtils.getGreen(baseColor).toFloat() / 255f, @@ -54,7 +54,7 @@ class ChromaFontRenderer(private val baseColor: Int) { return this } - fun endChromaEnv() : ChromaFontRenderer { + fun endChromaEnv(): ChromaFontRenderer { if (ShaderHelper.areShadersSupported()) { ChromaShaderManager.end() GlStateManager.shadeModel(GL11.GL_FLAT) @@ -63,4 +63,4 @@ class ChromaFontRenderer(private val baseColor: Int) { } fun getChromaState() = chromaOn -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt index 00215b032..e7bedbdcd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt @@ -22,7 +22,8 @@ object ChromaShader : Shader("chroma", "chroma") { SkyHanniMod.feature.chroma.chromaSize * (Minecraft.getMinecraft().displayWidth / 100f) } registerUniform(Uniform.UniformType.FLOAT, "timeOffset") { - var ticks = (MinecraftData.totalTicks / 2) + (Minecraft.getMinecraft() as AccessorMinecraft).timer.renderPartialTicks + var ticks = + (MinecraftData.totalTicks / 2) + (Minecraft.getMinecraft() as AccessorMinecraft).timer.renderPartialTicks ticks = when (SkyHanniMod.feature.chroma.chromaDirection) { 0, 2 -> ticks @@ -44,4 +45,4 @@ object ChromaShader : Shader("chroma", "chroma") { } } } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt index 69094b991..abcf2dbba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt @@ -6,16 +6,16 @@ import kotlin.math.roundToInt object GhostData { private var session = mutableMapOf( - Option.KILLS to 0.0, - Option.SORROWCOUNT to 0.0, - Option.VOLTACOUNT to 0.0, - Option.PLASMACOUNT to 0.0, - Option.GHOSTLYBOOTS to 0.0, - Option.BAGOFCASH to 0.0, - Option.TOTALDROPS to 0.0, - Option.SCAVENGERCOINS to 0.0, - Option.MAXKILLCOMBO to 0.0, - Option.SKILLXPGAINED to 0.0 + Option.KILLS to 0.0, + Option.SORROWCOUNT to 0.0, + Option.VOLTACOUNT to 0.0, + Option.PLASMACOUNT to 0.0, + Option.GHOSTLYBOOTS to 0.0, + Option.BAGOFCASH to 0.0, + Option.TOTALDROPS to 0.0, + Option.SCAVENGERCOINS to 0.0, + Option.MAXKILLCOMBO to 0.0, + Option.SKILLXPGAINED to 0.0 ) val bestiaryData = mutableMapOf().apply { @@ -34,11 +34,11 @@ object GhostData { 11 -> 750 12 -> 1_500 13 -> 2_000 - 14,15,16,17 -> 2_500 + 14, 15, 16, 17 -> 2_500 18 -> 3_000 - 19,20 -> 3_500 + 19, 20 -> 3_500 21 -> 25_000 - 22,23,24,25 -> 50_000 + 22, 23, 24, 25 -> 50_000 else -> 0 } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt index 07a4edf18..6e5fc27bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt @@ -90,7 +90,8 @@ class DungeonCleanEnd { && DungeonAPI.isOneOf("F3", "M3") && entity is EntityGuardian && entity.entityId != lastBossId - && Minecraft.getMinecraft().thePlayer.isSneaking) { + && Minecraft.getMinecraft().thePlayer.isSneaking + ) { return } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt index 88ab543f0..36788e4b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -88,7 +88,10 @@ class DungeonDeathCounter { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + display, posLabel = "Dungeon Death Counter") + SkyHanniMod.feature.dungeon.deathCounterPos.renderString( + DungeonMilestonesDisplay.color + display, + posLabel = "Dungeon Death Counter" + ) } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt index eceb28ad1..b824bc6a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt @@ -26,7 +26,8 @@ class DungeonFinderFeatures { private val pricePattern = "([0-9]{2,3}K|[0-9]{1,3}M|[0-9]+\\.[0-9]M|[0-9] ?mil)".toRegex(RegexOption.IGNORE_CASE) private val carryPattern = "(carry|cary|carries|caries|comp|to cata [0-9]{2})".toRegex(RegexOption.IGNORE_CASE) private val memberPattern = "^ §.*?§.: §.([A-Z]+)§. \\(§.([0-9]+)§.\\)".toRegex(RegexOption.IGNORE_CASE) - private val ineligiblePattern = "^§c(Requires .*$|You don't meet the requirement!|Complete previous floor first!$)".toRegex() + private val ineligiblePattern = + "^§c(Requires .*$|You don't meet the requirement!|Complete previous floor first!$)".toRegex() private val classLevelPattern = " §.(?.*)§f: §e(?.*)§b \\(§e(?.*)§b\\)".toPattern() private val notePattern = "^(§7§7Note: |§f[^§])".toRegex() @@ -81,7 +82,7 @@ class DungeonFinderFeatures { if (!LorenzUtils.inSkyBlock || LorenzUtils.skyBlockArea != "Dungeon Hub") return if (event.inventoryName != "Catacombs Gate") return - val lore = event.inventoryItems[45]?.getLore() ?: return + val lore = event.inventoryItems[45]?.getLore() ?: return if (lore[0] == "§7View and select a dungeon class.") { selectedClass = lore[2].split(" ").last().removeColor() @@ -111,7 +112,7 @@ class DungeonFinderFeatures { } if (config.markPaidCarries) { - val note = slot.stack.getLore().filter { notePattern.containsMatchIn(it) }.joinToString(" ") ?: "" + val note = slot.stack.getLore().filter { notePattern.containsMatchIn(it) }.joinToString(" ") if (pricePattern.containsMatchIn(note) && carryPattern.containsMatchIn(note)) { slot highlight LorenzColor.RED diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index c1f8826b4..5a01eae76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -50,11 +50,7 @@ class DungeonHideItems { private fun isSkeletonSkull(entity: EntityArmorStand): Boolean { val itemStack = entity.inventory[4] - if (itemStack != null && itemStack.cleanName() == "Skeleton Skull") { - return true - } - - return false + return itemStack != null && itemStack.cleanName() == "Skeleton Skull" } @SubscribeEvent @@ -241,4 +237,4 @@ class DungeonHideItems { event.move(3, "dungeon.hideHealerOrbs", "dungeon.objectHider.hideHealerOrbs") event.move(3, "dungeon.hideHealerFairy", "dungeon.objectHider.hideHealerFairy") } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index 69b06c0ce..fbf6a3850 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -83,10 +83,13 @@ class DungeonMilestonesDisplay { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + display, posLabel = "Dungeon Milestone") + SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString( + color + display, + posLabel = "Dungeon Milestone" + ) } private fun isEnabled(): Boolean { return LorenzUtils.inDungeons && SkyHanniMod.feature.dungeon.showMilestonesDisplay } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt index de2ca07e2..445b9676f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt @@ -32,8 +32,8 @@ class DungeonTeammateOutlines { val colorFormat = FontRenderer.getFormatFromString(team.colorPrefix) return if (colorFormat.length >= 2) - Minecraft.getMinecraft().fontRendererObj.getColorCode(colorFormat[1]); + Minecraft.getMinecraft().fontRendererObj.getColorCode(colorFormat[1]) else null } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt index 8395b02da..d636f6810 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt @@ -37,8 +37,8 @@ object Year300RaffleEvent { } fun isEnabled() = config.enableActiveTimer && - Instant.now().isBefore(SkyBlockTime(301).toInstant()) && - LorenzUtils.inSkyBlock + Instant.now().isBefore(SkyBlockTime(301).toInstant()) && + LorenzUtils.inSkyBlock @SubscribeEvent @@ -70,4 +70,4 @@ object Year300RaffleEvent { Renderable.string("§eTime Left: ${timeLeft.format()}") ) } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowType.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowType.kt index b7d589440..ac52c5617 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowType.kt @@ -3,8 +3,8 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.utils.LorenzColor enum class BurrowType(val text: String, val color: LorenzColor) { - START("§aStart",LorenzColor.GREEN), - MOB("§cMob",LorenzColor.RED), - TREASURE("§6Treasure",LorenzColor.GOLD), - UNKNOWN("§fUnknown?!",LorenzColor.WHITE), -} \ No newline at end of file + START("§aStart", LorenzColor.GREEN), + MOB("§cMob", LorenzColor.RED), + TREASURE("§6Treasure", LorenzColor.GOLD), + UNKNOWN("§fUnknown?!", LorenzColor.WHITE), +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt index a9806ab2f..8c01d0141 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt @@ -15,7 +15,7 @@ object DianaAPI { fun hasSpadeInHand() = InventoryUtils.itemInHandId == spade private fun isRitualActive() = MayorElection.isPerkActive("Diana", "Mythological Ritual") || - MayorElection.isPerkActive("Jerry", "Perkpocalypse") || SkyHanniMod.feature.event.diana.alwaysDiana + MayorElection.isPerkActive("Jerry", "Perkpocalypse") || SkyHanniMod.feature.event.diana.alwaysDiana fun hasGriffinPet() = PetAPI.currentPet?.contains("Griffin") ?: false diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt index a684e7bac..423bdaed1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt @@ -17,7 +17,14 @@ enum class CropType( WHEAT("Wheat", "THEORETICAL_HOE_WHEAT", "CROPIE", 1.0, { ItemStack(Items.wheat) }), CARROT("Carrot", "THEORETICAL_HOE_CARROT", "CROPIE", 3.0, { ItemStack(Items.carrot) }, replenish = true), POTATO("Potato", "THEORETICAL_HOE_POTATO", "CROPIE", 3.0, { ItemStack(Items.potato) }, replenish = true), - NETHER_WART("Nether Wart", "THEORETICAL_HOE_WARTS", "FERMENTO", 2.5, { ItemStack(Items.nether_wart) }, replenish = true), + NETHER_WART( + "Nether Wart", + "THEORETICAL_HOE_WARTS", + "FERMENTO", + 2.5, + { ItemStack(Items.nether_wart) }, + replenish = true + ), PUMPKIN("Pumpkin", "PUMPKIN_DICER", "SQUASH", 1.0, { ItemStack(Blocks.pumpkin) }), MELON("Melon", "MELON_DICER", "SQUASH", 5.0, { ItemStack(Items.melon) }), COCOA_BEANS( @@ -69,4 +76,4 @@ enum class CropType( } } } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 75fd7e9d2..8998903d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -156,7 +156,7 @@ object GardenAPI { } fun hideExtraGuis() = ComposterOverlay.inInventory || AnitaMedalProfit.inInventory || - SkyMartCopperPrice.inInventory || FarmingContestAPI.inInventory || VisitorAPI.inInventory || FFGuideGUI.isInGui() + SkyMartCopperPrice.inInventory || FarmingContestAPI.inInventory || VisitorAPI.inInventory || FFGuideGUI.isInGui() fun clearCropSpeed() { storage?.cropsPerSecond?.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index ef5d9a429..c058e9fe6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -326,7 +326,7 @@ object GardenNextJacobContest { SkyHanniMod.coroutineScope.launch { openPopupWindow( "Farming Contest soon!\n" + - "Crops: ${cropText.removeColor()}" + "Crops: ${cropText.removeColor()}" ) } } @@ -395,7 +395,7 @@ object GardenNextJacobContest { } private fun isEnabled() = LorenzUtils.inSkyBlock && config.display - && (GardenAPI.inGarden() || config.everywhere) + && (GardenAPI.inGarden() || config.everywhere) private fun isFetchEnabled() = isEnabled() && config.fetchAutomatically private fun isSendEnabled() = isFetchEnabled() && config.shareAutomatically != 2 // 2 = Disabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt index 299e02f40..50efa9e42 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt @@ -11,13 +11,15 @@ object ComposterAPI { var tabListData = mapOf() val composterUpgrades: MutableMap? get() = GardenAPI.storage?.composterUpgrades - fun ComposterUpgrade.getLevel(addOne: ComposterUpgrade?) = (composterUpgrades?.get(this) ?: 0) + if (addOne == this) 1 else 0 + fun ComposterUpgrade.getLevel(addOne: ComposterUpgrade?) = + (composterUpgrades?.get(this) ?: 0) + if (addOne == this) 1 else 0 fun getFuel() = tabListData[ComposterDisplay.DataType.FUEL]?.removeColor()?.formatNumber() ?: 0 fun getOrganicMatter() = tabListData[ComposterDisplay.DataType.ORGANIC_MATTER]?.removeColor()?.formatNumber() ?: 0 - fun maxOrganicMatter(addOne: ComposterUpgrade?) = 40_000 + ComposterUpgrade.ORGANIC_MATTER_CAP.getLevel(addOne) * 20_000 + fun maxOrganicMatter(addOne: ComposterUpgrade?) = + 40_000 + ComposterUpgrade.ORGANIC_MATTER_CAP.getLevel(addOne) * 20_000 fun multiDropChance(addOne: ComposterUpgrade?) = ComposterUpgrade.MULTI_DROP.getLevel(addOne) * 0.03 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt index 25cfd12d7..e7af728cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt @@ -144,7 +144,11 @@ class JacobFarmingContestsInventory { @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { - event.move(3, "inventory.jacobFarmingContestHighlightRewards", "inventory.jacobFarmingContests.highlightRewards") + event.move( + 3, + "inventory.jacobFarmingContestHighlightRewards", + "inventory.jacobFarmingContests.highlightRewards" + ) event.move(3, "inventory.jacobFarmingContestHideDuplicates", "inventory.jacobFarmingContests.hideDuplicates") event.move(3, "inventory.jacobFarmingContestRealTime", "inventory.jacobFarmingContests.realTime") event.move(3, "inventory.jacobFarmingContestFinneganIcon", "inventory.jacobFarmingContests.finneganIcon") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index b63b02f27..b780bbc0e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -276,8 +276,8 @@ object CropMoneyDisplay { val onlyNpcPrice = (!config.useCustomFormat && LorenzUtils.noTradeMode) || - (config.useCustomFormat && config.customFormat.size == 1 && - config.customFormat[0] == 2) + (config.useCustomFormat && config.customFormat.size == 1 && + config.customFormat[0] == 2) for ((internalName, amount) in multipliers.moveEntryToTop { isSeeds(it.key) }) { val crop = cropNames[internalName]!! diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt index cb20cc86a..d9558cd2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt @@ -1,4 +1,5 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide.pages + import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats @@ -7,12 +8,19 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneStats import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase -class CropPage: FFGuideGUI.FFGuidePage() { +class CropPage : FFGuideGUI.FFGuidePage() { override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { for (item in FarmingItems.entries) { if (item.name == FFGuideGUI.currentCrop?.name) { - GuiRenderUtils.renderItemAndTip(FFGuideGUI.tooltipToDisplay, item.getItem(), FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FFGuideGUI.tooltipToDisplay, + item.getItem(), + FFGuideGUI.guiLeft + 172, + FFGuideGUI.guiTop + 60, + mouseX, + mouseY + ) } } @@ -21,9 +29,12 @@ class CropPage: FFGuideGUI.FFGuidePage() { var i = 0 FFStats.cropPage.forEach { (key, value) -> if (key == FortuneStats.CROP_TOTAL) { - val newLine = key.label.replace("Crop", FFGuideGUI.currentCrop?.name?.replace("_", " ")?.firstLetterUppercase()!!) - GuiRenderUtils.drawFarmingBar(newLine, key.tooltip, value.first, value.second, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + val newLine = + key.label.replace("Crop", FFGuideGUI.currentCrop?.name?.replace("_", " ")?.firstLetterUppercase()!!) + GuiRenderUtils.drawFarmingBar( + newLine, key.tooltip, value.first, value.second, FFGuideGUI.guiLeft + 135, + FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) } else { if (i % 2 == 0) { x = FFGuideGUI.guiLeft + 15 @@ -31,10 +42,12 @@ class CropPage: FFGuideGUI.FFGuidePage() { } else { x = FFGuideGUI.guiLeft + 255 } - i ++ - GuiRenderUtils.drawFarmingBar(key.label, key.tooltip, value.first, value.second, x, y, - 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + i++ + GuiRenderUtils.drawFarmingBar( + key.label, key.tooltip, value.first, value.second, x, y, + 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) } } } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt index 44beaca34..2fe623c74 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt @@ -11,37 +11,49 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.TimeUtils -class OverviewPage: FFGuideGUI.FFGuidePage() { +class OverviewPage : FFGuideGUI.FFGuidePage() { private var equipmentFF = mutableMapOf() private var armorFF = mutableMapOf() override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { val timeUntilCakes = TimeUtils.formatDuration(FFStats.cakeExpireTime - System.currentTimeMillis()) - GuiRenderUtils.drawFarmingBar("§6Universal Farming Fortune", + GuiRenderUtils.drawFarmingBar( + "§6Universal Farming Fortune", "§7§2Farming fortune in that is\n§2applied to every crop\n§eNot the same as tab FF\n" + - "§eSee on the grass block page", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1277, - FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + "§eSee on the grass block page", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1277, + FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) var line = if (FFStats.baseFF[FFTypes.ANITA]!! < 0.0) "§cAnita buff not saved\n§eVisit Anita to set it!" else "§7§2Fortune for levelling your Anita extra crops\n§2You get 4☘ per buff level" - GuiRenderUtils.drawFarmingBar("§2Anita Buff", line, FFStats.baseFF[FFTypes.ANITA] ?: 0.0, 60, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar( + "§2Anita Buff", line, FFStats.baseFF[FFTypes.ANITA] ?: 0.0, 60, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = if (FFStats.baseFF[FFTypes.FARMING_LVL]!! < 0.0) "§cFarming level not saved\n§eOpen /skills to set it!" else "§7§2Fortune for levelling your farming skill\n§2You get 4☘ per farming level" - GuiRenderUtils.drawFarmingBar("§2Farming Level", line, FFStats.baseFF[FFTypes.FARMING_LVL] ?: 0.0, 240, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar( + "§2Farming Level", line, FFStats.baseFF[FFTypes.FARMING_LVL] ?: 0.0, 240, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) - line = if (FFStats.baseFF[FFTypes.COMMUNITY_SHOP]!! < 0.0) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!" - else "§7§2Fortune for community shop upgrades\n§2You get 4☘ per upgrade tier" - GuiRenderUtils.drawFarmingBar("§2Community upgrades", line, FFStats.baseFF[FFTypes.COMMUNITY_SHOP] ?: 0.0, - 40, FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + line = + if (FFStats.baseFF[FFTypes.COMMUNITY_SHOP]!! < 0.0) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!" + else "§7§2Fortune for community shop upgrades\n§2You get 4☘ per upgrade tier" + GuiRenderUtils.drawFarmingBar( + "§2Community upgrades", line, FFStats.baseFF[FFTypes.COMMUNITY_SHOP] ?: 0.0, + 40, FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) - line = if (FFStats.baseFF[FFTypes.PLOTS]!! < 0.0) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!" - else "§7§2Fortune for unlocking garden plots\n§2You get 3☘ per plot unlocked" - GuiRenderUtils.drawFarmingBar("§2Garden Plots", line, FFStats.baseFF[FFTypes.PLOTS] ?: 0.0, 72, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + line = + if (FFStats.baseFF[FFTypes.PLOTS]!! < 0.0) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!" + else "§7§2Fortune for unlocking garden plots\n§2You get 3☘ per plot unlocked" + GuiRenderUtils.drawFarmingBar( + "§2Garden Plots", line, FFStats.baseFF[FFTypes.PLOTS] ?: 0.0, 72, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = when (FFStats.cakeExpireTime) { -1L -> "§eYou have not eaten a cake since\n§edownloading this update, assuming the\n§ebuff is active!" @@ -50,8 +62,10 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { if (FFStats.cakeExpireTime - System.currentTimeMillis() < 0 && FFStats.cakeExpireTime != -1L) { line = "§cYour cake buff has run out\nGo eat some cake!" } - GuiRenderUtils.drawFarmingBar("§2Cake Buff", line, FFStats.baseFF[FFTypes.CAKE] ?: 0.0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar( + "§2Cake Buff", line, FFStats.baseFF[FFTypes.CAKE] ?: 0.0, 5, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) val armorItem = when (currentArmor) { 1 -> FarmingItems.HELMET @@ -87,8 +101,10 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { else -> 78.75 } } - GuiRenderUtils.drawFarmingBar("§2Total $word Fortune", line, armorFF[FFTypes.TOTAL] ?: 0, value, - FFGuideGUI.guiLeft + 135, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar( + "§2Total $word Fortune", line, armorFF[FFTypes.TOTAL] ?: 0, value, + FFGuideGUI.guiLeft + 135, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = if (currentArmor == 0) "§7§2The base fortune from your armor\n§2Select a piece for more info" else "§7§2Base fortune from your\n${armorItem.getItem().displayName}" @@ -99,9 +115,11 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { 3 -> 35 else -> if (FFStats.usingSpeedBoots) 60 else 30 } - GuiRenderUtils.drawFarmingBar("§2Base $word Fortune", line, armorFF[FFTypes.BASE] ?: 0, + GuiRenderUtils.drawFarmingBar( + "§2Base $word Fortune", line, armorFF[FFTypes.BASE] ?: 0, value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = if (currentArmor == 0) "§7§2The fortune from your armor's ability\n§2Select a piece for more info" else "§7§2Ability fortune from your\n${armorItem.getItem().displayName}" @@ -118,9 +136,11 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { } } - GuiRenderUtils.drawFarmingBar("§2$word Ability", line, armorFF[FFTypes.ABILITY] ?: 0, + GuiRenderUtils.drawFarmingBar( + "§2$word Ability", line, armorFF[FFTypes.ABILITY] ?: 0, value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = if (currentArmor == 0) "§7§2The fortune from your armor's reforge\n§2Select a piece for more info" else "§7§2Total fortune from your\n${armorItem.getItem().displayName}" @@ -129,9 +149,11 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { } else if (currentArmor == 4) { if (FFStats.usingSpeedBoots) 25 else 30 } else 30 - GuiRenderUtils.drawFarmingBar("§2$word Reforge", line, armorFF[FFTypes.REFORGE] ?: 0, + GuiRenderUtils.drawFarmingBar( + "§2$word Reforge", line, armorFF[FFTypes.REFORGE] ?: 0, value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) var currentPet = FFStats.rabbitFF var petMaxFF = 60 @@ -140,20 +162,25 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { currentPet = FFStats.elephantFF petMaxFF = 210 } + FarmingItems.MOOSHROOM_COW -> { currentPet = FFStats.mooshroomFF petMaxFF = 217 } + FarmingItems.BEE -> { currentPet = FFStats.beeFF petMaxFF = 90 } + else -> {} } - GuiRenderUtils.drawFarmingBar("§2Total Pet Fortune", "§7§2The total fortune from your pet and its item", + GuiRenderUtils.drawFarmingBar( + "§2Total Pet Fortune", "§7§2The total fortune from your pet and its item", currentPet[FFTypes.TOTAL] ?: 0, petMaxFF, FFGuideGUI.guiLeft + 105, - FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = when (FFStats.currentPetItem) { "GREEN_BANDANA" -> "§7§2The fortune from your pet's item\n§2Grants 4☘ per garden level" @@ -161,8 +188,10 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { "MINOS_RELIC" -> "§cGreen Bandana is better for fortune than minos relic!" else -> "No fortune boosting pet item" } - GuiRenderUtils.drawFarmingBar("§2Pet Item", line, currentPet[FFTypes.PET_ITEM] ?: 0, 60, FFGuideGUI.guiLeft + 185, - FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar( + "§2Pet Item", line, currentPet[FFTypes.PET_ITEM] ?: 0, 60, FFGuideGUI.guiLeft + 185, + FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) word = if (currentEquipment == 0) "Equipment" else "Piece" @@ -183,33 +212,46 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { line = if (currentEquipment == 0) "§7§2Total fortune from all your equipment\n§2Select a piece for more info" else "§7§2Total fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Total $word Fortune", line, equipmentFF[FFTypes.TOTAL] ?: 0, + GuiRenderUtils.drawFarmingBar( + "§2Total $word Fortune", line, equipmentFF[FFTypes.TOTAL] ?: 0, if (currentEquipment == 0) 218 else 54.5, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) line = if (currentEquipment == 0) "§7§2The base fortune from all your equipment\n§2Select a piece for more info" else "§7§2Total base fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2$word Base Fortune", line, equipmentFF[FFTypes.BASE] ?: 0, + GuiRenderUtils.drawFarmingBar( + "§2$word Base Fortune", line, equipmentFF[FFTypes.BASE] ?: 0, if (currentEquipment == 0) 20 else 5, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's abilities\n§2Select a piece for more info" - else "§7§2Total ability fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2$word Ability", line, equipmentFF[FFTypes.ABILITY] ?: 0, + line = + if (currentEquipment == 0) "§7§2The fortune from all of your equipment's abilities\n§2Select a piece for more info" + else "§7§2Total ability fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar( + "§2$word Ability", line, equipmentFF[FFTypes.ABILITY] ?: 0, if (currentEquipment == 0) 60 else 15, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's reforges\n§2Select a piece for more info" - else "§7§2Total reforge fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2$word Reforge", line, equipmentFF[FFTypes.REFORGE] ?: 0, + line = + if (currentEquipment == 0) "§7§2The fortune from all of your equipment's reforges\n§2Select a piece for more info" + else "§7§2Total reforge fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar( + "§2$word Reforge", line, equipmentFF[FFTypes.REFORGE] ?: 0, if (currentEquipment == 0) 60 else 15, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) val maxGreenThumbFortune = GardenAPI.totalAmountVisitorsExisting.toDouble() / 4 - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's enchantments\n§2Select a piece for more info" - else "§7§2Total enchantment fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2$word Enchantment", line, equipmentFF[FFTypes.GREEN_THUMB] ?: 0, + line = + if (currentEquipment == 0) "§7§2The fortune from all of your equipment's enchantments\n§2Select a piece for more info" + else "§7§2Total enchantment fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar( + "§2$word Enchantment", line, equipmentFF[FFTypes.GREEN_THUMB] ?: 0, if (currentEquipment == 0) maxGreenThumbFortune * 4 else maxGreenThumbFortune, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay + ) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt index 6076efd21..70bc23125 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt @@ -11,7 +11,7 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraft.util.MathHelper import java.text.DecimalFormat -class UpgradePage: FFGuideGUI.FFGuidePage() { +class UpgradePage : FFGuideGUI.FFGuidePage() { private var pageScroll = 0 private var scrollVelocity = 0.0 private val maxNoInputFrames = 100 @@ -22,13 +22,34 @@ class UpgradePage: FFGuideGUI.FFGuidePage() { val inverseScale = 1 / 0.75f GlStateManager.scale(0.75f, 0.75f, 1f) - GuiRenderUtils.drawString("Upgrade", (FFGuideGUI.guiLeft + 45) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) - GuiRenderUtils.drawString("Item", (FFGuideGUI.guiLeft + 190) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) - GuiRenderUtils.drawString("FF increase", (FFGuideGUI.guiLeft + 240) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) - GuiRenderUtils.drawString("Cost/FF", (FFGuideGUI.guiLeft + 290) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) - GuiRenderUtils.drawString("Total", (FFGuideGUI.guiLeft + 330) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + GuiRenderUtils.drawString( + "Upgrade", + (FFGuideGUI.guiLeft + 45) * inverseScale, + (FFGuideGUI.guiTop + 5) * inverseScale + ) + GuiRenderUtils.drawString( + "Item", + (FFGuideGUI.guiLeft + 190) * inverseScale, + (FFGuideGUI.guiTop + 5) * inverseScale + ) + GuiRenderUtils.drawString( + "FF increase", + (FFGuideGUI.guiLeft + 240) * inverseScale, + (FFGuideGUI.guiTop + 5) * inverseScale + ) + GuiRenderUtils.drawString( + "Cost/FF", + (FFGuideGUI.guiLeft + 290) * inverseScale, + (FFGuideGUI.guiTop + 5) * inverseScale + ) + GuiRenderUtils.drawString( + "Total", + (FFGuideGUI.guiLeft + 330) * inverseScale, + (FFGuideGUI.guiTop + 5) * inverseScale + ) - val upgradeList = if (FFGuideGUI.currentCrop == null) FortuneUpgrades.genericUpgrades else FortuneUpgrades.cropSpecificUpgrades + val upgradeList = + if (FFGuideGUI.currentCrop == null) FortuneUpgrades.genericUpgrades else FortuneUpgrades.cropSpecificUpgrades listLength = upgradeList.size for ((index, upgrade) in upgradeList.withIndex()) { if (adjustedY + 25 * index < FFGuideGUI.guiTop + 20) continue @@ -42,13 +63,40 @@ class UpgradePage: FFGuideGUI.FFGuidePage() { if (upgrade.itemQuantity != 1) { formattedUpgrade = "$formattedUpgrade §fx${upgrade.itemQuantity}" } - GuiRenderUtils.drawTwoLineString(upgrade.description, (FFGuideGUI.guiLeft + 15) * inverseScale, (adjustedY + 25 * index) * inverseScale) - GuiRenderUtils.renderItemAndTip(FFGuideGUI.tooltipToDisplay, upgradeItem, (FFGuideGUI.guiLeft + 155) * inverseScale, (adjustedY + 25 * index - 5) * inverseScale, - mouseX * inverseScale, mouseY * inverseScale, 0x00FFFFFF) - GuiRenderUtils.drawString(formattedUpgrade, (FFGuideGUI.guiLeft + 180) * inverseScale, (adjustedY + 25 * index) * inverseScale) - GuiRenderUtils.drawString("§a${DecimalFormat("0.##").format(upgrade.fortuneIncrease)}", (FFGuideGUI.guiLeft + 270) * inverseScale, (adjustedY + 25 * index) * inverseScale) - GuiRenderUtils.drawString("§6" + upgrade.costPerFF?.let { NumberUtil.format(it) }, (FFGuideGUI.guiLeft + 300) * inverseScale, (adjustedY + 25 * index) * inverseScale) - GuiRenderUtils.drawString(("§6" + upgrade.cost?.let { NumberUtil.format(it) }), (FFGuideGUI.guiLeft + 335) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.drawTwoLineString( + upgrade.description, + (FFGuideGUI.guiLeft + 15) * inverseScale, + (adjustedY + 25 * index) * inverseScale + ) + GuiRenderUtils.renderItemAndTip( + FFGuideGUI.tooltipToDisplay, + upgradeItem, + (FFGuideGUI.guiLeft + 155) * inverseScale, + (adjustedY + 25 * index - 5) * inverseScale, + mouseX * inverseScale, + mouseY * inverseScale, + 0x00FFFFFF + ) + GuiRenderUtils.drawString( + formattedUpgrade, + (FFGuideGUI.guiLeft + 180) * inverseScale, + (adjustedY + 25 * index) * inverseScale + ) + GuiRenderUtils.drawString( + "§a${DecimalFormat("0.##").format(upgrade.fortuneIncrease)}", + (FFGuideGUI.guiLeft + 270) * inverseScale, + (adjustedY + 25 * index) * inverseScale + ) + GuiRenderUtils.drawString( + "§6" + upgrade.costPerFF?.let { NumberUtil.format(it) }, + (FFGuideGUI.guiLeft + 300) * inverseScale, + (adjustedY + 25 * index) * inverseScale + ) + GuiRenderUtils.drawString( + ("§6" + upgrade.cost?.let { NumberUtil.format(it) }), + (FFGuideGUI.guiLeft + 335) * inverseScale, + (adjustedY + 25 * index) * inverseScale + ) } GlStateManager.scale(inverseScale, inverseScale, 1f) scrollScreen() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorTooltipParser.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorTooltipParser.kt index 510e4f3b7..851c5ece7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorTooltipParser.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorTooltipParser.kt @@ -36,7 +36,7 @@ class VisitorTooltipParser { } } - return parsedData; + return parsedData } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 9b46318de..94726c640 100644 --- a/src/main/java/at/ha