diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
83 files changed, 582 insertions, 306 deletions
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<Entity>?) :
- LorenzEvent() {
+ LorenzEvent() {
/**
* The phase of the event (see [Type]
@@ -115,4 +115,4 @@ class RenderEntityOutlineEvent(theType: Type?, potentialEntities: HashSet<Entity NO_XRAY
}
-}
\ No newline at end of file +}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index b59eae0b2..ee1fc5874 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -24,6 +24,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BingoCardDisplay { private var display = emptyList<String>() + // TODO USE SH-REPO private val goalCompletePattern = "§6§lBINGO GOAL COMPLETE! §r§e(?<name>.*)".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(?<crystalName>Topaz|Sapphire|Jade|Amethyst|Amber) Crystal".toPattern() private val itemIslandRequired = mutableMapOf<String, IslandVisitStep>() @@ -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 = "(?<name>.*) Minion (?<number>.*)".toPattern() private var display = emptyList<String>() 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<Int, Int>().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 = " §.(?<playerName>.*)§f: §e(?<className>.*)§b \\(§e(?<level>.*)§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<ComposterDisplay.DataType, String>() val composterUpgrades: MutableMap<ComposterUpgrade, Int>? 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<FFTypes, Double>() private var armorFF = mutableMapOf<FFTypes, Double>() 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/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -93,5 +93,5 @@ class HighlightMiningCommissionMobs { } fun isEnabled() = config.highlightCommissionMobs && - (IslandType.DWARVEN_MINES.isInIsland() || IslandType.CRYSTAL_HOLLOWS.isInIsland()) + (IslandType.DWARVEN_MINES.isInIsland() || IslandType.CRYSTAL_HOLLOWS.isInIsland()) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt index 1ddcb40e7..e05571b6a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt @@ -170,7 +170,7 @@ class CollectionTracker { val currentlyInInventory = countCurrentlyInInventory() val diff = currentlyInInventory - lastAmountInInventory if (diff != 0 && diff > 0) { - gainItems(diff) + gainItems(diff) } lastAmountInInventory = currentlyInInventory diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt index 0d164b477..3b52ee478 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt @@ -11,7 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent /** * I need these features in my dev env - */ + */ class MiscFeatures { @SubscribeEvent @@ -32,6 +32,7 @@ class MiscFeatures { EnumParticleTypes.EXPLOSION_HUGE, EnumParticleTypes.EXPLOSION_NORMAL, -> event.isCanceled = true + else -> {} } } @@ -50,4 +51,4 @@ class MiscFeatures { fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "mobs", "combat.mobs") } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index f4ce726f4..80c3b870d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -58,6 +58,7 @@ class NonGodPotEffectDisplay { GREAT_SPOOK("§fGreat Spook I", inventoryItemName = "§fGreat Spook Potion"), ; } + // TODO USE SH-REPO private var patternEffectsCount = "§7You have §e(?<name>\\d+) §7non-god effects\\.".toPattern() private var totalEffectsCount = 0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt index c3d45ccee..2f47b3db1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt @@ -72,13 +72,16 @@ class PlayerChatSymbols { if (!component.text_skyhanni().contains(rankAndName)) return false val oldText = component.text_skyhanni() - component.setText_skyhanni(component.text_skyhanni().replace(oldText, getNewText(emblemText, oldText, rankAndName))) + component.setText_skyhanni( + component.text_skyhanni().replace(oldText, getNewText(emblemText, oldText, rankAndName)) + ) return true } - private fun getNewText(emblemText: String, oldText: String, rankAndName: String): String = when (config.symbolLocation) { - 0 -> oldText.replace(rankAndName, "$emblemText $rankAndName") - 1 -> oldText.replace(rankAndName, "$rankAndName $emblemText ") - else -> oldText - } -}
\ No newline at end of file + private fun getNewText(emblemText: String, oldText: String, rankAndName: String): String = + when (config.symbolLocation) { + 0 -> oldText.replace(rankAndName, "$emblemText $rankAndName") + 1 -> oldText.replace(rankAndName, "$rankAndName $emblemText ") + else -> oldText + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt index f4da6126b..6ca018c9f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt @@ -43,12 +43,12 @@ class SuperpairsClicksAlert { if ( // checks if we have succeeded in either minigame (event.inventoryName.contains("Chronomatron") - && ((event.inventoryItems[4]?.displayName?.removeColor() + && ((event.inventoryItems[4]?.displayName?.removeColor() ?.let { currentRoundRegex.find(it) } ?.groups?.get(1)?.value?.toInt() ?: -1) > roundsNeeded)) || (event.inventoryName.contains("Ultrasequencer") - && event.inventoryItems.entries + && event.inventoryItems.entries .filter { it.key < 45 } .any { it.value.stackSize > roundsNeeded }) ) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt index bcee7863f..4298edf21 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt @@ -32,7 +32,8 @@ class TimeFeatures { if (!LorenzUtils.inSkyBlock) return if (config.realTime) { - val currentTime = (if (config.realTimeFormatToggle) timeFormat12h else timeFormat24h).format(System.currentTimeMillis()) + val currentTime = + (if (config.realTimeFormatToggle) timeFormat12h else timeFormat24h).format(System.currentTimeMillis()) config.realTimePosition.renderString(currentTime, posLabel = "Real Time") } @@ -56,4 +57,4 @@ class TimeFeatures { event.move(2, "misc.timeConfigs.realTime", "gui.realTime") event.move(2, "misc.timeConfigs.realTimePos", "gui.realTimePosition") } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt index 3f7f537ed..a81205ce7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt @@ -13,6 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent // heavily inspired by SBA code object TabListReader { private val config get() = SkyHanniMod.feature.misc.compactTabList + // TODO USE SH-REPO var hypixelAdvertisingString = "HYPIXEL.NET" private val godPotPattern = "You have a God Potion active! (?<timer>[\\w ]+)".toPattern() @@ -221,4 +222,4 @@ object TabListReader { } } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index e95132ff7..780ed54c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -371,7 +371,9 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?) }), AFK({ - if (beenAfkFor.passedSince() > 5.minutes) "AFK for ${beenAfkFor.passedSince().format(maxUnits = 1, longName = true)}" + if (beenAfkFor.passedSince() > 5.minutes) "AFK for ${ + beenAfkFor.passedSince().format(maxUnits = 1, longName = true) + }" else AutoStatus.AFK.placeholderText }) ; diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index 6127266d9..7586805df 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -232,7 +232,8 @@ object TrevorFeatures { location = LorenzVec(location.x, TrevorSolver.averageHeight, location.z) } if (TrevorSolver.mobLocation == CurrentMobArea.FOUND) { - val displayName = if (TrevorSolver.currentMob == null) "Mob Location" else TrevorSolver.currentMob!!.mobName + val displayName = + if (TrevorSolver.currentMob == null) "Mob Location" else TrevorSolver.currentMob!!.mobName location = TrevorSolver.mobCoordinates event.drawWaypointFilled(location.add(0, -2, 0), LorenzColor.GREEN.toColor(), true, true) event.drawDynamicText(location.add(0, 1, 0), displayName, 1.5) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt index f2e36db59..86f917d35 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt @@ -17,7 +17,8 @@ object TrevorTracker { private val config get() = SkyHanniMod.feature.misc.trevorTheTrapper // TODO USE SH-REPO - private val selfKillMobPattern = "§aYour mob died randomly, you are rewarded §r§5(?<pelts>.*) pelts§r§a.".toPattern() + private val selfKillMobPattern = + "§aYour mob died randomly, you are rewarded §r§5(?<pelts>.*) pelts§r§a.".toPattern() private val killMobPattern = "§aKilling the animal rewarded you §r§5(?<pelts>.*) pelts§r§a.".toPattern() private var display = emptyList<List<Any>>() @@ -78,7 +79,7 @@ object TrevorTracker { if (matcher.matches()) { val pelts = matcher.group("pelts").toInt() storage.peltsGained += pelts - storage.selfKillingAnimals += 1 + storage.selfKillingAnimals += 1 saveAndUpdate() } matcher = killMobPattern.matcher(event.message) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt index 9d68aebde..b3539c131 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt @@ -47,7 +47,7 @@ class GuiOptionEditorUpdateCheck(option: ProcessedOption) : GuiOptionEditor(opti val sameVersion = currentVersion.equals(nextVersion, true) TextRenderUtils.drawStringCenteredScaledMaxWidth( "${if (UpdateManager.updateState == UpdateManager.UpdateState.NONE) GREEN else RED}$currentVersion" + - if (nextVersion != null && !sameVersion) "➜ ${GREEN}${nextVersion}" else "", + if (nextVersion != null && !sameVersion) "➜ ${GREEN}${nextVersion}" else "", fr, widthRemaining / 4F, 10F, @@ -85,4 +85,4 @@ class GuiOptionEditorUpdateCheck(option: ProcessedOption) : GuiOptionEditor(opti override fun fulfillsSearch(word: String): Boolean { return super.fulfillsSearch(word) || word in "download" || word in "update" } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt index 49c22b26d..b6a8feca2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt @@ -137,7 +137,11 @@ open class VisualWordGui : GuiScreen() { inBox = true } - drawUnmodifiedString("${index + 1}.", (guiLeft + 5) * inverseScale, (adjustedY + 10 + 30 * index) * inverseScale) + drawUnmodifiedString( + "${index + 1}.", + (guiLeft + 5) * inverseScale, + (adjustedY + 10 + 30 * index) * inverseScale + ) val top = adjustedY + 30 * index + 7 if (isPointInLastClicked(guiLeft + 335, top, 16, 16)) { @@ -167,7 +171,14 @@ open class VisualWordGui : GuiScreen() { } if (inBox) { - GuiRenderUtils.drawScaledRec(guiLeft, adjustedY + 30 * index, guiLeft + sizeX, adjustedY + 30 * index + 30, colorB, inverseScale) + GuiRenderUtils.drawScaledRec( + guiLeft, + adjustedY + 30 * index, + guiLeft + sizeX, + adjustedY + 30 * index + 30, + colorB, + inverseScale + ) } val statusBlock = if (phrase.enabled) { @@ -190,11 +201,27 @@ open class VisualWordGui : GuiScreen() { GlStateManager.scale(scale, scale, 1f) if (inBox) { - drawUnmodifiedString(phrase.phrase, (guiLeft + 15) * inverseScale, (adjustedY + 5 + 30 * index) * inverseScale) - drawUnmodifiedString(phrase.replacement, (guiLeft + 15) * inverseScale, (adjustedY + 15 + 30 * index) * inverseScale) + drawUnmodifiedString( + phrase.phrase, + (guiLeft + 15) * inverseScale, + (adjustedY + 5 + 30 * index) * inverseScale + ) + drawUnmodifiedString( + phrase.replacement, + (guiLeft + 15) * inverseScale, + (adjustedY + 15 + 30 * index) * inverseScale + ) } else { - drawUnmodifiedString(phrase.phrase.convertToFormatted(), (guiLeft + 15) * inverseScale, (adjustedY + 5 + 30 * index) * inverseScale) - drawUnmodifiedString(phrase.replacement.convertToFormatted(), (guiLeft + 15) * inverseScale, (adjustedY + 15 + 30 * index) * inverseScale) + drawUnmodifiedString( + phrase.phrase.convertToFormatted(), + (guiLeft + 15) * inverseScale, + (adjustedY + 5 + 30 * index) * inverseScale + ) + drawUnmodifiedString( + phrase.replacement.convertToFormatted(), + (guiLeft + 15) * inverseScale, + (adjustedY + 15 + 30 * index) * inverseScale + ) } } @@ -256,17 +283,45 @@ open class VisualWordGui : GuiScreen() { GlStateManager.scale(0.75f, 0.75f, 1f) - drawUnmodifiedString("§bThe top line of each section", (guiLeft + 10) * inverseScale, (guiTop + 12) * inverseScale) - drawUnmodifiedString("§bis the preview of the bottom text", (guiLeft + 10) * inverseScale, (guiTop + 22) * inverseScale) - - drawUnmodifiedString("§bTo get the Minecraft", (guiLeft + 220) * inverseScale, (guiTop + 12) * inverseScale) - drawUnmodifiedString("§b formatting character use \"&&\"", (guiLeft + 220) * inverseScale, (guiTop + 22) * inverseScale) - - drawUnmodifiedString(currentPhrase.phrase.convertToFormatted(), (guiLeft + 30) * inverseScale, (guiTop + 40) * inverseScale) + drawUnmodifiedString( + "§bThe top line of each section", + (guiLeft + 10) * inverseScale, + (guiTop + 12) * inverseScale + ) + drawUnmodifiedString( + "§bis the preview of the bottom text", + (guiLeft + 10) * inverseScale, + (guiTop + 22) * inverseScale + ) + + drawUnmodifiedString( + "§bTo get the Minecraft", + (guiLeft + 220) * inverseScale, + (guiTop + 12) * inverseScale + ) + drawUnmodifiedString( + "§b formatting character use \"&&\"", + (guiLeft + 220) * inverseScale, + (guiTop + 22) * inverseScale + ) + + drawUnmodifiedString( + currentPhrase.phrase.convertToFormatted(), + (guiLeft + 30) * inverseScale, + (guiTop + 40) * inverseScale + ) drawUnmodifiedString(currentPhrase.phrase, (guiLeft + 30) * inverseScale, (guiTop + 55) * inverseScale) - drawUnmodifiedString(currentPhrase.replacement.convertToFormatted(), (guiLeft + 30) * inverseScale, (guiTop + 95) * inverseScale) - drawUnmodifiedString(currentPhrase.replacement, (guiLeft + 30) * inverseScale, (guiTop + 110) * inverseScale) + drawUnmodifiedString( + currentPhrase.replacement.convertToFormatted(), + (guiLeft + 30) * inverseScale, + (guiTop + 95) * inverseScale + ) + drawUnmodifiedString( + currentPhrase.replacement, + (guiLeft + 30) * inverseScale, + (guiTop + 110) * inverseScale + ) GlStateManager.scale(inverseScale, inverseScale, 1f) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt index 74b94c0c9..8d7507e12 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt @@ -65,5 +65,5 @@ class AshfangBlazingSouls { } private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && - DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) -}
\ No newline at end of file + DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt index 161df6a8c..5fd7a3b77 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt @@ -51,6 +51,6 @@ class AshfangFreezeCooldown { private fun isEnabled(): Boolean { return LorenzUtils.inSkyBlock && config.freezeCooldown && - DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) + DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt index 68837bad4..5b3fc60de 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt @@ -23,7 +23,7 @@ class AshfangGravityOrbs { private val config get() = SkyHanniMod.feature.crimsonIsle.ashfang.gravityOrbs private val texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV" + - "0L3RleHR1cmUvMWE2OWNjZjdhZDkwNGM5YTg1MmVhMmZmM2Y1YjRlMjNhZGViZjcyZWQxMmQ1ZjI0Yjc4Y2UyZDQ0YjRhMiJ9fX0=" + "0L3RleHR1cmUvMWE2OWNjZjdhZDkwNGM5YTg1MmVhMmZmM2Y1YjRlMjNhZGViZjcyZWQxMmQ1ZjI0Yjc4Y2UyZDQ0YjRhMiJ9fX0=" private val orbs = mutableListOf<EntityArmorStand>() @SubscribeEvent @@ -68,5 +68,5 @@ class AshfangGravityOrbs { } private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && - DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) -}
\ No newline at end of file + DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt index 99351747f..157c260fa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt @@ -28,5 +28,5 @@ class AshfangHideDamageIndicator { private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.crimsonIsle.ashfang.hide.damageSplash && - DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) -}
\ No newline at end of file + DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt index 42d98cdbb..68c3d9382 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt @@ -60,6 +60,6 @@ class AshfangNextResetCooldown { private fun isEnabled(): Boolean { return LorenzUtils.inSkyBlock && config.nextResetCooldown && - DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) + DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt index 39e888ade..a14da5859 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt @@ -46,8 +46,8 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH if (!message.contains("KUUDRA DOWN!") || message.contains(":")) return for (line in ScoreboardData.sidebarLines) { - if(line.contains("Kuudra's") && line.contains("Hollow") && line.contains("(")){ - val tier = line.substringAfter("(T").substring(0,1).toInt() + if (line.contains("Kuudra's") && line.contains("Hollow") && line.contains("(")) { + val tier = line.substringAfter("(T").substring(0, 1).toInt() val kuudraTier = getByTier(tier)!! finished(kuudraTier) return @@ -129,4 +129,4 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH private fun getByDisplayName(name: String) = kuudraTiers.firstOrNull { it.name == name } private fun getByTier(number: Int) = kuudraTiers.firstOrNull { it.tierNumber == number } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index 10eae5816..be90eec14 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -57,11 +57,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel private fun needMiniBossQuest(miniBoss: CrimsonMiniBoss): Boolean { val bossQuest = reputationHelper.questHelper.getQuest<MiniBossQuest>() - if (bossQuest != null && bossQuest.miniBoss == miniBoss && bossQuest.state == QuestState.ACCEPTED) { - return true - } - - return false + return bossQuest != null && bossQuest.miniBoss == miniBoss && bossQuest.state == QuestState.ACCEPTED } private fun finished(miniBoss: CrimsonMiniBoss) { @@ -123,4 +119,4 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel } private fun getByDisplayName(name: String) = miniBosses.firstOrNull { it.displayName == name } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt index 507dc5953..780d8494c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt @@ -29,6 +29,8 @@ object RiftAPI { fun inLivingCave() = LorenzUtils.skyBlockArea == "Living Cave" fun inLivingStillness() = LorenzUtils.skyBlockArea == "Living Stillness" - fun inStillgoreChateau() = LorenzUtils.skyBlockArea == "Stillgore Château" || LorenzUtils.skyBlockArea == "Oubliette" + fun inStillgoreChateau() = + LorenzUtils.skyBlockArea == "Stillgore Château" || LorenzUtils.skyBlockArea == "Oubliette" + fun inDreadfarm() = LorenzUtils.skyBlockArea == "Dreadfarm" } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt index 1257f8db4..88b2939c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt @@ -77,9 +77,9 @@ class LivingCaveDefenseBlocks { // read new entity data val compareLocation = event.location.add(-0.5, -1.5, -0.5) entity = EntityUtils.getEntitiesNearby<EntityOtherPlayerMP>(compareLocation, 2.0) - .filter { isCorrectMob(it.name) } - .filter { !it.isAtFullHealth() } - .minByOrNull { it.distanceTo(compareLocation) } + .filter { isCorrectMob(it.name) } + .filter { !it.isAtFullHealth() } + .minByOrNull { it.distanceTo(compareLocation) } } val defenseBlock = entity?.let { DefenseBlock(it, location) } ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt index cabc094db..cc237c6c5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt @@ -67,7 +67,11 @@ class LivingCaveLivingMetalHelper { val percentage = diff.toDouble() / maxTime a.slope(b, 1 - percentage) } else b - event.drawWaypointFilled(location, LorenzColor.AQUA.toColor(), seeThroughBlocks = location.distanceToPlayer() < 10) + event.drawWaypointFilled( + location, + LorenzColor.AQUA.toColor(), + seeThroughBlocks = location.distanceToPlayer() < 10 + ) } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt index 04c4ba332..b908f49f8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt @@ -15,7 +15,7 @@ class RiftHorsezookaHider { if (!SkyHanniMod.feature.rift.horsezookaHider) return if (event.entity is EntityHorse && InventoryUtils.itemInHandId.equals("HORSEZOOKA")) { - event.isCanceled = true + event.isCanceled = true } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt index 966b8bdaa..b26fd4c09 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt @@ -116,7 +116,8 @@ class SlayerRngMeterDisplay { val storage = getStorage() ?: return - val selectedItem = event.inventoryItems.values.find { item -> item.getLore().any { it.contains("§a§lSELECTED") } } + val selectedItem = + event.inventoryItems.values.find { item -> item.getLore().any { it.contains("§a§lSELECTED") } } if (selectedItem == null) { storage.itemGoal = "" storage.goalNeeded = -1 diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt index 4d5d9fa34..a536398a7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt @@ -16,6 +16,5 @@ enum class SlayerType(val displayName: String, val clazz: Class<*>) { VAMPIRE("Riftstalker Bloodfiend", EntityOtherPlayerMP::class.java) ; - companion object { - } -}
\ No newline at end of file + companion object +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt index 4d1423880..74c15c271 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt @@ -51,6 +51,7 @@ class BlazeSlayerFirePitsWarning { -> { fireFirePits() } + else -> {} } } @@ -70,4 +71,4 @@ class BlazeSlayerFirePitsWarning { fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.firePitsWarning", "slayer.blazes.firePitsWarning") } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt index f2f0f874d..6b4757e21 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -88,7 +88,7 @@ class SummoningMobManager { healthPattern.matchMatcher(name) { val playerName = LorenzUtils.getPlayerName() if (name.contains(playerName)) { - summoningMobNametags.add(it as EntityArmorStand) + summoningMobNametags.add(it) if (summoningMobNametags.size == summoningsSpawned) { searchArmorStands = false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index 8f0825188..602a610df 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -20,10 +20,10 @@ class SummoningSoulsName { private val texture = "ewogICJ0aW1lc3RhbXAiIDogMTYwMTQ3OTI2NjczMywKICAicHJvZmlsZUlkIiA6ICJmMzA1ZjA5NDI0NTg0ZjU" + - "4YmEyYjY0ZjAyZDcyNDYyYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJqcm9ja2EzMyIsCiAgInNpZ25hdH" + - "VyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgI" + - "nVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81YWY0MDM1ZWMwZGMx" + - "NjkxNzc4ZDVlOTU4NDAxNzAyMjdlYjllM2UyOTQzYmVhODUzOTI5Y2U5MjNjNTk4OWFkIgogICAgfQogIH0KfQ" + "4YmEyYjY0ZjAyZDcyNDYyYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJqcm9ja2EzMyIsCiAgInNpZ25hdH" + + "VyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgI" + + "nVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81YWY0MDM1ZWMwZGMx" + + "NjkxNzc4ZDVlOTU4NDAxNzAyMjdlYjllM2UyOTQzYmVhODUzOTI5Y2U5MjNjNTk4OWFkIgogICAgfQogIH0KfQ" private val souls = mutableMapOf<EntityArmorStand, String>() private val mobsLastLocation = mutableMapOf<EntityLiving, LorenzVec>() @@ -89,4 +89,4 @@ class SummoningSoulsName { } private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.combat.summonings.summoningSoulDisplay -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt index a2fc3ad76..8eadaa3e4 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt @@ -98,7 +98,7 @@ object FontRendererHook { } @JvmStatic - fun forceWhiteColorCode(i1: Int) : Int { + fun forceWhiteColorCode(i1: Int): Int { if (!LorenzUtils.inSkyBlock) return i1 if (!SkyHanniMod.feature.chroma.enabled) return i1 @@ -142,7 +142,14 @@ object FontRendererHook { } @JvmStatic - fun toggleChromaCondition_shouldResetStyles(text: String, shadow: Boolean, ci: CallbackInfo, i: Int, c0: Char, i1: Int): Boolean { + fun toggleChromaCondition_shouldResetStyles( + text: String, + shadow: Boolean, + ci: CallbackInfo, + i: Int, + c0: Char, + i1: Int + ): Boolean { if (!LorenzUtils.inSkyBlock) return false if (!SkyHanniMod.feature.chroma.enabled) return false if (i1 == 22) { @@ -151,4 +158,4 @@ object FontRendererHook { } return false } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinFontRenderer.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinFontRenderer.java index 2b3d87c5c..b8a759ed0 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinFontRenderer.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinFontRenderer.java @@ -37,8 +37,8 @@ public abstract class MixinFontRenderer { * Inject call to {@link FontRendererHook#restoreChromaState()} after 1st and 3rd fontrenderer.italicStyle = ___ call */ @Inject(method = "renderStringAtPos", at = { - @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/gui/FontRenderer;italicStyle:Z", ordinal = 0, shift = At.Shift.AFTER), - @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/gui/FontRenderer;italicStyle:Z", ordinal = 2, shift = At.Shift.AFTER)}) + @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/gui/FontRenderer;italicStyle:Z", ordinal = 0, shift = At.Shift.AFTER), + @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/gui/FontRenderer;italicStyle:Z", ordinal = 2, shift = At.Shift.AFTER)}) public void insertRestoreChromaState(CallbackInfo ci) { FontRendererHook.restoreChromaState(); } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiContainer.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiContainer.java index ed106f6f1..57fd96a70 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiContainer.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiContainer.java @@ -52,12 +52,12 @@ public abstract class MixinGuiContainer extends GuiScreen { } @Inject(method = "drawScreen", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/entity/player/InventoryPlayer;getItemStack()Lnet/minecraft/item/ItemStack;", - shift = At.Shift.BEFORE, - ordinal = 1 - ) + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/entity/player/InventoryPlayer;getItemStack()Lnet/minecraft/item/ItemStack;", + shift = At.Shift.BEFORE, + ordinal = 1 + ) ) public void drawScreen_after(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { skyHanni$hook.onDrawScreenAfter(mouseX, mouseY, ci); diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt index 0534c2a72..cee60e7ae 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt @@ -182,7 +182,7 @@ object SkyHanniConfigSearchResetCommand { if (!classFilter(className)) continue val objectName = obj.getObjectName() if (obj !is Runnable && objectName.startsWith(className) && (objectName.startsWith("at.hannibal2.skyhanni.config.features.") || - objectName.startsWith("at.hannibal2.skyhanni.config.Storage")) + objectName.startsWith("at.hannibal2.skyhanni.config.Storage")) ) { "<category>" } else { diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt index fa7fc2e6e..67b28f0aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt @@ -65,7 +65,7 @@ object CopyNearbyParticlesCommand { resultList.add("particle arguments: ${packet.particleArgs.asList()}") resultList.add("") resultList.add("") - counter ++ + counter++ } } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt index 7436ac7f6..b940d1948 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt @@ -11,11 +11,11 @@ object CopyScoreboardCommand { val resultList = mutableListOf<String>() val noColor = args.size == 1 && args[0] == "true" resultList.add("Title:") - resultList.add(ScoreboardData.objectiveTitle.transformIf({noColor}) { removeColor() }) + resultList.add(ScoreboardData.objectiveTitle.transformIf({ noColor }) { removeColor() }) resultList.add("") for (line in ScoreboardData.sidebarLinesFormatted) { - val scoreboardLine = line.transformIf({noColor}) { removeColor() } + val scoreboardLine = line.transformIf({ noColor }) { removeColor() } resultList.add("'$scoreboardLine'") } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt index 5e935b407..1801e7802 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt @@ -41,9 +41,13 @@ object APIUtil { .useSystemProperties() fun getJSONResponse(urlString: String, silentError: Boolean = false) = - getJSONResponseAsElement(urlString, silentError) as JsonObject + getJSONResponseAsElement(urlString, silentError) as JsonObject - fun getJSONResponseAsElement(urlString: String, silentError: Boolean = false, apiName: String = "Hypixel API"): JsonElement { + fun getJSONResponseAsElement( + urlString: String, + silentError: Boolean = false, + apiName: String = "Hypixel API" + ): JsonElement { val client = builder.build() try { client.execute(HttpGet(urlString)).use { response -> diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt b/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt index 8f05d64ec..78cc8684d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt @@ -1,11 +1,18 @@ package at.hannibal2.skyhanni.utils data class CachedItemData( - /** -1 = not loaded */ var petCandies: Int? = -1, - /** "" = not loaded */ var heldItem: String? = "", - /** -1 = not loaded */ var sackInASack: Int? = -1, - /** null = not loaded */ var riftTransferable: Boolean? = null, - /** null = not loaded */ var riftExportable: Boolean? = null, - /** null = not loaded */ var itemRarityLastCheck: Long = 0L, // Cant use SimpleTimeMark here - /** null = not loaded */ var itemRarity: LorenzRarity? = null, -)
\ No newline at end of file + /** -1 = not loaded */ + var petCandies: Int? = -1, + /** "" = not loaded */ + var heldItem: String? = "", + /** -1 = not loaded */ + var sackInASack: Int? = -1, + /** null = not loaded */ + var riftTransferable: Boolean? = null, + /** null = not loaded */ + var riftExportable: Boolean? = null, + /** null = not loaded */ + var itemRarityLastCheck: Long = 0L, // Cant use SimpleTimeMark here + /** null = not loaded */ + var itemRarity: LorenzRarity? = null, +) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt index fbe2f1e96..4ac55af01 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt @@ -104,13 +104,13 @@ object EntityOutlineRenderer { mc.renderManager.setRenderOutlines(true) // Enable outline mode - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL13.GL_COMBINE); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_COMBINE_RGB, GL11.GL_REPLACE); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_SOURCE0_RGB, GL13.GL_CONSTANT); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_COMBINE_ALPHA, GL11.GL_REPLACE); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE); - GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL13.GL_COMBINE) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_COMBINE_RGB, GL11.GL_REPLACE) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_SOURCE0_RGB, GL13.GL_CONSTANT) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_COMBINE_ALPHA, GL11.GL_REPLACE) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE) + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL13.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA) // Render x-ray outlines first, ignoring the depth buffer bit if (!isXrayCacheEmpty()) { @@ -293,7 +293,7 @@ object EntityOutlineRenderer { // Only render the view entity when sleeping or in 3rd person mode if (entity === mc.renderViewEntity && !(mc.renderViewEntity is EntityLivingBase && (mc.renderViewEntity as EntityLivingBase).isPlayerSleeping || - mc.gameSettings.thirdPersonView != 0) + mc.gameSettings.thirdPersonView != 0) ) { false } else mc.theWorld.isBlockLoaded(BlockPos(entity)) && (mc.renderManager.shouldRender( @@ -361,7 +361,7 @@ object EntityOutlineRenderer { */ @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (!(event.phase == EventPriority.NORMAL && isEnabled())) return; + if (!(event.phase == EventPriority.NORMAL && isEnabled())) return val renderGlobal = try { mc.renderGlobal as CustomRenderGlobal @@ -406,4 +406,4 @@ object EntityOutlineRenderer { var noXrayCache: HashMap<Entity, Int>?, var noOutlineCache: HashSet<Entity>? ) -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt index c485ec20b..5e4a63452 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt @@ -180,7 +180,15 @@ object GuiRenderUtils { ) } - fun renderItemAndTip(list: MutableList<String>, item: ItemStack?, x: Int, y: Int, mouseX: Int, mouseY: Int, color: Int = 0xFF43464B.toInt()) { + fun renderItemAndTip( + list: MutableList<String>, + item: ItemStack?, + x: Int, + y: Int, + mouseX: Int, + mouseY: Int, + color: Int = 0xFF43464B.toInt() + ) { GuiScreen.drawRect(x, y, x + 16, y + 16, color) if (item != null) { renderItemStack(item, x, y) @@ -276,8 +284,10 @@ object GuiRenderUtils { } fun drawScaledRec(left: Int, top: Int, right: Int, bottom: Int, colour: Int, inverseScale: Float) { - GuiScreen.drawRect((left * inverseScale).toInt(), (top * inverseScale).toInt(), - (right * inverseScale).toInt(), (bottom * inverseScale).toInt(), colour) + GuiScreen.drawRect( + (left * inverseScale).toInt(), (top * inverseScale).toInt(), + (right * inverseScale).toInt(), (bottom * inverseScale).toInt(), colour + ) } fun renderItemAndBackground(item: ItemStack, x: Int, y: Int, colour: Int) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index 2a6b002af..be29569a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -45,7 +45,7 @@ object InventoryUtils { fun inStorage() = openInventoryName().let { (it.contains("Storage") && !it.contains("Rift Storage")) - || it.contains("Ender Chest") || it.contains("Backpack") + || it.contains("Ender Chest") || it.contains("Backpack") } fun getItemInHand(): ItemStack? = Minecraft.getMinecraft().thePlayer.heldItem diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index ee373d6b1..3aa432cde 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -73,9 +73,9 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { } } if (loggerName == "AsmHelper" && filterConfig.filterAmsHelperTransformer) { - if (formattedMessage.startsWith("Transforming class ")) { - filterConsole("AsmHelper Transforming") - return Filter.Result.DENY + if (formattedMessage.startsWith("Transforming class ")) { + filterConsole("AsmHelper Transforming") + return Filter.Result.DENY } if (filterConfig.filterAsmHelperApplying && formattedMessage.startsWith("Applying AsmWriter ModifyWriter")) { filterConsole("AsmHelper Applying AsmWriter") @@ -118,7 +118,7 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { } } - if (thrown != null && filterConfig.filterScoreboardErrors) { + if (thrown != null && filterConfig.filterScoreboardErrors) { val cause = thrown.cause if (cause != null && cause.stackTrace.isNotEmpty()) { val first = cause.stackTrace[0] @@ -241,13 +241,25 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.printUnfilteredDebugs", "dev.minecraftConsoles.printUnfilteredDebugs") event.move(3, "dev.logUnfilteredFile", "dev.minecraftConsoles.logUnfilteredFile") - event.move(3, "dev.printUnfilteredDebugsOutsideSkyBlock", "dev.minecraftConsoles.printUnfilteredDebugsOutsideSkyBlock") + event.move( + 3, + "dev.printUnfilteredDebugsOutsideSkyBlock", + "dev.minecraftConsoles.printUnfilteredDebugsOutsideSkyBlock" + ) event.move(3, "dev.printFilteredReason", "dev.minecraftConsoles.printFilteredReason") event.move(3, "dev.filterChat", "dev.minecraftConsoles.consoleFilter.filterChat") event.move(3, "dev.filterGrowBuffer", "dev.minecraftConsoles.consoleFilter.filterGrowBuffer") event.move(3, "dev.filterUnknownSound", "dev.minecraftConsoles.consoleFilter.filterUnknownSound") - event.move(3, "dev.filterParticleVillagerHappy", "dev.minecraftConsoles.consoleFilter.filterParticleVillagerHappy") - event.move(3, "dev.filterAmsHelperTransformer", "dev.minecraftConsoles.consoleFilter.filterAmsHelperTransformer") + event.move( + 3, + "dev.filterParticleVillagerHappy", + "dev.minecraftConsoles.consoleFilter.filterParticleVillagerHappy" + ) + event.move( + 3, + "dev.filterAmsHelperTransformer", + "dev.minecraftConsoles.consoleFilter.filterAmsHelperTransformer" + ) event.move(3, "dev.filterAsmHelperApplying", "dev.minecraftConsoles.consoleFilter.filterAsmHelperApplying") event.move(3, "dev.filterBiomeIdBounds", "dev.minecraftConsoles.consoleFilter.filterBiomeIdBounds") event.move(3, "dev.filterScoreboardErrors", "dev.minecraftConsoles.consoleFilter.filterScoreboardErrors") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index e5c45bab1..007d9f1d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -185,8 +185,8 @@ object NEUItems { ErrorManager.logError( IllegalStateException("Something went wrong!"), "Encountered an error getting the item for §7$this§c. " + - "This may be because your NEU repo is outdated. Please ask in the SkyHanni " + - "Discord if this is the case" + "This may be because your NEU repo is outdated. Please ask in the SkyHanni " + + "Discord if this is the case" ) fallbackItem } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index c9903ffc2..e8acae501 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -53,7 +53,9 @@ class ParkourHelper( if (visible) { for ((index, location) in locations.withIndex()) { - if (location.offsetCenter().distanceToPlayer() < detectionRange && Minecraft.getMinecraft().thePlayer.onGround) { + if (location.offsetCenter() + .distanceToPlayer() < detectionRange && Minecraft.getMinecraft().thePlayer.onGround + ) { current = index } } @@ -146,4 +148,4 @@ class ParkourHelper( private fun colorForIndex(index: Int) = if (rainbowColor) { RenderUtils.chromaColor(4.seconds, offset = -index / 12f, brightness = 0.7f) } else monochromeColor -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt index 326283d92..c9892a9bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation object SoundUtils { private val beepSound by lazy { createSound("random.orb", 1f) } private val clickSound by lazy { createSound("gui.button.press", 1f) } - private val errorSound by lazy {createSound("mob.endermen.portal", 0f)} + private val errorSound by lazy { createSound("mob.endermen.portal", 0f) } val centuryActiveTimerAlert by lazy { createSound("skyhanni:centurytimer.active", 1f) } fun ISound.playSound() { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index 2066b809b..dd114d8fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -18,7 +18,8 @@ import java.util.regex.Pattern object StringUtils { // TODO USE SH-REPO private val playerChatPattern = "(?<important>.*?)(?:§[f7r])*: .*".toPattern() - private val chatUsernamePattern = "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?<rankedName>(?:§\\w\\[\\w.+] )?(?:§\\w)?(?<username>\\w+))(?: (?:§\\w)?\\[.+?])?".toPattern() + private val chatUsernamePattern = + "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?<rankedName>(?:§\\w\\[\\w.+] )?(?:§\\w)?(?<username>\\w+))(?: (?:§\\w)?\\[.+?])?".toPattern() private val whiteSpaceResetPattern = "^(?:\\s|§r)*|(?:\\s|§r)*$".toPattern() private val whiteSpacePattern = "^\\s*|\\s*$".toPattern() private val resetPattern = "(?i)§R".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt b/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt index 55ea90b52..2a6d1f5ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt @@ -11,7 +11,7 @@ class Timer( private var started: SimpleTimeMark = SimpleTimeMark.now(), startPaused: Boolean = false -): Comparable<Timer> { +) : Comparable<Timer> { @Expose private var paused: SimpleTimeMark? = null @@ -40,4 +40,4 @@ class Timer( override fun compareTo(other: Timer): Int = remaining.compareTo(other.remaining) -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ContributorListJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ContributorListJson.java index 6ab663941..8e5648f5e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ContributorListJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/ContributorListJson.java @@ -1,4 +1,5 @@ package at.hannibal2.skyhanni.utils.jsonobjects; + import com.google.gson.annotations.Expose; import java.util.List; @@ -6,4 +7,4 @@ import java.util.List; public class ContributorListJson { @Expose public List<String> usernames; -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java index bc877658a..d2173c74b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/MayorJson.java @@ -27,11 +27,11 @@ public class MayorJson { @Override public String toString() { return "Candidate{" + - "key='" + key + '\'' + - ", name='" + name + '\'' + - ", perks=" + perks + - ", votes=" + votes + - '}'; + "key='" + key + '\'' + + ", name='" + name + '\'' + + ", perks=" + perks + + ", votes=" + votes + + '}'; } } @@ -62,9 +62,9 @@ public class MayorJson { @Override public String toString() { return "Perk{" + - "name='" + name + '\'' + - ", description='" + description + '\'' + - '}'; + "name='" + name + '\'' + + ", description='" + description + '\'' + + '}'; } } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SeaCreatureJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SeaCreatureJson.java index 52ed7f636..8053e87cb 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SeaCreatureJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SeaCreatureJson.java @@ -9,7 +9,8 @@ import java.util.Map; public class SeaCreatureJson {
- public static Type TYPE = new TypeToken<Map<String, SeaCreatureJson.Variant>>(){}.getType();
+ public static Type TYPE = new TypeToken<Map<String, SeaCreatureJson.Variant>>() {
+ }.getType();
public static class Variant {
@Expose
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt index 2a3321abc..552e1a069 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -21,7 +21,7 @@ interface Renderable { val height: Int fun isHovered(posX: Int, posY: Int) = currentRenderPassMousePosition?.let { (x, y) -> x in (posX..posX + width) - && y in (posY..posY + height) // TODO: adjust for variable height? + && y in (posY..posY + height) // TODO: adjust for variable height? } ?: false /** diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt index f198f7e7a..7fb13ab86 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt @@ -30,7 +30,7 @@ abstract class Shader(vertex: String, fragment: String) { if (linkStatus == GL11.GL_FALSE) { LorenzUtils.consoleLog( "Error occurred when linking program with Vertex Shader: $vertex and Fragment Shader: $fragment : " + - StringUtils.trim(ShaderHelper.glGetProgramInfoLog(shaderProgram, 1024)) + StringUtils.trim(ShaderHelper.glGetProgramInfoLog(shaderProgram, 1024)) ) } @@ -52,4 +52,4 @@ abstract class Shader(vertex: String, fragment: String) { fun <T> registerUniform(uniformType: Uniform.UniformType<T>, name: String, uniformValuesSupplier: Supplier<T>) { uniforms.add(Uniform(this, uniformType, name, uniformValuesSupplier)) } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt index e554a4098..790550103 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt @@ -27,9 +27,9 @@ class ShaderHelper { // Check OpenGL 2.0 Capabilities val openGL20supported = capabilities.OpenGL20 SHADERS_SUPPORTED = openGL20supported || - capabilities.GL_ARB_vertex_shader && - capabilities.GL_ARB_fragment_shader && - capabilities.GL_ARB_shader_objects + capabilities.GL_ARB_vertex_shader && + capabilities.GL_ARB_fragment_shader && + capabilities.GL_ARB_shader_objects var log = "Shaders are" if (!SHADERS_SUPPORTED) log += " not" @@ -67,12 +67,18 @@ class ShaderHelper { if (USING_ARB_SHADERS) ARBShaderObjects.glLinkProgramARB(program) else GL20.glLinkProgram(program) } - fun glGetProgramInfoLog(program: Int, maxLength: Int) : String { - return if (USING_ARB_SHADERS) ARBShaderObjects.glGetInfoLogARB(program, maxLength) else GL20.glGetProgramInfoLog(program, maxLength) + fun glGetProgramInfoLog(program: Int, maxLength: Int): String { + return if (USING_ARB_SHADERS) ARBShaderObjects.glGetInfoLogARB( + program, + maxLength + ) else GL20.glGetProgramInfoLog(program, maxLength) } - fun glGetProgrami(program: Int, pname: Int) : Int { - return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB(program, pname) else GL20.glGetProgrami(program, pname) + fun glGetProgrami(program: Int, pname: Int): Int { + return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB( + program, + pname + ) else GL20.glGetProgrami(program, pname) } fun glUseProgram(program: Int) { @@ -80,27 +86,39 @@ class ShaderHelper { } fun glAttachShader(program: Int, shaderIn: Int) { - if (USING_ARB_SHADERS) ARBShaderObjects.glAttachObjectARB(program, shaderIn) else GL20.glAttachShader(program, shaderIn) + if (USING_ARB_SHADERS) ARBShaderObjects.glAttachObjectARB(program, shaderIn) else GL20.glAttachShader( + program, + shaderIn + ) } - fun glCreateShader(type: Int) : Int { + fun glCreateShader(type: Int): Int { return if (USING_ARB_SHADERS) ARBShaderObjects.glCreateShaderObjectARB(type) else GL20.glCreateShader(type) } fun glShaderSource(shader: Int, source: CharSequence) { - if (USING_ARB_SHADERS) ARBShaderObjects.glShaderSourceARB(shader, source) else GL20.glShaderSource(shader, source) + if (USING_ARB_SHADERS) ARBShaderObjects.glShaderSourceARB(shader, source) else GL20.glShaderSource( + shader, + source + ) } fun glCompileShader(shader: Int) { if (USING_ARB_SHADERS) ARBShaderObjects.glCompileShaderARB(shader) else GL20.glCompileShader(shader) } - fun glGetShaderi(shader: Int, pname: Int) : Int { - return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB(shader, pname) else GL20.glGetShaderi(shader, pname) + fun glGetShaderi(shader: Int, pname: Int): Int { + return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB( + shader, + pname + ) else GL20.glGetShaderi(shader, pname) } - fun glGetShaderInfoLog(shader: Int, maxLength: Int) : String { - return if (USING_ARB_SHADERS) ARBShaderObjects.glGetInfoLogARB(shader, maxLength) else GL20.glGetShaderInfoLog(shader, maxLength) + fun glGetShaderInfoLog(shader: Int, maxLength: Int): String { + return if (USING_ARB_SHADERS) ARBShaderObjects.glGetInfoLogARB( + shader, + maxLength + ) else GL20.glGetShaderInfoLog(shader, maxLength) } fun glDeleteShader(shader: Int) { @@ -112,13 +130,21 @@ class ShaderHelper { } fun glUniform3f(location: Int, v0: Float, v1: Float, v2: Float) { - if (USING_ARB_SHADERS) ARBShaderObjects.glUniform3fARB(location, v0, v1, v2) else GL20.glUniform3f(location, v0, v1, v2) + if (USING_ARB_SHADERS) ARBShaderObjects.glUniform3fARB(location, v0, v1, v2) else GL20.glUniform3f( + location, + v0, + v1, + v2 + ) } - fun glGetUniformLocation(program: Int, name: CharSequence) : Int { - return if (USING_ARB_SHADERS) ARBShaderObjects.glGetUniformLocationARB(program, name) else GL20.glGetUniformLocation(program, name) + fun glGetUniformLocation(program: Int, name: CharSequence): Int { + return if (USING_ARB_SHADERS) ARBShaderObjects.glGetUniformLocationARB( + program, + name + ) else GL20.glGetUniformLocation(program, name) } fun areShadersSupported() = SHADERS_SUPPORTED } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt index e7eb48f11..3dbec3c6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt @@ -21,7 +21,7 @@ object ShaderManager { CHROMA(ChromaShader.INSTANCE); companion object { - fun getShaderInstance(shaderName: String) : Shader? = when (shaderName) { + fun getShaderInstance(shaderName: String): Shader? = when (shaderName) { "chroma" -> CHROMA.shader else -> { null @@ -58,7 +58,7 @@ object ShaderManager { activeShader = null } - fun loadShader(type: ShaderType, fileName: String) : Int { + fun loadShader(type: ShaderType, fileName: String): Int { val resourceLocation = ResourceLocation("skyhanni:shaders/$fileName${type.extension}") val source = StringBuilder() @@ -73,8 +73,10 @@ object ShaderManager { ShaderHelper.glCompileShader(shaderID) if (ShaderHelper.glGetShaderi(shaderID, ShaderHelper.GL_COMPILE_STATUS) == 0) { - LorenzUtils.consoleLog("Error occurred when compiling shader $fileName${type.extension} : " + - StringUtils.trim(ShaderHelper.glGetShaderInfoLog(shaderID, 1024))) + LorenzUtils.consoleLog( + "Error occurred when compiling shader $fileName${type.extension} : " + + StringUtils.trim(ShaderHelper.glGetShaderInfoLog(shaderID, 1024)) + ) } return shaderID @@ -84,4 +86,4 @@ object ShaderManager { enum class ShaderType(val extension: String, val shaderType: Int) { VERTEX(".vsh", ShaderHelper.GL_VERTEX_SHADER), FRAGMENT(".fsh", ShaderHelper.GL_FRAGMENT_SHADER) -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/Uniform.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/Uniform.kt index e87ea3b22..d57398ea4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/Uniform.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/Uniform.kt @@ -37,9 +37,10 @@ class Uniform<T>( val values = newUniformValue as FloatArray ShaderHelper.glUniform3f(uniformID, values[0], values[1], values[2]) } + UniformType.BOOL -> ShaderHelper.glUniform1f(uniformID, if (newUniformValue as Boolean) 1f else 0f) } previousUniformValue = newUniformValue } } -}
\ No newline at end of file +} |