From 77697fc96ada428087f8abc2022ddb82df307d20 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 1 Jan 2023 17:30:29 +0100 Subject: [PATCH 01/32] 0.13.1 color fix --- CHANGELOG.md | 5 +++++ build.gradle.kts | 2 +- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 +- .../hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff5380376ce..7e38186013da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # SkyHanni - Change Log +## Version 0.13.1 + +### Fixes ++ Dungeon level color fixed wrong colors. + ## Version 0.13 ### Features diff --git a/build.gradle.kts b/build.gradle.kts index ad8158481365..398adb850537 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "at.hannibal2.skyhanni" -version = "0.13" +version = "0.13.1" // Toolchains: java { diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index eccfc78c9cb2..fa5cc233f9ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -62,7 +62,7 @@ public class SkyHanniMod { public static final String MODID = "skyhanni"; - public static final String VERSION = "0.13"; + public static final String VERSION = "0.13.1"; public static Features feature; diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt index 796f93ef493f..740296f47fe5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt @@ -45,7 +45,7 @@ class DungeonLevelColor { if (level >= 50) return "§c§l" if (level >= 45) return "§c" if (level >= 40) return "§d" - if (level >= 35) return "§b" + if (level >= 35) return "§6" if (level >= 30) return "§5" if (level >= 25) return "§9" if (level >= 20) return "§a" From 267ef5a027c6c67f91e52cbf52a0aacb550d2378 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:12:44 +0100 Subject: [PATCH 02/32] debug command logic and console filter changes --- .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 -- .../skyhanni/features/bazaar/BazaarApi.kt | 2 +- .../skyhanni/test/command/CopyItemCommand.kt | 1 - .../java/at/hannibal2/skyhanni/utils/APIUtil.kt | 9 ++++++++- .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 17 ++++++++++++----- .../skyhanni/utils/MinecraftConsoleFilter.kt | 10 +++++++--- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index fa5cc233f9ee..a88ef4696704 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -186,11 +186,9 @@ public void preInit(FMLPreInitializationEvent event) { private void registerEvent(Object object) { listenerClasses.add(object); String simpleName = object.getClass().getSimpleName(); - consoleLog("SkyHanni registering '" + simpleName + "'"); long start = System.currentTimeMillis(); MinecraftForge.EVENT_BUS.register(object); long duration = System.currentTimeMillis() - start; - consoleLog("Done after " + duration + " ms!"); } public static GuiScreen screenToOpen = null; diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt index c2c8bcb18542..857305c27d84 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt @@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack class BazaarApi { companion object { - private val bazaarMap = mutableMapOf() + val bazaarMap = mutableMapOf() fun isBazaarInventory(inventoryName: String): Boolean { if (inventoryName.contains(" ➜ ") && !inventoryName.contains("Museum")) return true diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt index 5395dbf36bdb..92275ed6982b 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt @@ -38,7 +38,6 @@ object CopyItemCommand { val string = resultList.joinToString("\n") OSUtils.copyToClipboard(string) - LorenzUtils.debug("item info printed!") LorenzUtils.chat("§e[SkyHanni] item info copied into the clipboard!") } catch (_: Throwable) { LorenzUtils.chat("§c[SkyHanni] No item in hand!") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt index 5584da0fe8bc..908d8b81031e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.SkyHanniMod import com.google.gson.JsonObject import com.google.gson.JsonParser +import com.google.gson.stream.MalformedJsonException import org.apache.http.client.config.RequestConfig import org.apache.http.client.methods.HttpGet import org.apache.http.impl.client.HttpClientBuilder @@ -40,7 +41,13 @@ object APIUtil { val entity = response.entity if (entity != null) { val retSrc = EntityUtils.toString(entity) - return parser.parse(retSrc) as JsonObject + try { + return parser.parse(retSrc) as JsonObject + } catch (e: MalformedJsonException) { + LorenzUtils.error("MalformedJsonException!") + println("MalformedJsonException at '$urlString'") + e.printStackTrace() + } } } } catch (throwable: Throwable) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index c4c9cedca439..e37aedbc6d4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -33,11 +33,17 @@ object LorenzUtils { val inKuudraFight: Boolean get() = skyBlockIsland == "Instanced" - const val DEBUG_PREFIX = "[Debug] §7" + const val DEBUG_PREFIX = "[SkyHanni Debug] §7" private val log = LorenzLogger("chat/mod_sent") fun debug(message: String) { - internalChat(DEBUG_PREFIX + message) + if (SkyHanniMod.feature.dev.debugEnabled) { + if (internalChat(DEBUG_PREFIX + message)) { + consoleLog("[Debug] $message") + } + } else { + consoleLog("[Debug] $message") + } } fun warning(message: String) { @@ -52,21 +58,22 @@ object LorenzUtils { internalChat(message) } - private fun internalChat(message: String) { + private fun internalChat(message: String): Boolean { log.log(message) val minecraft = Minecraft.getMinecraft() if (minecraft == null) { consoleLog(message.removeColor()) - return + return false } val thePlayer = minecraft.thePlayer if (thePlayer == null) { consoleLog(message.removeColor()) - return + return false } thePlayer.addChatMessage(ChatComponentText(message)) + return true } //TODO move into StringUtils diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index c0e64c7be1e1..9882f8578351 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -130,15 +130,19 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { if (cause.stackTrace.isNotEmpty()) { val first = cause.stackTrace[0] if (SkyHanniMod.feature.dev.filterScoreboardErrors) { - if (first.toString() == "net.minecraft.scoreboard.Scoreboard.removeTeam(Scoreboard.java:229)") { + val firstName = first.toString() + if (firstName == "net.minecraft.scoreboard.Scoreboard.removeTeam(Scoreboard.java:229)" || + firstName == "net.minecraft.scoreboard.Scoreboard.removeTeam(Scoreboard.java:262)" + ) { filterConsole("NullPointerException at Scoreboard.removeTeam") return Filter.Result.DENY } - if (first.toString() == "net.minecraft.scoreboard.Scoreboard.createTeam(Scoreboard.java:218)") { + if (firstName == "net.minecraft.scoreboard.Scoreboard.createTeam(Scoreboard.java:218)") { filterConsole("IllegalArgumentException at Scoreboard.createTeam") return Filter.Result.DENY } - if (first.toString() == "net.minecraft.scoreboard.Scoreboard.removeObjective(Scoreboard.java:179)") { + if (firstName == "net.minecraft.scoreboard.Scoreboard.removeObjective(Scoreboard.java:179)" || + firstName == "net.minecraft.scoreboard.Scoreboard.removeObjective(Scoreboard.java:198)") { filterConsole("IllegalArgumentException at Scoreboard.removeObjective") return Filter.Result.DENY } From 607a7cd9802b97f8102fdc535ed03090123f05ad Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:26:46 +0100 Subject: [PATCH 03/32] Added /shtrackcollection. --- .../at/hannibal2/skyhanni/SkyHanniMod.java | 1 + .../hannibal2/skyhanni/config/Features.java | 5 + .../skyhanni/config/commands/Commands.kt | 2 + .../skyhanni/config/features/Misc.java | 5 + .../skyhanni/features/CollectionCounter.kt | 155 ++++++++++++++++++ 5 files changed, 168 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index a88ef4696704..ba48a51030e9 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -163,6 +163,7 @@ public void preInit(FMLPreInitializationEvent event) { registerEvent(new GriffinBurrowHelper()); registerEvent(new GriffinBurrowParticleFinder()); registerEvent(new BurrowWarpHelper()); + registerEvent(new CollectionCounter()); registerEvent(new HighlightBonzoMasks()); registerEvent(new DungeonLevelColor()); registerEvent(new BazaarCancelledBuyOrderClipboard()); diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 0f7f0fd6c4be..976a0d9da51b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -37,6 +37,11 @@ public void executeRunnable(String runnableId) { return; } + if (runnableId.equals("collectionCounter")) { + editOverlay(activeConfigCategory, 200, 16, misc.collectionCounterPos); + return; + } + if (runnableId.equals("debugPos")) { editOverlay(activeConfigCategory, 200, 16, dev.debugPos); return; diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 5d94d850cf6e..e51f9d92c624 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigEditor import at.hannibal2.skyhanni.config.commands.SimpleCommand.ProcessCommandRunnable import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper +import at.hannibal2.skyhanni.features.CollectionCounter import at.hannibal2.skyhanni.features.MarkedPlayerManager import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper import at.hannibal2.skyhanni.test.LorenzTest @@ -37,6 +38,7 @@ object Commands { registerCommand("togglepacketlog") { LorenzTest.togglePacketLog() } registerCommand("shreloadlisteners") { LorenzTest.reloadListeners() } registerCommand("shresetburrowwarps") { BurrowWarpHelper.resetDisabledWarps() } + registerCommand("shtrackcollection") { CollectionCounter.command(it) } } private fun registerCommand(name: String, function: (Array) -> Unit) { diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 5420aec36769..a47b7979e6b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -134,4 +134,9 @@ public class Misc { @ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure SkyHanni.") @ConfigEditorBoolean public boolean configButtonOnPause = true; + + @Expose + @ConfigOption(name = "Collection Counter Position", desc = "Tracking the number of items you collect. §cDoes not work with sacks.") + @ConfigEditorButton(runnableId = "collectionCounter", buttonText = "Edit") + public Position collectionCounterPos = new Position(10, 10, false, true); } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt new file mode 100644 index 000000000000..4124762b8503 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt @@ -0,0 +1,155 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent +import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.bazaar.BazaarData +import at.hannibal2.skyhanni.test.GriffinJavaUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.renderString +import net.minecraft.client.Minecraft +import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.TickEvent + +class CollectionCounter { + + companion object { + + private var textToRender = "" + private var itemName = "" + private var itemApiName = "" + private var itemAmount = -1 + + private var lastAmountInInventory = -1 + + private val apiCollectionData = mutableMapOf() + + fun command(args: Array) { + if (args.isEmpty()) { + if (itemName == "") { + LorenzUtils.chat("§c/shtrackcollection ") + return + } + LorenzUtils.chat("§e[SkyHanni] Disabled collection tracking for $itemName") + apiCollectionData[itemApiName] = itemAmount + resetData() + return + } + + var name = args.joinToString(" ") + + var data: BazaarData? = null + for (bazaarData in BazaarApi.bazaarMap.values) { + if (bazaarData.itemName.equals(name, ignoreCase = true)) { + data = bazaarData + break + } + } + + if (data == null) { + LorenzUtils.error("Item '$name' not found!") + return + } + name = data.itemName + + val apiName = data.apiName + if (!apiCollectionData.contains(apiName)) { + LorenzUtils.error("Item '$name' not in collection data!") + return + } + + if (itemAmount != -1) { + resetData() + } + + itemName = name + itemApiName = apiName + itemAmount = apiCollectionData[apiName]!! + + lastAmountInInventory = countCurrentlyInInventory() + update() + LorenzUtils.chat("§e[SkyHanni] Enabled collection tracking for $itemName") + } + + private fun resetData() { + itemAmount = -1 + itemName = "" + itemApiName = "" + + lastAmountInInventory = -1 + textToRender = "" + } + + private fun update() { + val format = GriffinJavaUtils.formatInteger(itemAmount) + textToRender = "$itemName collection: $format" + } + + private fun countCurrentlyInInventory(): Int { + var currentlyInInventory = 0 + val player = Minecraft.getMinecraft().thePlayer + for (stack in player.inventory.mainInventory) { + if (stack == null) continue + val internalName = stack.getInternalName() + if (internalName == itemApiName) { + currentlyInInventory += stack.stackSize + } + } + return currentlyInInventory + } + } + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + val thePlayer = Minecraft.getMinecraft().thePlayer ?: return + thePlayer.worldObj ?: return + + if (lastAmountInInventory == -1) return + + if (Minecraft.getMinecraft().currentScreen != null) return + + val currentlyInInventory = countCurrentlyInInventory() + val diff = currentlyInInventory - lastAmountInInventory + if (diff != 0) { + if (diff > 0) { + itemAmount += diff + update() + } else { + LorenzUtils.debug("Collection counter! Negative collection change: $diff") + } + } + + lastAmountInInventory = currentlyInInventory + } + + @SubscribeEvent + fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) { + val profileData = event.profileData + val collection = profileData["collection"].asJsonObject + + apiCollectionData.clear() + for (entry in collection.entrySet()) { + val name = entry.key + val value = entry.value.asInt + apiCollectionData[name] = value + if (name == itemApiName) { + val diff = value - itemAmount + if (diff != 0) { + LorenzUtils.debug("Collection counter was wrong by $diff items. (Compared against API data)") + } + itemAmount = value + update() + } + } + } + + @SubscribeEvent + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { + if (event.type != RenderGameOverlayEvent.ElementType.ALL) return + if (!LorenzUtils.inSkyblock) return + + SkyHanniMod.feature.misc.collectionCounterPos.renderString(textToRender) + } +} \ No newline at end of file From 27017f5e523aadf7c2bb1c8e2f5b677bf47f2cc2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:27:00 +0100 Subject: [PATCH 04/32] Added /shtrackcollection. --- CHANGELOG.md | 3 +++ FEATURES.md | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e38186013da..3d69e944d9f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Version 0.13.1 +### Features ++ Added /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. + ### Fixes + Dungeon level color fixed wrong colors. diff --git a/FEATURES.md b/FEATURES.md index 552552f9c403..7f44a497dba5 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -140,6 +140,7 @@ ## Commands - /wiki (using hypixel-skyblock.fandom.com instead of Hypixel wiki) - /shmarkplayer (marking a player with yellow color) +- /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. - ## Misc - Allow to copy, paste, and mark selected text in signs (not visual, but it's working still) From bdd4102b67c7498c366370e265f67ad25698950b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:27:58 +0100 Subject: [PATCH 05/32] Reloading the profile data every 3 minutes. --- .../at/hannibal2/skyhanni/SkyHanniMod.java | 2 +- .../{ApiKeyGrabber.kt => ApiDataLoader.kt} | 37 ++++++++++++++----- 2 files changed, 29 insertions(+), 10 deletions(-) rename src/main/java/at/hannibal2/skyhanni/data/{ApiKeyGrabber.kt => ApiDataLoader.kt} (79%) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index ba48a51030e9..0c68a9f8986d 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -89,7 +89,7 @@ public void preInit(FMLPreInitializationEvent event) { registerEvent(new HypixelData()); registerEvent(new DungeonData()); registerEvent(new ScoreboardData()); - registerEvent(new ApiKeyGrabber()); + registerEvent(new ApiDataLoader()); registerEvent(new SeaCreatureManager()); registerEvent(new ItemRenderBackground()); registerEvent(new EntityData()); diff --git a/src/main/java/at/hannibal2/skyhanni/data/ApiKeyGrabber.kt b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt similarity index 79% rename from src/main/java/at/hannibal2/skyhanni/data/ApiKeyGrabber.kt rename to src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt index 000d218052e0..bea039212c1a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ApiKeyGrabber.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt @@ -12,13 +12,32 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.TickEvent import java.io.File import java.util.* -class ApiKeyGrabber { +class ApiDataLoader { private var currentProfileName = "" + private var nextApiCallTime = -1L + private var currentProfileId = "" + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + val thePlayer = Minecraft.getMinecraft().thePlayer ?: return + thePlayer.worldObj ?: return + + if (nextApiCallTime != -1L && System.currentTimeMillis() > nextApiCallTime) { + nextApiCallTime = System.currentTimeMillis() + 60_000 * 5 + SkyHanniMod.coroutineScope.launch { + val apiKey = SkyHanniMod.feature.hidden.apiKey + val uuid = Minecraft.getMinecraft().thePlayer.uniqueID.toDashlessUUID() + loadProfileData(apiKey, uuid, currentProfileId) + } + } + } + @SubscribeEvent fun onStatusBar(event: LorenzChatEvent) { val message = event.message @@ -38,7 +57,6 @@ class ApiKeyGrabber { updateApiData() } - private suspend fun tryUpdateProfileDataAndVerifyKey(apiKey: String): Boolean { val uuid = Minecraft.getMinecraft().thePlayer.uniqueID.toDashlessUUID() val url = "https://api.hypixel.net/player?key=$apiKey&uuid=$uuid" @@ -55,20 +73,21 @@ class ApiKeyGrabber { } val player = jsonObject["player"].asJsonObject val stats = player["stats"].asJsonObject - val skyblock = stats["SkyBlock"].asJsonObject - val profiles = skyblock["profiles"].asJsonObject + val skyBlock = stats["SkyBlock"].asJsonObject + val profiles = skyBlock["profiles"].asJsonObject for (entry in profiles.entrySet()) { val asJsonObject = entry.value.asJsonObject val name = asJsonObject["cute_name"].asString if (currentProfileName == name.lowercase()) { - val profileId = asJsonObject["profile_id"].asString - loadProfile(apiKey, uuid, profileId) + currentProfileId = asJsonObject["profile_id"].asString + loadProfileData(apiKey, uuid, currentProfileId) } } return true } private fun updateApiData() { + nextApiCallTime = -1 SkyHanniMod.coroutineScope.launch { val oldApiKey = SkyHanniMod.feature.hidden.apiKey if (oldApiKey.isNotEmpty() && tryUpdateProfileDataAndVerifyKey(oldApiKey)) { @@ -110,18 +129,18 @@ class ApiKeyGrabber { return candidates } - private suspend fun loadProfile(apiKey: String, playerUuid: String, profileId: String) { + private suspend fun loadProfileData(apiKey: String, playerUuid: String, profileId: String) { val url = "https://api.hypixel.net/skyblock/profile?key=$apiKey&profile=$profileId" val jsonObject = withContext(Dispatchers.IO) { APIUtil.getJSONResponse(url) } - val profile = jsonObject["profile"]?.asJsonObject ?: return val members = profile["members"]?.asJsonObject ?: return for (entry in members.entrySet()) { if (entry.key == playerUuid) { val profileData = entry.value.asJsonObject ProfileApiDataLoadedEvent(profileData).postAndCatch() + nextApiCallTime = System.currentTimeMillis() + 60_000 * 3 } } } -} \ No newline at end of file +} From c7fd8e858893128913659934e7524f61ab78745c Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:28:47 +0100 Subject: [PATCH 06/32] Renaming onRenderOverlay. --- src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt | 2 +- .../java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt | 2 +- .../at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt | 2 +- src/main/java/at/hannibal2/skyhanni/features/RealTime.kt | 2 +- .../at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt | 2 +- .../hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt | 2 +- .../skyhanni/features/dungeon/DungeonMilestonesDisplay.kt | 2 +- .../skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt | 2 +- .../features/nether/ashfang/AshfangNextResetCooldown.kt | 2 +- .../skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt | 2 +- .../skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt | 2 +- .../skyhanni/features/summonings/SummoningMobManager.kt | 2 +- src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt index eda151f979ff..f3807be83865 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt @@ -20,7 +20,7 @@ class SendTitleHelper { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (System.currentTimeMillis() > endTime) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt index 0048114a3fb3..29d5d037ccd6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt @@ -37,7 +37,7 @@ class CurrentPetDisplay { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!LorenzUtils.inSkyblock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt index 7f449b0bae93..5ac2a00dd5c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt @@ -178,7 +178,7 @@ class NonGodPotEffectDisplay { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt b/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt index de1d1b06e61d..a3c9e9685164 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt @@ -12,7 +12,7 @@ class RealTime { private val format = SimpleDateFormat("HH:mm:ss") @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt index ef19d53ec3f4..15d1475f61ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -126,7 +126,7 @@ class DungeonCopilot { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) 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 a65ee67c1265..672e2d262070 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -85,7 +85,7 @@ class DungeonDeathCounter { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return 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 97798b04bb6c..9457d4a5dbd3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -84,7 +84,7 @@ class DungeonMilestonesDisplay { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return 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 3c6c6af88eab..92692cc6589d 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 @@ -26,7 +26,7 @@ class AshfangFreezeCooldown { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return val duration = System.currentTimeMillis() - lastHit 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 ec171e2d8e8b..8590c2b3643b 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 @@ -30,7 +30,7 @@ class AshfangNextResetCooldown { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return if (spawnTime == -1L) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt index 793764000c08..4ae548836e25 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt @@ -245,7 +245,7 @@ class BlazeSlayerDaggerHelper { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return if (textTopLeft.isEmpty()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt index 214e25eb7e1f..22f22e904ab3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt @@ -96,7 +96,7 @@ class BlazeSlayerPillar { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return if (lastPillarSpawnTime == -1L) return 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 41357fbb87dd..a4047a7c2cb6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -137,7 +137,7 @@ class SummoningMobManager { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!LorenzUtils.inSkyblock) return if (!SkyHanniMod.feature.summonings.summoningMobDisplay) return diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 8f0c4cc2c3d6..3f1cfa4da390 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -120,7 +120,7 @@ class LorenzTest { } @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { + fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!LorenzUtils.inSkyblock) return if (!SkyHanniMod.feature.dev.debugEnabled) return From 95e52d80f87d1cf9fe26711c9c8d2fe01a5c10aa Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:53:51 +0100 Subject: [PATCH 07/32] Fixed 1/1000000 crash. --- src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 97bba30991c3..3f8f1ce68faa 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -424,7 +424,8 @@ object RenderUtils { return lastValue + (currentValue - lastValue) * multiplier } - fun Position.renderString(string: String, offsetY: Int = 0) { + fun Position.renderString(string: String?, offsetY: Int = 0) { + if (string == null) return if (string == "") return val textToRender = "§f$string" From 95c048b61131a16ab0109fdf7c62027b95bee369 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 00:39:06 +0100 Subject: [PATCH 08/32] Show collection gain. --- .../skyhanni/features/CollectionCounter.kt | 67 +++++++++++++++---- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt index 4124762b8503..98488815f8a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt @@ -15,15 +15,21 @@ import net.minecraftforge.fml.common.gameevent.TickEvent class CollectionCounter { + private val RECENT_GAIN_TIME = 1_500 + companion object { - private var textToRender = "" + private var display = "" + private var itemName = "" private var itemApiName = "" private var itemAmount = -1 private var lastAmountInInventory = -1 + private var recentGain = 0 + private var lastGainTime = -1L + private val apiCollectionData = mutableMapOf() fun command(args: Array) { @@ -32,7 +38,7 @@ class CollectionCounter { LorenzUtils.chat("§c/shtrackcollection ") return } - LorenzUtils.chat("§e[SkyHanni] Disabled collection tracking for $itemName") + LorenzUtils.chat("§e[SkyHanni] Stopped collection tracker.") apiCollectionData[itemApiName] = itemAmount resetData() return @@ -49,14 +55,14 @@ class CollectionCounter { } if (data == null) { - LorenzUtils.error("Item '$name' not found!") + LorenzUtils.chat("§c[SkyHanni] Item '$name' not found!") return } name = data.itemName val apiName = data.apiName if (!apiCollectionData.contains(apiName)) { - LorenzUtils.error("Item '$name' not in collection data!") + LorenzUtils.chat("§c[SkyHanni] Item $name not in collection data!") return } @@ -69,8 +75,8 @@ class CollectionCounter { itemAmount = apiCollectionData[apiName]!! lastAmountInInventory = countCurrentlyInInventory() - update() - LorenzUtils.chat("§e[SkyHanni] Enabled collection tracking for $itemName") + updateDisplay() + LorenzUtils.chat("§e[SkyHanni] Started tracking $itemName collection.") } private fun resetData() { @@ -79,12 +85,20 @@ class CollectionCounter { itemApiName = "" lastAmountInInventory = -1 - textToRender = "" + display = "" + + recentGain = 0 } - private fun update() { + private fun updateDisplay() { val format = GriffinJavaUtils.formatInteger(itemAmount) - textToRender = "$itemName collection: $format" + + var gainText = "" + if (recentGain != 0) { + gainText = "§a+" + GriffinJavaUtils.formatInteger(recentGain) + } + + display = "$itemName collection: §e$format $gainText" } private fun countCurrentlyInInventory(): Int { @@ -106,16 +120,19 @@ class CollectionCounter { val thePlayer = Minecraft.getMinecraft().thePlayer ?: return thePlayer.worldObj ?: return - if (lastAmountInInventory == -1) return + compareInventory() + updateGain() + } + private fun compareInventory() { + if (lastAmountInInventory == -1) return if (Minecraft.getMinecraft().currentScreen != null) return val currentlyInInventory = countCurrentlyInInventory() val diff = currentlyInInventory - lastAmountInInventory if (diff != 0) { if (diff > 0) { - itemAmount += diff - update() + gainItems(diff) } else { LorenzUtils.debug("Collection counter! Negative collection change: $diff") } @@ -124,6 +141,27 @@ class CollectionCounter { lastAmountInInventory = currentlyInInventory } + private fun updateGain() { + if (recentGain != 0) { + if (System.currentTimeMillis() > lastGainTime + RECENT_GAIN_TIME) { + recentGain = 0 + updateDisplay() + } + } + } + + private fun gainItems(amount: Int) { + itemAmount += amount + + if (System.currentTimeMillis() > lastGainTime + RECENT_GAIN_TIME) { + recentGain = 0 + } + lastGainTime = System.currentTimeMillis() + recentGain += amount + + updateDisplay() + } + @SubscribeEvent fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) { val profileData = event.profileData @@ -140,7 +178,8 @@ class CollectionCounter { LorenzUtils.debug("Collection counter was wrong by $diff items. (Compared against API data)") } itemAmount = value - update() + recentGain = 0 + updateDisplay() } } } @@ -150,6 +189,6 @@ class CollectionCounter { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!LorenzUtils.inSkyblock) return - SkyHanniMod.feature.misc.collectionCounterPos.renderString(textToRender) + SkyHanniMod.feature.misc.collectionCounterPos.renderString(display) } } \ No newline at end of file From a824460d13ef99f6fa51597de704893d1e55acc6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:22:50 +0100 Subject: [PATCH 09/32] Don't render overlays when tab list key is pressed. --- CHANGELOG.md | 3 +++ src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d69e944d9f8..6de968e7984f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Features + Added /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. +### Changes ++ Don't render overlays when tab list key is pressed. + ### Fixes + Dungeon level color fixed wrong colors. diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 3f8f1ce68faa..3697838c7c00 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -425,14 +425,17 @@ object RenderUtils { } fun Position.renderString(string: String?, offsetY: Int = 0) { + val minecraft = Minecraft.getMinecraft() + if (minecraft.gameSettings.keyBindPlayerList.isKeyDown) return + if (string == null) return if (string == "") return val textToRender = "§f$string" GlStateManager.pushMatrix() - val resolution = ScaledResolution(Minecraft.getMinecraft()) + val resolution = ScaledResolution(minecraft) - val renderer = Minecraft.getMinecraft().renderManager.fontRenderer ?: return + val renderer = minecraft.renderManager.fontRenderer ?: return val offsetX = (200 - renderer.getStringWidth(textToRender.removeColor())) / 2 From 6ab6795eb479dfcae3e03b68ace173cf9db457fe Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:34:47 +0100 Subject: [PATCH 10/32] changed color for CroesusUnopenedChestTracker --- .../skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt index ae5d5511dd7e..8cda8aadec53 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt @@ -30,7 +30,7 @@ class CroesusUnopenedChestTracker { val lore = stack.getLore() if (lore.any { it.contains("Click to view") }) { if (!lore.any { it.contains("Chests have been opened!") }) { - slot highlight LorenzColor.GREEN + slot highlight LorenzColor.DARK_PURPLE } } } From c4ab4cf0200381effc50309c5b4f2ba689b3c438 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:58:03 +0100 Subject: [PATCH 11/32] Add support for ironman, stranded and bingo. --- .../at/hannibal2/skyhanni/data/HypixelData.kt | 55 ++++++++++++++----- .../hannibal2/skyhanni/utils/LorenzUtils.kt | 6 ++ 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 53a1286d312d..8026ecac8dad 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -19,6 +19,13 @@ class HypixelData { var skyblock = false var skyBlockIsland: String = "" + //Ironman, Stranded and Bingo + var noTrade = false + + var ironman = false + var stranded = false + var bingo = false + fun readSkyBlockArea(): String { for (line in ScoreboardData.sidebarLinesFormatted()) { if (line.startsWith(" §7⏣ ")) { @@ -28,7 +35,6 @@ class HypixelData { return "invalid" } - } var loggerIslandChange = LorenzLogger("debug/island_change") @@ -57,7 +63,6 @@ class HypixelData { if (!hypixel) return val message = event.message.removeColor().lowercase() - if (message.startsWith("your profile was changed to:")) { val stripped = message.replace("your profile was changed to:", "").replace("(co-op)", "").trim() ProfileJoinEvent(stripped).postAndCatch() @@ -65,7 +70,6 @@ class HypixelData { if (message.startsWith("you are playing on profile:")) { val stripped = message.replace("you are playing on profile:", "").replace("(co-op)", "").trim() ProfileJoinEvent(stripped).postAndCatch() - } } @@ -80,13 +84,42 @@ class HypixelData { if (tick % 5 != 0) return - val newState = checkScoreboard() - if (newState) { + val inSkyBlock = checkScoreboard() + if (inSkyBlock) { checkIsland() + checkSidebar() } - if (newState == skyblock) return - skyblock = newState + if (inSkyBlock == skyblock) return + skyblock = inSkyBlock + } + + private fun checkSidebar() { + ironman = false + stranded = false + bingo = false + + for (line in ScoreboardData.sidebarLinesFormatted()) { + when (line) { + " §7Ⓑ §7Bingo", // No Rank + " §bⒷ §bBingo", // Rank 1 + " §9Ⓑ §9Bingo", // Rank 2 + " §5Ⓑ §5Bingo", // Rank 3 + " §6Ⓑ §6Bingo", // Rank 4 + -> { + bingo = true + } + + // TODO implemennt stranded check + + " §7♲ §7Ironman" -> { + ironman = true + } + + } + } + + noTrade = ironman || stranded || bingo } private fun checkIsland() { @@ -115,12 +148,8 @@ class HypixelData { val minecraft = Minecraft.getMinecraft() val world = minecraft.theWorld ?: return false - val sidebarObjective = world.scoreboard.getObjectiveInDisplaySlot(1) ?: return false - - val displayName = sidebarObjective.displayName - + val objective = world.scoreboard.getObjectiveInDisplaySlot(1) ?: return false + val displayName = objective.displayName return displayName.removeColor().contains("SKYBLOCK") - } - } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index e37aedbc6d4c..f6e2e319c555 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -33,6 +33,12 @@ object LorenzUtils { val inKuudraFight: Boolean get() = skyBlockIsland == "Instanced" + val noTradeMode: Boolean + get() = HypixelData.noTrade + + val isBingoProfile: Boolean + get() = inSkyblock && HypixelData.bingo + const val DEBUG_PREFIX = "[SkyHanni Debug] §7" private val log = LorenzLogger("chat/mod_sent") From ac0c2ee4e8e17492feceb0007ccab4a6ddfc27da Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:58:22 +0100 Subject: [PATCH 12/32] Removed unused code. --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 0c68a9f8986d..5a1e9fb7c4bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -186,10 +186,7 @@ public void preInit(FMLPreInitializationEvent event) { private void registerEvent(Object object) { listenerClasses.add(object); - String simpleName = object.getClass().getSimpleName(); - long start = System.currentTimeMillis(); MinecraftForge.EVENT_BUS.register(object); - long duration = System.currentTimeMillis() - start; } public static GuiScreen screenToOpen = null; From 81e2e14e71eb49b531562273ca9d306f3d76b530 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:59:53 +0100 Subject: [PATCH 13/32] No longer blocking the sell of bazaar items to NPC when on ironman, stranded or bingo mode. --- CHANGELOG.md | 1 + .../skyhanni/features/inventory/HideNotClickableItems.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de968e7984f..4eac20119559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Changes + Don't render overlays when tab list key is pressed. ++ No longer blocking the sell of bazaar items to NPC when on ironman, stranded or bingo mode. ### Fixes + Dungeon level color fixed wrong colors. diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 78735b5f9b7d..0202566a091a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -306,6 +306,12 @@ class HideNotClickableItems { } if (!ItemUtils.isRecombobulated(stack)) { + if (LorenzUtils.noTradeMode) { + if (BazaarApi.isBazaarItem(stack)) { + return false + } + } + if (hideNpcSellFilter.match(name)) return false val id = stack.getInternalName() From cf9c5919746107cd4fc954f75b9d99223e1df591 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:23:14 +0100 Subject: [PATCH 14/32] Compact Bingo and Potion Effect chat messages. --- CHANGELOG.md | 4 +- FEATURES.md | 4 + .../at/hannibal2/skyhanni/SkyHanniMod.java | 2 + .../hannibal2/skyhanni/config/Features.java | 4 + .../skyhanni/config/features/Bingo.java | 14 +++ .../skyhanni/config/features/Chat.java | 7 +- .../skyhanni/features/CompactBingoChat.kt | 112 ++++++++++++++++++ .../features/CompactSplashPotionMessage.kt | 35 ++++++ 8 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java create mode 100644 src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eac20119559..72210d27a177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,12 @@ ### Features + Added /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. ++ Added Compact Bingo Chat Messages ++ Added Compact Potion Effect Chat Messages ### Changes + Don't render overlays when tab list key is pressed. -+ No longer blocking the sell of bazaar items to NPC when on ironman, stranded or bingo mode. ++ Do no longer prevent the selling of bazaar items to NPC when on ironman, stranded or bingo mode. ### Fixes + Dungeon level color fixed wrong colors. diff --git a/FEATURES.md b/FEATURES.md index 7f44a497dba5..9687098b0e74 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -19,6 +19,7 @@ - Option to hide the death messages of other players, except for players who are close to the player, inside the dungeon or during a Kuudra fight. - Scan messages sent by players in all-chat for blacklisted words and greys out the message. - Chat peeking (holding key to display chat without opening the chat gui) +- Compact Potion Effect Messages ## Dungeon - Clicked Blocks (Showing the block behind walls AFTER clicked on a chest, wither essence or a lever) @@ -137,6 +138,9 @@ + Highlight marked player names in chat. + Mark the own player name. +## Bingo ++ Shortens chat messages about skill level ups, collection gains, new area discoveries, and bestiarity upgrades while on bingo. + ## Commands - /wiki (using hypixel-skyblock.fandom.com instead of Hypixel wiki) - /shmarkplayer (marking a player with yellow color) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 5a1e9fb7c4bb..d7670e810b8e 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -167,7 +167,9 @@ public void preInit(FMLPreInitializationEvent event) { registerEvent(new HighlightBonzoMasks()); registerEvent(new DungeonLevelColor()); registerEvent(new BazaarCancelledBuyOrderClipboard()); + registerEvent(new CompactSplashPotionMessage()); registerEvent(new CroesusUnopenedChestTracker()); + registerEvent(new CompactBingoChat()); Commands.INSTANCE.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 976a0d9da51b..083220b29776 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -164,6 +164,10 @@ public void executeRunnable(String runnableId) { @Category(name = "Marked Players", desc = "Players that got marked with /shmarkplayer") public MarkedPlayers markedPlayers = new MarkedPlayers(); + @Expose + @Category(name = "Bingo", desc = "Features for the Bingo mode.") + public Bingo bingo = new Bingo(); + @Expose @Category(name = "Misc", desc = "Settings without a category.") public Misc misc = new Misc(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java new file mode 100644 index 000000000000..002841d22b37 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; +import com.google.gson.annotations.Expose; + +public class Bingo { + + @Expose + @ConfigOption(name = "Compact Chat Messages", desc = "Shortens chat messages about skill level ups, collection gains, " + + "new area discoveries, and bestiarity upgrades while on bingo.") + @ConfigEditorBoolean + public boolean compactChatMessages = true; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java index 029731f96432..386a8fd4b5d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java @@ -91,7 +91,7 @@ public class Chat { @Expose @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages in the dungeon.") @ConfigEditorBoolean - public boolean dungeonMessages = false; + public boolean dungeonMessages = true; @Expose @ConfigOption(name = "Dungeon Boss Messages", desc = "Hide messages from watcher and bosses in the dungeon.") @@ -103,4 +103,9 @@ public class Chat { "except for players who are close to the player, inside dungeon or during a Kuudra fight.") @ConfigEditorBoolean public boolean hideFarDeathMessages = false; + + @Expose + @ConfigOption(name = "Compact Potion Message", desc = "Shorten chat messages about player potion effects.") + @ConfigEditorBoolean + public boolean compactPotionMessage = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt new file mode 100644 index 000000000000..236236bb664e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt @@ -0,0 +1,112 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class CompactBingoChat { + + private var blockedSkillLevelUp = false + private var blockedCollectionLevelUp = false + private var collectionLevelUpLastLine: String? = null + private var newArea = 0//0 = nothing, 1 = after first message, 2 = after second message + private var blockedBestiarity = false + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.isBingoProfile) return + if (!SkyHanniMod.feature.bingo.compactChatMessages) return + + onSkillLevelUp(event) + onCollectionLevelUp(event) + onNewAreaDiscovered(event) + onBestiarityUpgrade(event) + } + + private fun onSkillLevelUp(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§b§lSKILL LEVEL UP ")) { + blockedSkillLevelUp = true + return + } + if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedSkillLevelUp = false + return + } + + if (blockedSkillLevelUp) { + if (!message.contains("Access to") && !message.endsWith(" Enchantment")) { + event.blockedReason = "compact skill level up" + } + } + } + + private fun onCollectionLevelUp(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§6§lCOLLECTION LEVEL UP ")) { + blockedCollectionLevelUp = true + return + } + if (message == "§e§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedCollectionLevelUp = false + return + } + + if (blockedCollectionLevelUp) { + if (message.contains("Trade") || message.contains("Recipe")) { + var text = message.removeColor().replace(" ", "") + if (text == "Trade" || text == "Recipe") { + collectionLevelUpLastLine?.let { LorenzUtils.chat(it) } + } + } else { + event.blockedReason = "compact collection level up" + collectionLevelUpLastLine = message + } + } + } + + private fun onNewAreaDiscovered(event: LorenzChatEvent) { + var message = event.message + + if (message == " §r§6§lNEW AREA DISCOVERED!") { + newArea = 1 + println("new area $newArea $message") + return + } + + if (message != "") { + if (newArea == 1) { + newArea = 2 + println("new area $newArea $message") + return + } + + if (newArea == 2) { + if (message.startsWith("§7 ■ §r") || message.startsWith(" §r")) { + event.blockedReason = "compact new area discovered" + } else { + newArea = 0 + println("new area $newArea $message") + } + } + } + } + + private fun onBestiarityUpgrade(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§3§lBESTIARY §b§l")) { + blockedBestiarity = true + return + } + if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedBestiarity = false + return + } + + if (blockedBestiarity) { + event.blockedReason = "compact bestiarity upgrade" + } + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt new file mode 100644 index 000000000000..04740bbbd841 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt @@ -0,0 +1,35 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.util.ChatComponentText +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.regex.Pattern + +class CompactSplashPotionMessage { + + private val POTION_EFFECT_PATTERN = + Pattern.compile("§a§lBUFF! §fYou have gained §r(.*)§r§f! Press TAB or type /effects to view your active effects!") + + private val POTION_EFFECT_OTHERS_PATTERN = + Pattern.compile("§a§lBUFF! §fYou were splashed by (.*) §fwith §r(.*)§r§f! Press TAB or type /effects to view your active effects!") + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.inSkyblock || !SkyHanniMod.feature.chat.compactPotionMessage) return + + var matcher = POTION_EFFECT_PATTERN.matcher(event.message) + if (matcher.matches()) { + val name = matcher.group(1) + event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$name") + } + + matcher = POTION_EFFECT_OTHERS_PATTERN.matcher(event.message) + if (matcher.matches()) { + val playerName = matcher.group(1) + val effectName = matcher.group(2) + event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$effectName §7(by $playerName§7)") + } + } +} \ No newline at end of file From b2083d8b1042c6841925a780ae9093eedb11e75e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:27:43 +0100 Subject: [PATCH 15/32] Create misc package for the features. --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 +- src/main/java/at/hannibal2/skyhanni/config/Features.java | 4 ++-- .../java/at/hannibal2/skyhanni/config/commands/Commands.kt | 4 ++-- .../hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt | 2 +- .../skyhanni/features/chat/playerchat/PlayerChatModifier.kt | 2 +- .../hannibal2/skyhanni/features/{ => misc}/ButtonOnPause.kt | 2 +- .../skyhanni/features/{ => misc}/CollectionCounter.kt | 2 +- .../skyhanni/features/{ => misc}/CompactBingoChat.kt | 2 +- .../features/{ => misc}/CompactSplashPotionMessage.kt | 2 +- .../skyhanni/features/{ => misc}/CorruptedMobHighlight.kt | 2 +- .../skyhanni/features/{ => misc}/CurrentPetDisplay.kt | 2 +- .../skyhanni/features/{ => misc}/ExpBottleOnGroundHider.kt | 2 +- .../at/hannibal2/skyhanni/features/{ => misc}/HideArmor.kt | 2 +- .../skyhanni/features/{ => misc}/HideDamageSplash.kt | 2 +- .../skyhanni/features/{ => misc}/MarkedPlayerManager.kt | 2 +- .../skyhanni/features/{ => misc}/NonGodPotEffectDisplay.kt | 2 +- .../at/hannibal2/skyhanni/features/{ => misc}/RealTime.kt | 2 +- .../skyhanni/features/{ => misc}/ThunderSparksHighlight.kt | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/ButtonOnPause.kt (97%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/CollectionCounter.kt (99%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/CompactBingoChat.kt (98%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/CompactSplashPotionMessage.kt (96%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/CorruptedMobHighlight.kt (97%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/CurrentPetDisplay.kt (97%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/ExpBottleOnGroundHider.kt (92%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/HideArmor.kt (99%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/HideDamageSplash.kt (94%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/MarkedPlayerManager.kt (98%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/NonGodPotEffectDisplay.kt (99%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/RealTime.kt (94%) rename src/main/java/at/hannibal2/skyhanni/features/{ => misc}/ThunderSparksHighlight.kt (98%) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index d7670e810b8e..8937929364b6 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.config.commands.Commands; import at.hannibal2.skyhanni.data.*; import at.hannibal2.skyhanni.data.repo.RepoManager; -import at.hannibal2.skyhanni.features.*; import at.hannibal2.skyhanni.features.anvil.AnvilCombineHelper; import at.hannibal2.skyhanni.features.bazaar.BazaarApi; import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod; @@ -30,6 +29,7 @@ import at.hannibal2.skyhanni.features.itemabilities.FireVeilWandParticles; import at.hannibal2.skyhanni.features.itemabilities.abilitycooldown.ItemAbilityCooldown; import at.hannibal2.skyhanni.features.minion.MinionFeatures; +import at.hannibal2.skyhanni.features.misc.*; import at.hannibal2.skyhanni.features.nether.MilleniaAgedBlazeColor; import at.hannibal2.skyhanni.features.nether.ashfang.*; import at.hannibal2.skyhanni.features.slayer.EndermanSlayerBeacon; diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 083220b29776..39d20d74bc69 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -8,8 +8,8 @@ import at.hannibal2.skyhanni.config.core.config.annotations.Category; import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor; import at.hannibal2.skyhanni.config.features.*; -import at.hannibal2.skyhanni.features.HideArmor; -import at.hannibal2.skyhanni.features.MarkedPlayerManager; +import at.hannibal2.skyhanni.features.misc.HideArmor; +import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager; import com.google.gson.annotations.Expose; import net.minecraft.client.Minecraft; diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index e51f9d92c624..9bda0fda1df4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -4,9 +4,9 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigEditor import at.hannibal2.skyhanni.config.commands.SimpleCommand.ProcessCommandRunnable import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper -import at.hannibal2.skyhanni.features.CollectionCounter -import at.hannibal2.skyhanni.features.MarkedPlayerManager import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper +import at.hannibal2.skyhanni.features.misc.CollectionCounter +import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.test.LorenzTest import at.hannibal2.skyhanni.test.command.CopyItemCommand import at.hannibal2.skyhanni.test.command.CopyNearbyEntitiesCommand 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 891249c2388c..2bcf36102592 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.features.MarkedPlayerManager +import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index 5072152a7c40..7967fddba436 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.chat.playerchat import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.features.MarkedPlayerManager +import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import net.minecraft.util.ChatComponentText import net.minecraft.util.IChatComponent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/ButtonOnPause.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt similarity index 97% rename from src/main/java/at/hannibal2/skyhanni/features/ButtonOnPause.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt index 9769f5196a55..b54cff9da616 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/ButtonOnPause.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigEditor diff --git a/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt similarity index 99% rename from src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt index 98488815f8a3..277ecafb6ac2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactBingoChat.kt similarity index 98% rename from src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/CompactBingoChat.kt index 236236bb664e..a4becd8c440d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactBingoChat.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt similarity index 96% rename from src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt index 04740bbbd841..2f7bc254cbd9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt similarity index 97% rename from src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt index c9d806fcc6d5..b831bc927858 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt similarity index 97% rename from src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt index 29d5d037ccd6..53f56c37c065 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/ExpBottleOnGroundHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt similarity index 92% rename from src/main/java/at/hannibal2/skyhanni/features/ExpBottleOnGroundHider.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt index 1a1a0f6c72f2..99ccb4cea5b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/ExpBottleOnGroundHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.CheckRenderEntityEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/HideArmor.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt similarity index 99% rename from src/main/java/at/hannibal2/skyhanni/features/HideArmor.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt index e691f4812aaf..b6623331daa9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/HideArmor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.PacketEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt similarity index 94% rename from src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt index 23146f5f6848..8c4a0fcac230 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager diff --git a/src/main/java/at/hannibal2/skyhanni/features/MarkedPlayerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt similarity index 98% rename from src/main/java/at/hannibal2/skyhanni/features/MarkedPlayerManager.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt index 17ebec137ea1..38e3babbcca4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/MarkedPlayerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.RenderMobColoredEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt similarity index 99% rename from src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index 5ac2a00dd5c7..9f91e1c82c3d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt similarity index 94% rename from src/main/java/at/hannibal2/skyhanni/features/RealTime.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt index a3c9e9685164..8d7fafb1f5cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/RealTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.utils.LorenzUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt similarity index 98% rename from src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt rename to src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt index 20fd10f6ac36..c7432ffa9c08 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features +package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled From 518e57a874a365883fc755655d78b0981076ffe1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:28:50 +0100 Subject: [PATCH 16/32] renamed register event to module --- .../at/hannibal2/skyhanni/SkyHanniMod.java | 176 +++++++++--------- .../at/hannibal2/skyhanni/test/LorenzTest.kt | 18 +- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 8937929364b6..c59444b99268 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -70,7 +70,7 @@ public class SkyHanniMod { public static ConfigManager configManager; private static Logger logger; - public static List listenerClasses = new ArrayList<>(); + public static List modules = new ArrayList<>(); public static Job globalJob = JobKt.Job(null); public static CoroutineScope coroutineScope = CoroutineScopeKt.CoroutineScope( @@ -84,97 +84,97 @@ public void preInit(FMLPreInitializationEvent event) { //API and utils new BazaarApi(); - registerEvent(this); - registerEvent(new ChatManager()); - registerEvent(new HypixelData()); - registerEvent(new DungeonData()); - registerEvent(new ScoreboardData()); - registerEvent(new ApiDataLoader()); - registerEvent(new SeaCreatureManager()); - registerEvent(new ItemRenderBackground()); - registerEvent(new EntityData()); - registerEvent(new EntityMovementData()); - registerEvent(new ItemClickData()); - registerEvent(new MinecraftData()); - registerEvent(new SendTitleHelper()); - registerEvent(new ItemTipHelper()); + loadModule(this); + loadModule(new ChatManager()); + loadModule(new HypixelData()); + loadModule(new DungeonData()); + loadModule(new ScoreboardData()); + loadModule(new ApiDataLoader()); + loadModule(new SeaCreatureManager()); + loadModule(new ItemRenderBackground()); + loadModule(new EntityData()); + loadModule(new EntityMovementData()); + loadModule(new ItemClickData()); + loadModule(new MinecraftData()); + loadModule(new SendTitleHelper()); + loadModule(new ItemTipHelper()); //features - registerEvent(new BazaarOrderHelper()); - registerEvent(new ChatFilter()); - registerEvent(new PlayerChatModifier()); - registerEvent(new DungeonChatFilter()); - registerEvent(new HideNotClickableItems()); - registerEvent(new ItemDisplayOverlayFeatures()); - registerEvent(new CurrentPetDisplay()); - registerEvent(new ExpBottleOnGroundHider()); - registerEvent(new DamageIndicatorManager()); - registerEvent(new ItemAbilityCooldown()); - registerEvent(new DungeonHighlightClickedBlocks()); - registerEvent(new DungeonMilestonesDisplay()); - registerEvent(new DungeonDeathCounter()); - registerEvent(new DungeonCleanEnd()); - registerEvent(new DungeonBossMessages()); - registerEvent(new DungeonBossHideDamageSplash()); - registerEvent(new TrophyFishMessages()); - registerEvent(new BazaarBestSellMethod()); - registerEvent(new AnvilCombineHelper()); - registerEvent(new SeaCreatureMessageShortener()); + loadModule(new BazaarOrderHelper()); + loadModule(new ChatFilter()); + loadModule(new PlayerChatModifier()); + loadModule(new DungeonChatFilter()); + loadModule(new HideNotClickableItems()); + loadModule(new ItemDisplayOverlayFeatures()); + loadModule(new CurrentPetDisplay()); + loadModule(new ExpBottleOnGroundHider()); + loadModule(new DamageIndicatorManager()); + loadModule(new ItemAbilityCooldown()); + loadModule(new DungeonHighlightClickedBlocks()); + loadModule(new DungeonMilestonesDisplay()); + loadModule(new DungeonDeathCounter()); + loadModule(new DungeonCleanEnd()); + loadModule(new DungeonBossMessages()); + loadModule(new DungeonBossHideDamageSplash()); + loadModule(new TrophyFishMessages()); + loadModule(new BazaarBestSellMethod()); + loadModule(new AnvilCombineHelper()); + loadModule(new SeaCreatureMessageShortener()); // registerEvent(new GriffinBurrowFinder()); - registerEvent(new AshfangFreezeCooldown()); - registerEvent(new AshfangNextResetCooldown()); - registerEvent(new SummoningSoulsName()); - registerEvent(new AshfangGravityOrbs()); - registerEvent(new AshfangBlazingSouls()); - registerEvent(new AshfangBlazes()); - registerEvent(new AshfangHideParticles()); - registerEvent(new AshfangHideDamageIndicator()); - registerEvent(new ItemStars()); - registerEvent(new MinionFeatures()); - registerEvent(new RealTime()); - registerEvent(new RngMeterInventory()); - registerEvent(new WikiCommand()); - registerEvent(new SummoningMobManager()); - registerEvent(new VoidlingExtremistColor()); - registerEvent(new MilleniaAgedBlazeColor()); - registerEvent(new CorruptedMobHighlight()); - registerEvent(new MarkedPlayerManager()); - registerEvent(new HighlightSlayerMiniboss()); - registerEvent(new PlayerDeathMessages()); - registerEvent(new HighlightDungeonDeathmite()); - registerEvent(new DungeonHideItems()); - registerEvent(new DungeonCopilot()); - registerEvent(new EndermanSlayerBeacon()); - registerEvent(new FireVeilWandParticles()); - registerEvent(new HideMobNames()); - registerEvent(new HideDamageSplash()); - registerEvent(new ThunderSparksHighlight()); - registerEvent(new BlazeSlayerPillar()); - registerEvent(new BlazeSlayerDaggerHelper()); - registerEvent(new HellionShieldHelper()); - registerEvent(new BlazeSlayerFirePitsWarning()); - registerEvent(new BlazeSlayerClearView()); - registerEvent(new PlayerChatFilter()); - registerEvent(new HideArmor()); - registerEvent(new SlayerQuestWarning()); - registerEvent(new StatsTuning()); - registerEvent(new NonGodPotEffectDisplay()); - registerEvent(new SoopyGuessBurrow()); - registerEvent(new GriffinBurrowHelper()); - registerEvent(new GriffinBurrowParticleFinder()); - registerEvent(new BurrowWarpHelper()); - registerEvent(new CollectionCounter()); - registerEvent(new HighlightBonzoMasks()); - registerEvent(new DungeonLevelColor()); - registerEvent(new BazaarCancelledBuyOrderClipboard()); - registerEvent(new CompactSplashPotionMessage()); - registerEvent(new CroesusUnopenedChestTracker()); - registerEvent(new CompactBingoChat()); + loadModule(new AshfangFreezeCooldown()); + loadModule(new AshfangNextResetCooldown()); + loadModule(new SummoningSoulsName()); + loadModule(new AshfangGravityOrbs()); + loadModule(new AshfangBlazingSouls()); + loadModule(new AshfangBlazes()); + loadModule(new AshfangHideParticles()); + loadModule(new AshfangHideDamageIndicator()); + loadModule(new ItemStars()); + loadModule(new MinionFeatures()); + loadModule(new RealTime()); + loadModule(new RngMeterInventory()); + loadModule(new WikiCommand()); + loadModule(new SummoningMobManager()); + loadModule(new VoidlingExtremistColor()); + loadModule(new MilleniaAgedBlazeColor()); + loadModule(new CorruptedMobHighlight()); + loadModule(new MarkedPlayerManager()); + loadModule(new HighlightSlayerMiniboss()); + loadModule(new PlayerDeathMessages()); + loadModule(new HighlightDungeonDeathmite()); + loadModule(new DungeonHideItems()); + loadModule(new DungeonCopilot()); + loadModule(new EndermanSlayerBeacon()); + loadModule(new FireVeilWandParticles()); + loadModule(new HideMobNames()); + loadModule(new HideDamageSplash()); + loadModule(new ThunderSparksHighlight()); + loadModule(new BlazeSlayerPillar()); + loadModule(new BlazeSlayerDaggerHelper()); + loadModule(new HellionShieldHelper()); + loadModule(new BlazeSlayerFirePitsWarning()); + loadModule(new BlazeSlayerClearView()); + loadModule(new PlayerChatFilter()); + loadModule(new HideArmor()); + loadModule(new SlayerQuestWarning()); + loadModule(new StatsTuning()); + loadModule(new NonGodPotEffectDisplay()); + loadModule(new SoopyGuessBurrow()); + loadModule(new GriffinBurrowHelper()); + loadModule(new GriffinBurrowParticleFinder()); + loadModule(new BurrowWarpHelper()); + loadModule(new CollectionCounter()); + loadModule(new HighlightBonzoMasks()); + loadModule(new DungeonLevelColor()); + loadModule(new BazaarCancelledBuyOrderClipboard()); + loadModule(new CompactSplashPotionMessage()); + loadModule(new CroesusUnopenedChestTracker()); + loadModule(new CompactBingoChat()); Commands.INSTANCE.init(); - registerEvent(new LorenzTest()); - registerEvent(new ButtonOnPause()); + loadModule(new LorenzTest()); + loadModule(new ButtonOnPause()); configManager = new ConfigManager(); configManager.firstLoad(); @@ -186,8 +186,8 @@ public void preInit(FMLPreInitializationEvent event) { repo.loadRepoInformation(); } - private void registerEvent(Object object) { - listenerClasses.add(object); + private void loadModule(Object object) { + modules.add(object); MinecraftForge.EVENT_BUS.register(object); } diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 3f1cfa4da390..dce81b5dfc14 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -83,25 +83,25 @@ class LorenzTest { emptyList() } - val listeners = SkyHanniMod.listenerClasses - for (oldListener in listeners.toMutableList()) { - val javaClass = oldListener.javaClass + val modules = SkyHanniMod.modules + for (original in modules.toMutableList()) { + val javaClass = original.javaClass val simpleName = javaClass.simpleName - MinecraftForge.EVENT_BUS.unregister(oldListener) + MinecraftForge.EVENT_BUS.unregister(original) println("Unregistered listener $simpleName") if (simpleName !in blockedFeatures) { - listeners.remove(oldListener) - val newListener = javaClass.newInstance() - listeners.add(newListener) + modules.remove(original) + val module = javaClass.newInstance() + modules.add(module) - MinecraftForge.EVENT_BUS.register(newListener) + MinecraftForge.EVENT_BUS.register(module) println("Registered listener $simpleName") } else { println("Skipped registering listener $simpleName") } } - LorenzUtils.chat("§e[SkyHanni] reloaded ${listeners.size} listener classes.") + LorenzUtils.chat("§e[SkyHanni] reloaded ${modules.size} listener classes.") } } From f41540169f5e6508d32b504f98a0cde2cbd930f8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:32:01 +0100 Subject: [PATCH 17/32] Renamed hypixel and skyblock. --- .../at/hannibal2/skyhanni/data/EntityMovementData.kt | 2 +- .../java/at/hannibal2/skyhanni/data/HypixelData.kt | 10 +++++----- .../at/hannibal2/skyhanni/data/ItemRenderBackground.kt | 2 +- .../java/at/hannibal2/skyhanni/data/ItemTipHelper.kt | 4 ++-- .../java/at/hannibal2/skyhanni/data/MinecraftData.kt | 4 ++-- .../skyhanni/features/anvil/AnvilCombineHelper.kt | 2 +- .../skyhanni/features/bazaar/BazaarBestSellMethod.kt | 2 +- .../bazaar/BazaarCancelledBuyOrderClipboard.kt | 2 +- .../skyhanni/features/bazaar/BazaarDataGrabber.kt | 2 +- .../at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 2 +- .../skyhanni/features/chat/PlayerDeathMessages.kt | 6 +++--- .../features/damageindicator/DamageIndicatorManager.kt | 4 ++-- .../features/dungeon/CroesusUnopenedChestTracker.kt | 2 +- .../skyhanni/features/dungeon/DungeonChatFilter.kt | 4 ++-- .../skyhanni/features/dungeon/DungeonLevelColor.kt | 2 +- .../skyhanni/features/end/VoidlingExtremistColor.kt | 2 +- .../skyhanni/features/event/diana/BurrowWarpHelper.kt | 2 +- .../event/diana/GriffinBurrowParticleFinder.kt | 4 ++-- .../features/fishing/SeaCreatureMessageShortener.kt | 2 +- .../skyhanni/features/fishing/TrophyFishMessages.kt | 2 +- .../features/inventory/HideNotClickableItems.kt | 2 +- .../hannibal2/skyhanni/features/inventory/ItemStars.kt | 2 +- .../skyhanni/features/inventory/RngMeterInventory.kt | 2 +- .../skyhanni/features/inventory/StatsTuning.kt | 2 +- .../features/itemabilities/FireVeilWandParticles.kt | 6 +++--- .../abilitycooldown/ItemAbilityCooldown.kt | 4 ++-- .../skyhanni/features/minion/MinionFeatures.kt | 10 +++++----- .../hannibal2/skyhanni/features/misc/ButtonOnPause.kt | 4 ++-- .../skyhanni/features/misc/CollectionCounter.kt | 2 +- .../features/misc/CompactSplashPotionMessage.kt | 2 +- .../skyhanni/features/misc/CorruptedMobHighlight.kt | 4 ++-- .../skyhanni/features/misc/CurrentPetDisplay.kt | 4 ++-- .../skyhanni/features/misc/ExpBottleOnGroundHider.kt | 2 +- .../at/hannibal2/skyhanni/features/misc/HideArmor.kt | 4 ++-- .../skyhanni/features/misc/HideDamageSplash.kt | 2 +- .../skyhanni/features/misc/MarkedPlayerManager.kt | 6 +++--- .../skyhanni/features/misc/NonGodPotEffectDisplay.kt | 2 +- .../at/hannibal2/skyhanni/features/misc/RealTime.kt | 2 +- .../skyhanni/features/misc/ThunderSparksHighlight.kt | 2 +- .../skyhanni/features/nether/MilleniaAgedBlazeColor.kt | 2 +- .../skyhanni/features/nether/ashfang/AshfangBlazes.kt | 2 +- .../features/nether/ashfang/AshfangBlazingSouls.kt | 2 +- .../features/nether/ashfang/AshfangFreezeCooldown.kt | 2 +- .../features/nether/ashfang/AshfangGravityOrbs.kt | 2 +- .../nether/ashfang/AshfangHideDamageIndicator.kt | 2 +- .../features/nether/ashfang/AshfangHideParticles.kt | 4 ++-- .../nether/ashfang/AshfangNextResetCooldown.kt | 2 +- .../skyhanni/features/slayer/EndermanSlayerBeacon.kt | 2 +- .../hannibal2/skyhanni/features/slayer/HideMobNames.kt | 2 +- .../features/slayer/HighlightSlayerMiniboss.kt | 2 +- .../skyhanni/features/slayer/SlayerQuestWarning.kt | 2 +- .../features/slayer/blaze/BlazeSlayerClearView.kt | 4 ++-- .../features/slayer/blaze/BlazeSlayerDaggerHelper.kt | 4 ++-- .../slayer/blaze/BlazeSlayerFirePitsWarning.kt | 2 +- .../features/slayer/blaze/BlazeSlayerPillar.kt | 2 +- .../features/slayer/blaze/HellionShieldHelper.kt | 4 ++-- .../features/summonings/SummoningMobManager.kt | 8 ++++---- .../skyhanni/features/summonings/SummoningSoulsName.kt | 2 +- .../transformers/gui/inventory/GuiEditSignMixin.java | 8 ++++---- src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 2 +- .../java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 10 +++++----- .../hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt | 2 +- 62 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt index 2e4d13da6045..30f88f48e909 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt @@ -25,7 +25,7 @@ class EntityMovementData { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return for (entity in entityLocation.keys) { if (entity.isDead) continue diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 8026ecac8dad..bbb3db69d9df 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -16,7 +16,7 @@ class HypixelData { companion object { var hypixel = false - var skyblock = false + var skyBlock = false var skyBlockIsland: String = "" //Ironman, Stranded and Bingo @@ -49,13 +49,13 @@ class HypixelData { @SubscribeEvent fun onWorldChange(event: WorldEvent.Load) { - skyblock = false + skyBlock = false } @SubscribeEvent fun onDisconnect(event: FMLNetworkEvent.ClientDisconnectionFromServerEvent) { hypixel = false - skyblock = false + skyBlock = false } @SubscribeEvent @@ -90,8 +90,8 @@ class HypixelData { checkSidebar() } - if (inSkyBlock == skyblock) return - skyblock = inSkyBlock + if (inSkyBlock == skyBlock) return + skyBlock = inSkyBlock } private fun checkSidebar() { diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt index 9b25933eaa96..1576ff4ca098 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt @@ -30,7 +30,7 @@ class ItemRenderBackground { @SubscribeEvent fun renderOverlayLol(event: RenderRealOverlayEvent) { val stack = event.stack - if (LorenzUtils.inSkyblock) { + if (LorenzUtils.inSkyBlock) { if (stack != null) { val color = stack.background if (color != -1) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt index 69ae9fa2d69d..30b9ad03f688 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt @@ -20,7 +20,7 @@ class ItemTipHelper { @SubscribeEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return - if (!LorenzUtils.inSkyblock || stack.stackSize != 1) return + if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return // val uuid = stacremovek.getLore().joinToString { ", " } val stackTip: String @@ -51,7 +51,7 @@ class ItemTipHelper { @SubscribeEvent(priority = EventPriority.HIGHEST) fun onRenderInventoryItemOverlayPost(event: DrawScreenAfterEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val gui = Minecraft.getMinecraft().currentScreen if (gui !is GuiChest) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index 16facaf90416..f463391e3aff 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -13,7 +13,7 @@ class MinecraftData { @SubscribeEvent(receiveCanceled = true) fun onSoundPacket(event: PacketEvent.ReceiveEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val packet = event.packet if (packet !is S29PacketSoundEffect) return @@ -31,7 +31,7 @@ class MinecraftData { @SubscribeEvent(receiveCanceled = true) fun onParticlePacketReceive(event: PacketEvent.ReceiveEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val packet = event.packet if (packet !is S2APacketParticles) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt index b2d397714326..9604cb05c358 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt @@ -14,7 +14,7 @@ class AnvilCombineHelper { @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.inventory.anvilCombineHelper) return if (event.gui !is GuiChest) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index c5d8c10a14b4..eb6d98d3146b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -78,6 +78,6 @@ class BazaarBestSellMethod { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.bazaar.bestSellMethod + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.bazaar.bestSellMethod } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt index 3943e7d44d73..9ee430050253 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt @@ -53,6 +53,6 @@ class BazaarCancelledBuyOrderClipboard { } fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.bazaar.cancelledBuyOrderClipboard + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.bazaar.cancelledBuyOrderClipboard } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt index 25abe82e15f0..bcf1b3e48aa4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt @@ -40,7 +40,7 @@ internal class BazaarDataGrabber(private var bazaarMap: MutableMap { diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt index 21703d227f19..6670a4a3e3ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt @@ -9,7 +9,7 @@ class SeaCreatureMessageShortener { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.fishing.shortenFishingMessage) return val seaCreature = SeaCreatureManager.getSeaCreature(event.message) diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishMessages.kt index 99c8b7063db8..2db229525bc2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishMessages.kt @@ -40,7 +40,7 @@ class TrophyFishMessages { @SubscribeEvent fun onStatusBar(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.fishing.trophyCounter) return val message = event.message diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 0202566a091a..4ec29baf216b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -65,7 +65,7 @@ class HideNotClickableItems { @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (isDisabled()) return if (event.gui !is GuiChest) return val guiChest = event.gui diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt index 4573ffa70c2e..af27b8f456f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt @@ -19,7 +19,7 @@ class ItemStars { @SubscribeEvent(priority = EventPriority.LOW) fun onTooltip(event: ItemTooltipEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val stack = event.itemStack ?: return if (stack.stackSize != 1) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt index feb489349e96..ec381a124d2d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt @@ -40,7 +40,7 @@ class RngMeterInventory { @SubscribeEvent(priority = EventPriority.LOW) fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (event.gui !is GuiChest) return val guiChest = event.gui diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt index bc1a5c9fdbc3..d33f030426a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt @@ -105,7 +105,7 @@ class StatsTuning { @SubscribeEvent(priority = EventPriority.LOW) fun onDrawSelectedTemplate(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (event.gui !is GuiChest) return val guiChest = event.gui diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index 93da7dc7aca3..c301070afbe8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -19,7 +19,7 @@ class FireVeilWandParticles { @SubscribeEvent fun onChatPacket(event: ReceiveParticleEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (SkyHanniMod.feature.itemAbilities.fireVeilWandDisplay == 0) return if (System.currentTimeMillis() > lastClick + 5_500) return @@ -30,7 +30,7 @@ class FireVeilWandParticles { @SubscribeEvent fun onItemClick(event: ItemClickInHandEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (event.clickType != ItemClickInHandEvent.ClickType.RIGHT_CLICK) return val itemInHand = event.itemInHand ?: return @@ -43,7 +43,7 @@ class FireVeilWandParticles { @SubscribeEvent fun onRenderWorld(event: RenderWorldLastEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (SkyHanniMod.feature.itemAbilities.fireVeilWandDisplay != 1) return if (System.currentTimeMillis() > lastClick + 5_500) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index cbd75608a5fa..152acf69229d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -56,7 +56,7 @@ class ItemAbilityCooldown { @SubscribeEvent fun onItemClickSend(event: PacketEvent.SendEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val packet = event.packet if (packet is C07PacketPlayerDigging) { @@ -97,7 +97,7 @@ class ItemAbilityCooldown { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.itemAbilities.itemAbilityCooldown + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.itemAbilities.itemAbilityCooldown } private fun click(ability: ItemAbility) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 12ddf6f7811d..707c364059c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -47,7 +47,7 @@ class MinionFeatures { @SubscribeEvent fun onClick(event: InputEvent.MouseInputEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != "Private Island") return if (!Mouse.getEventButtonState()) return @@ -62,7 +62,7 @@ class MinionFeatures { @SubscribeEvent fun onRenderLastClickedMinion(event: RenderWorldLastEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != "Private Island") return if (!SkyHanniMod.feature.minions.lastClickedMinionDisplay) return @@ -174,7 +174,7 @@ class MinionFeatures { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != "Private Island") return if (event.message.matchRegex("§aYou received §r§6(.*) coins§r§a!")) { @@ -187,7 +187,7 @@ class MinionFeatures { @SubscribeEvent fun onRenderLastEmptied(event: RenderWorldLastEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.minions.emptiedTimeDisplay) return if (LorenzUtils.skyBlockIsland != "Private Island") return @@ -210,7 +210,7 @@ class MinionFeatures { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != "Private Island") return if (!SkyHanniMod.feature.minions.hideMobsNametagNearby) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt index b54cff9da616..d54cd7225faf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt @@ -14,7 +14,7 @@ class ButtonOnPause { @SubscribeEvent fun onGuiAction(event: GuiScreenEvent.ActionPerformedEvent.Post) { - if (!LorenzUtils.isOnHypixel) return + if (!LorenzUtils.isHyPixel) return if (SkyHanniMod.feature.misc.configButtonOnPause && event.gui is GuiIngameMenu && event.button.id == buttonId) { SkyHanniMod.screenToOpen = GuiScreenElementWrapper( @@ -27,7 +27,7 @@ class ButtonOnPause { @SubscribeEvent fun onGuiInitPost(event: GuiScreenEvent.InitGuiEvent.Post) { - if (!LorenzUtils.isOnHypixel) return + if (!LorenzUtils.isHyPixel) return if (SkyHanniMod.feature.misc.configButtonOnPause && event.gui is GuiIngameMenu) { val x = event.gui.width - 105 diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt index 277ecafb6ac2..90d5c39efed7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt @@ -187,7 +187,7 @@ class CollectionCounter { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return SkyHanniMod.feature.misc.collectionCounterPos.renderString(display) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt index 2f7bc254cbd9..4cf8c7816925 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt @@ -17,7 +17,7 @@ class CompactSplashPotionMessage { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock || !SkyHanniMod.feature.chat.compactPotionMessage) return + if (!LorenzUtils.inSkyBlock || !SkyHanniMod.feature.chat.compactPotionMessage) return var matcher = POTION_EFFECT_PATTERN.matcher(event.message) if (matcher.matches()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt index b831bc927858..d2ab1725a129 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt @@ -18,7 +18,7 @@ class CorruptedMobHighlight { @SubscribeEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val entity = event.entity if (entity in corruptedMobs) return @@ -55,7 +55,7 @@ class CorruptedMobHighlight { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.misc.corruptedMobHighlight && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.corruptedMobHighlight && LorenzUtils.skyBlockIsland != "Private Island" } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt index 53f56c37c065..835b3ec06e56 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt @@ -13,7 +13,7 @@ class CurrentPetDisplay { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return var blocked = false @@ -39,7 +39,7 @@ class CurrentPetDisplay { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.misc.petDisplay) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt index 99ccb4cea5b2..b1f47f01598b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt @@ -10,7 +10,7 @@ class ExpBottleOnGroundHider { @SubscribeEvent fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.misc.hideExpBottles) return if (event.entity is EntityXPOrb) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt index b6623331daa9..146a11e3b17c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt @@ -23,7 +23,7 @@ class HideArmor { @SubscribeEvent fun onGuiInventoryToggle(event: TickEvent.ClientTickEvent) { - if (!LorenzUtils.inSkyblock) return // TODO test this + if (!LorenzUtils.inSkyBlock) return // TODO test this fixOtherArmor() @@ -182,7 +182,7 @@ class HideArmor { } private fun changeArmor(entity: EntityPlayer, new: Array?) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return val current = entity.inventory.armorInventory if (new != null) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt index 8c4a0fcac230..97448c316c24 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDamageSplash.kt @@ -12,7 +12,7 @@ class HideDamageSplash { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderDamage(event: RenderLivingEvent.Specials.Pre) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.misc.hideDamageSplash) return if (DamageIndicatorManager.isDamageSplash(event.entity)) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt index 38e3babbcca4..ec722eed41bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt @@ -76,7 +76,7 @@ class MarkedPlayerManager { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (tick++ % 20 == 0) { findPlayers() @@ -85,7 +85,7 @@ class MarkedPlayerManager { @SubscribeEvent fun onRenderMobColored(event: RenderMobColoredEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.markedPlayers.highlightInWorld) return val entity = event.entity @@ -96,7 +96,7 @@ class MarkedPlayerManager { @SubscribeEvent fun onResetEntityHurtTime(event: ResetEntityHurtEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.markedPlayers.highlightInWorld) return val entity = event.entity 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 9f91e1c82c3d..d00d7a0df96f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -203,6 +203,6 @@ class NonGodPotEffectDisplay { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.misc.nonGodPotEffectDisplay && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.nonGodPotEffectDisplay && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt index 8d7fafb1f5cf..c3a43853e921 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt @@ -20,6 +20,6 @@ class RealTime { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.misc.realTime + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.realTime } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt index c7432ffa9c08..28f77626f8e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderSparksHighlight.kt @@ -62,6 +62,6 @@ class ThunderSparksHighlight { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.fishing.thunderSparkHighlight + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.fishing.thunderSparkHighlight } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt index 123e7a54b5cc..2d25076a98c6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt @@ -54,5 +54,5 @@ class MilleniaAgedBlazeColor { } private fun isEnabled() = - LorenzUtils.inSkyblock && LorenzUtils.skyBlockIsland == "Crimson Isle" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor + LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == "Crimson Isle" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt index dfbe44ca2a32..ef3f965a182e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt @@ -113,6 +113,6 @@ class AshfangBlazes { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) + return LorenzUtils.inSkyBlock && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } } \ No newline at end of file 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 9dba408bc821..5649cc481f79 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 @@ -59,7 +59,7 @@ class AshfangBlazingSouls { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.blazingSouls && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.blazingSouls && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } } \ No newline at end of file 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 92692cc6589d..760bfc36d523 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 @@ -41,7 +41,7 @@ class AshfangFreezeCooldown { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.freezeCooldown && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.freezeCooldown && 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 4f54bbd5c0f5..be68a15834a1 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 @@ -55,7 +55,7 @@ class AshfangGravityOrbs { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.gravityOrbs && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.gravityOrbs && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } } \ No newline at end of file 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 3785a3f76036..0eb6ac920f90 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 @@ -21,7 +21,7 @@ class AshfangHideDamageIndicator { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideDamageSplash && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideDamageSplash && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt index b99f0ff7be10..df242b159d62 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt @@ -19,7 +19,7 @@ class AshfangHideParticles { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (tick++ % 60 == 0) { val distance = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) @@ -51,5 +51,5 @@ class AshfangHideParticles { } } - private fun isEnabled() = LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles && hideParticles + private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideParticles && hideParticles } \ No newline at end of file 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 8590c2b3643b..5fe8c7d8a57e 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 @@ -51,7 +51,7 @@ class AshfangNextResetCooldown { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.nextResetCooldown && + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.nextResetCooldown && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG) } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt index e79157ed9fb0..df3c5117f06e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt @@ -98,7 +98,7 @@ class EndermanSlayerBeacon { } } - private fun isEnabled(): Boolean = LorenzUtils.inSkyblock && + private fun isEnabled(): Boolean = LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.slayerEndermanBeacon && LorenzUtils.skyBlockIsland == "The End" && DamageIndicatorManager.isBossSpawned( diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt index 383419cdaeea..2c0748962e7c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt @@ -46,7 +46,7 @@ class HideMobNames { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.slayer.hideMobNames) return val entity = event.entity diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniboss.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniboss.kt index d5228725014c..abbb2a315fb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniboss.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniboss.kt @@ -87,6 +87,6 @@ class HighlightSlayerMiniboss { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.slayer.slayerMinibossHighlight && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.slayerMinibossHighlight && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt index 22d9b95737ae..586911264b50 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt @@ -170,6 +170,6 @@ class SlayerQuestWarning { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.slayer.questWarning + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.questWarning } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt index 3f0e8ad76bcb..43c17ec5a514 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt @@ -19,7 +19,7 @@ class BlazeSlayerClearView { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (tick++ % 60 == 0) { hideParticles = DamageIndicatorManager.getDistanceTo( BossType.SLAYER_BLAZE_1, @@ -62,6 +62,6 @@ class BlazeSlayerClearView { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.slayer.blazeClearView && hideParticles + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.blazeClearView && hideParticles } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt index 4ae548836e25..be0dc6b7866c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt @@ -36,7 +36,7 @@ class BlazeSlayerDaggerHelper { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.slayer.blazeHideDaggerWarning) return val message = event.message @@ -199,7 +199,7 @@ class BlazeSlayerDaggerHelper { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.slayer.blazeDaggers + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.blazeDaggers } @SubscribeEvent 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 3c02ed4724c9..f395793a1f7b 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 @@ -65,7 +65,7 @@ class BlazeSlayerFirePitsWarning { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && DamageIndicatorManager.isBossSpawned( + return LorenzUtils.inSkyBlock && DamageIndicatorManager.isBossSpawned( BossType.SLAYER_BLAZE_3, BossType.SLAYER_BLAZE_4, BossType.SLAYER_BLAZE_QUAZII_3, diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt index 22f22e904ab3..eea8414a98e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerPillar.kt @@ -147,7 +147,7 @@ class BlazeSlayerPillar { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && DamageIndicatorManager.isBossSpawned( + return LorenzUtils.inSkyBlock && DamageIndicatorManager.isBossSpawned( BossType.SLAYER_BLAZE_2, BossType.SLAYER_BLAZE_3, BossType.SLAYER_BLAZE_4, diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt index c0941953356d..bddbc4e9113a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt @@ -16,7 +16,7 @@ class HellionShieldHelper { @SubscribeEvent fun onRenderMobColored(event: RenderMobColoredEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.slayer.blazeColoredMobs) return val shield = hellionShieldMobs.getOrDefault(event.entity, null) ?: return @@ -25,7 +25,7 @@ class HellionShieldHelper { @SubscribeEvent fun onResetEntityHurtTime(event: ResetEntityHurtEvent) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.slayer.blazeColoredMobs) return hellionShieldMobs.getOrDefault(event.entity, null) ?: return 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 a4047a7c2cb6..0e8fce8dce30 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -41,7 +41,7 @@ class SummoningMobManager { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.isOnHypixel) return + if (!LorenzUtils.isHyPixel) return val message = event.message val matcher = spawnPatter.matcher(message) @@ -139,7 +139,7 @@ class SummoningMobManager { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.summonings.summoningMobDisplay) return if (summoningMobs.isEmpty()) return @@ -162,7 +162,7 @@ class SummoningMobManager { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.summonings.summoningMobHideNametag) return val entity = event.entity @@ -200,7 +200,7 @@ class SummoningMobManager { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && (SkyHanniMod.feature.summonings.summoningMobDisplay || SkyHanniMod.feature.summonings.summoningMobHideNametag) + return LorenzUtils.inSkyBlock && (SkyHanniMod.feature.summonings.summoningMobDisplay || SkyHanniMod.feature.summonings.summoningMobHideNametag) } class SummoningMob( 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 7c6c889b596a..dc5ac96918db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -112,6 +112,6 @@ class SummoningSoulsName { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.summonings.summoningSoulDisplay + return LorenzUtils.inSkyBlock && SkyHanniMod.feature.summonings.summoningSoulDisplay } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/inventory/GuiEditSignMixin.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/inventory/GuiEditSignMixin.java index 25e553c6379a..99c56d8be357 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/inventory/GuiEditSignMixin.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/inventory/GuiEditSignMixin.java @@ -44,7 +44,7 @@ private void initGui(CallbackInfo info) { // this.textInputUtil = new TextInputUtil(this.fontRendererObj, () -> ((IModifiedSign) this.that.tileSign).getText(this.editLine).getUnformattedText(), text -> ((IModifiedSign) this.that.tileSign).setText(this.editLine, new ChatComponentText(text)), 90); this.textInputUtil = new TextInputUtil(this.fontRendererObj, () -> ((IModifiedSign) getTileSign(this.that)).getText(this.editLine).getUnformattedText(), text -> ((IModifiedSign) getTileSign(this.that)).setText(this.editLine, new ChatComponentText(text)), 90); - if (LorenzUtils.INSTANCE.getInSkyblock() && SkyBlockcatiaConfig.enableSignSelectionList) { + if (LorenzUtils.INSTANCE.getInSkyBlock() && SkyBlockcatiaConfig.enableSignSelectionList) { List list = null; String title = null; @@ -87,7 +87,7 @@ private void onGuiClosed(CallbackInfo info) { if (SkyBlockcatiaConfig.enableSignSelectionList) { Keyboard.enableRepeatEvents(false); - if (LorenzUtils.INSTANCE.getInSkyblock()) { + if (LorenzUtils.INSTANCE.getInSkyBlock()) { // String text = this.that.tileSign.signText[0].getUnformattedText(); String text = getTileSign(this.that).signText[0].getUnformattedText(); // if (!StringUtils.isNullOrEmpty(text)) @@ -196,7 +196,7 @@ private void drawScreenPre(int mouseX, int mouseY, float partialTicks, CallbackI GlStateManager.popMatrix(); super.drawScreen(mouseX, mouseY, partialTicks); - if (LorenzUtils.INSTANCE.getInSkyblock() && SkyBlockcatiaConfig.enableSignSelectionList && this.globalSelector != null) { + if (LorenzUtils.INSTANCE.getInSkyBlock() && SkyBlockcatiaConfig.enableSignSelectionList && this.globalSelector != null) { this.globalSelector.drawScreen(mouseX, mouseY, partialTicks); } info.cancel(); @@ -205,7 +205,7 @@ private void drawScreenPre(int mouseX, int mouseY, float partialTicks, CallbackI @Inject(method = "drawScreen(IIF)V", cancellable = true, at = @At("RETURN")) private void drawScreenPost(int mouseX, int mouseY, float partialTicks, CallbackInfo info) { - if (!SkyBlockcatiaConfig.enableOverwriteSignEditing && LorenzUtils.INSTANCE.getInSkyblock() && SkyBlockcatiaConfig.enableSignSelectionList && this.globalSelector != null) { + if (!SkyBlockcatiaConfig.enableOverwriteSignEditing && LorenzUtils.INSTANCE.getInSkyBlock() && SkyBlockcatiaConfig.enableSignSelectionList && this.globalSelector != null) { this.globalSelector.drawScreen(mouseX, mouseY, partialTicks); } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index dce81b5dfc14..f7ab6a90b3e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -122,7 +122,7 @@ class LorenzTest { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Post) { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return - if (!LorenzUtils.inSkyblock) return + if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.dev.debugEnabled) return SkyHanniMod.feature.dev.debugPos.renderString(text) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index f6e2e319c555..4d0c5a2fffa4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -14,14 +14,14 @@ import java.text.SimpleDateFormat object LorenzUtils { - val isOnHypixel: Boolean + val isHyPixel: Boolean get() = HypixelData.hypixel && Minecraft.getMinecraft().thePlayer != null - val inSkyblock: Boolean - get() = isOnHypixel && HypixelData.skyblock + val inSkyBlock: Boolean + get() = isHyPixel && HypixelData.skyBlock val inDungeons: Boolean - get() = inSkyblock && DungeonData.inDungeon() + get() = inSkyBlock && DungeonData.inDungeon() val skyBlockIsland: String get() = HypixelData.skyBlockIsland @@ -37,7 +37,7 @@ object LorenzUtils { get() = HypixelData.noTrade val isBingoProfile: Boolean - get() = inSkyblock && HypixelData.bingo + get() = inSkyBlock && HypixelData.bingo const val DEBUG_PREFIX = "[SkyHanni Debug] §7" private val log = LorenzLogger("chat/mod_sent") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index 9882f8578351..1036dab625f6 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -158,7 +158,7 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { } if (!SkyHanniMod.feature.dev.printUnfilteredDebugs) return Filter.Result.ACCEPT - if (!SkyHanniMod.feature.dev.printUnfilteredDebugsOutsideSkyBlock && !LorenzUtils.inSkyblock) return Filter.Result.ACCEPT + if (!SkyHanniMod.feature.dev.printUnfilteredDebugsOutsideSkyBlock && !LorenzUtils.inSkyBlock) return Filter.Result.ACCEPT if (formattedMessage == "filtered console: ") return Filter.Result.ACCEPT debug(" ") From f5a2fa2f444817dfc67fc5c26d604fbf18ea6a6a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:35:44 +0100 Subject: [PATCH 18/32] Renamed hypixel and skyblock. --- .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 +- .../data/{HypixelData.kt => HyPixelData.kt} | 4 ++-- .../skyhanni/features/chat/PlayerDeathMessages.kt | 7 ------- .../features/event/diana/BurrowWarpHelper.kt | 3 +-- .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 14 +++++++------- 5 files changed, 11 insertions(+), 19 deletions(-) rename src/main/java/at/hannibal2/skyhanni/data/{HypixelData.kt => HyPixelData.kt} (98%) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index c59444b99268..298b01686de4 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -86,7 +86,7 @@ public void preInit(FMLPreInitializationEvent event) { new BazaarApi(); loadModule(this); loadModule(new ChatManager()); - loadModule(new HypixelData()); + loadModule(new HyPixelData()); loadModule(new DungeonData()); loadModule(new ScoreboardData()); loadModule(new ApiDataLoader()); diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt similarity index 98% rename from src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt rename to src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt index bbb3db69d9df..e1c466762d21 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent import net.minecraftforge.fml.common.network.FMLNetworkEvent -class HypixelData { +class HyPixelData { companion object { var hypixel = false @@ -37,7 +37,7 @@ class HypixelData { } } - var loggerIslandChange = LorenzLogger("debug/island_change") + private var loggerIslandChange = LorenzLogger("debug/island_change") @SubscribeEvent fun onConnect(event: FMLNetworkEvent.ClientConnectedToServerEvent) { 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 27e520ad04a8..8e6cd4d4aa03 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -1,7 +1,6 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.utils.LocationUtils @@ -10,7 +9,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.client.Minecraft import net.minecraft.client.entity.EntityOtherPlayerMP -import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent import java.util.regex.Pattern @@ -62,11 +60,6 @@ class PlayerDeathMessages { } } - @SubscribeEvent - fun onWorldChange(event: WorldEvent.Load) { - HypixelData.skyBlock = false - } - private fun checkOtherPlayers() { val location = LocationUtils.playerLocation() for (otherPlayer in Minecraft.getMinecraft().theWorld.loadedEntityList diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index cbfa28c9a7ff..245fa85af8c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.event.diana -import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -44,7 +43,7 @@ class BurrowWarpHelper { @SubscribeEvent fun onStatusBar(event: LorenzChatEvent) { - if (!HypixelData.skyBlock) return + if (!LorenzUtils.inSkyBlock) return if (event.message == "§cYou haven't unlocked this fast travel destination!") { val time = System.currentTimeMillis() - lastWarpTime diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 4d0c5a2fffa4..8140cddfa6b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.HypixelData +import at.hannibal2.skyhanni.data.HyPixelData import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.Minecraft @@ -15,29 +15,29 @@ import java.text.SimpleDateFormat object LorenzUtils { val isHyPixel: Boolean - get() = HypixelData.hypixel && Minecraft.getMinecraft().thePlayer != null + get() = HyPixelData.hypixel && Minecraft.getMinecraft().thePlayer != null val inSkyBlock: Boolean - get() = isHyPixel && HypixelData.skyBlock + get() = isHyPixel && HyPixelData.skyBlock val inDungeons: Boolean get() = inSkyBlock && DungeonData.inDungeon() val skyBlockIsland: String - get() = HypixelData.skyBlockIsland + get() = HyPixelData.skyBlockIsland //TODO add cache val skyBlockArea: String - get() = HypixelData.readSkyBlockArea() + get() = HyPixelData.readSkyBlockArea() val inKuudraFight: Boolean get() = skyBlockIsland == "Instanced" val noTradeMode: Boolean - get() = HypixelData.noTrade + get() = HyPixelData.noTrade val isBingoProfile: Boolean - get() = inSkyBlock && HypixelData.bingo + get() = inSkyBlock && HyPixelData.bingo const val DEBUG_PREFIX = "[SkyHanni Debug] §7" private val log = LorenzLogger("chat/mod_sent") From 5575621d5cf3b8b037e4f6165fb3a8209f7b6453 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 03:11:17 +0100 Subject: [PATCH 19/32] Introduced IslandType enum. --- .../at/hannibal2/skyhanni/data/HyPixelData.kt | 24 +++++++++++++------ .../at/hannibal2/skyhanni/data/IslandType.kt | 22 +++++++++++++++++ .../skyhanni/events/IslandChangeEvent.kt | 4 +++- .../features/end/VoidlingExtremistColor.kt | 3 ++- .../features/minion/MinionFeatures.kt | 13 +++++----- .../features/misc/CorruptedMobHighlight.kt | 3 ++- .../features/nether/MilleniaAgedBlazeColor.kt | 3 ++- .../features/slayer/EndermanSlayerBeacon.kt | 3 ++- .../hannibal2/skyhanni/utils/LorenzUtils.kt | 5 ++-- 9 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/data/IslandType.kt diff --git a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt index e1c466762d21..24738893fa15 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -17,7 +17,7 @@ class HyPixelData { companion object { var hypixel = false var skyBlock = false - var skyBlockIsland: String = "" + var skyBlockIsland = IslandType.UNKNOWN //Ironman, Stranded and Bingo var noTrade = false @@ -133,14 +133,24 @@ class HyPixelData { guesting = true } } - if (guesting) { - newIsland = "$newIsland guesting" + + var islandType = IslandType.getBySidebarName(newIsland) + + if (islandType == IslandType.PRIVATE_ISLAND) { + if (guesting) { + islandType = IslandType.PRIVATE_ISLAND_GUEST + } } - if (skyBlockIsland != newIsland) { - IslandChangeEvent(newIsland, skyBlockIsland).postAndCatch() - loggerIslandChange.log(newIsland) - skyBlockIsland = newIsland + if (skyBlockIsland != islandType) { + IslandChangeEvent(islandType, skyBlockIsland).postAndCatch() + if (islandType == IslandType.UNKNOWN) { + println("Unknown island detected: '$newIsland'") + loggerIslandChange.log("Unknown: '$newIsland'") + } else { + loggerIslandChange.log(islandType.name) + } + skyBlockIsland = islandType } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt b/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt new file mode 100644 index 000000000000..527cce54827d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt @@ -0,0 +1,22 @@ +package at.hannibal2.skyhanni.data + +enum class IslandType(val displayName: String) { + PRIVATE_ISLAND("Private Island"), + PRIVATE_ISLAND_GUEST("Private Island Guest"), + THE_END("The End"), + KUUDRA_ARENA("Instanced"), + CRIMSON_ISLE("Crimson Isle"), + + HUB("Hub"), + THE_FARMING_ISLANDS("The Farming Islands"), + + NONE(""), + UNKNOWN("???"), + ; + + companion object { + fun getBySidebarName(name: String): IslandType { + return values().firstOrNull { it.displayName == name } ?: UNKNOWN + } + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/events/IslandChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/IslandChangeEvent.kt index 2dec9acad073..291ccd995db9 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/IslandChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/IslandChangeEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class IslandChangeEvent(val newIsland: String, val oldIsland: String?) : LorenzEvent() \ No newline at end of file +import at.hannibal2.skyhanni.data.IslandType + +class IslandChangeEvent(val newIsland: IslandType, val oldIsland: IslandType) : LorenzEvent() \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt b/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt index 6f6a083d8e2d..c9b02bf5dd7c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.end import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.RenderMobColoredEvent import at.hannibal2.skyhanni.events.ResetEntityHurtEvent import at.hannibal2.skyhanni.events.withAlpha @@ -54,5 +55,5 @@ class VoidlingExtremistColor { } private fun isEnabled(): Boolean = - LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == "The End" && SkyHanniMod.feature.misc.voidlingExtremistColor + LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.THE_END && SkyHanniMod.feature.misc.voidlingExtremistColor } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 707c364059c9..ee72ff54246f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.minion import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled @@ -48,7 +49,7 @@ class MinionFeatures { @SubscribeEvent fun onClick(event: InputEvent.MouseInputEvent) { if (!LorenzUtils.inSkyBlock) return - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (!Mouse.getEventButtonState()) return if (Mouse.getEventButton() != 1) return @@ -63,7 +64,7 @@ class MinionFeatures { @SubscribeEvent fun onRenderLastClickedMinion(event: RenderWorldLastEvent) { if (!LorenzUtils.inSkyBlock) return - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (!SkyHanniMod.feature.minions.lastClickedMinionDisplay) return val special = SkyHanniMod.feature.minions.lastOpenedMinionColor @@ -87,7 +88,7 @@ class MinionFeatures { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (InventoryUtils.currentlyOpenInventory().contains("Minion")) { if (lastClickedEntity != null) { @@ -175,7 +176,7 @@ class MinionFeatures { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { if (!LorenzUtils.inSkyBlock) return - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (event.message.matchRegex("§aYou received §r§6(.*) coins§r§a!")) { lastCoinsRecived = System.currentTimeMillis() @@ -189,7 +190,7 @@ class MinionFeatures { fun onRenderLastEmptied(event: RenderWorldLastEvent) { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.minions.emptiedTimeDisplay) return - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return val playerLocation = LocationUtils.playerLocation() val playerEyeLocation = LocationUtils.playerEyeLocation() @@ -211,7 +212,7 @@ class MinionFeatures { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { if (!LorenzUtils.inSkyBlock) return - if (LorenzUtils.skyBlockIsland != "Private Island") return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (!SkyHanniMod.feature.minions.hideMobsNametagNearby) return val entity = event.entity diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt index d2ab1725a129..0b4effca4683 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CorruptedMobHighlight.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent import at.hannibal2.skyhanni.events.RenderMobColoredEvent import at.hannibal2.skyhanni.events.ResetEntityHurtEvent @@ -56,6 +57,6 @@ class CorruptedMobHighlight { private fun isEnabled(): Boolean { return LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.corruptedMobHighlight && - LorenzUtils.skyBlockIsland != "Private Island" + LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt index 2d25076a98c6..8a9cad4fa6b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.RenderMobColoredEvent import at.hannibal2.skyhanni.events.ResetEntityHurtEvent import at.hannibal2.skyhanni.events.withAlpha @@ -54,5 +55,5 @@ class MilleniaAgedBlazeColor { } private fun isEnabled() = - LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == "Crimson Isle" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor + LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.CRIMSON_ISLE && SkyHanniMod.feature.misc.milleniaAgedBlazeColor } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt index df3c5117f06e..a36db482009c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.slayer import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.RenderMobColoredEvent @@ -100,7 +101,7 @@ class EndermanSlayerBeacon { private fun isEnabled(): Boolean = LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.slayerEndermanBeacon && - LorenzUtils.skyBlockIsland == "The End" && + LorenzUtils.skyBlockIsland == IslandType.THE_END && DamageIndicatorManager.isBossSpawned( BossType.SLAYER_ENDERMAN_2, BossType.SLAYER_ENDERMAN_3, diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 8140cddfa6b5..043978277d4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.HyPixelData +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.Minecraft @@ -23,7 +24,7 @@ object LorenzUtils { val inDungeons: Boolean get() = inSkyBlock && DungeonData.inDungeon() - val skyBlockIsland: String + val skyBlockIsland: IslandType get() = HyPixelData.skyBlockIsland //TODO add cache @@ -31,7 +32,7 @@ object LorenzUtils { get() = HyPixelData.readSkyBlockArea() val inKuudraFight: Boolean - get() = skyBlockIsland == "Instanced" + get() = skyBlockIsland == IslandType.KUUDRA_ARENA val noTradeMode: Boolean get() = HyPixelData.noTrade From b34cd252441b0407fd471cb1905804e6a90aff98 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 03:20:00 +0100 Subject: [PATCH 20/32] Typo. --- .../at/hannibal2/skyhanni/features/misc/CollectionCounter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt index 90d5c39efed7..e36b5001e784 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt @@ -62,7 +62,7 @@ class CollectionCounter { val apiName = data.apiName if (!apiCollectionData.contains(apiName)) { - LorenzUtils.chat("§c[SkyHanni] Item $name not in collection data!") + LorenzUtils.chat("§c[SkyHanni] Item $name is not in collection data!") return } From f18d2bf5711fa2ba844f78234335708efcd2230a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 03:34:10 +0100 Subject: [PATCH 21/32] replaced "text to render" to "display" --- .../skyhanni/config/core/GuiElementTextField.java | 6 +++--- .../at/hannibal2/skyhanni/data/SendTitleHelper.kt | 6 +++--- .../skyhanni/features/bazaar/BazaarBestSellMethod.kt | 8 ++++---- .../skyhanni/features/dungeon/DungeonDeathCounter.kt | 8 ++++---- .../features/dungeon/DungeonMilestonesDisplay.kt | 12 ++++++------ .../skyhanni/features/misc/NonGodPotEffectDisplay.kt | 12 ++++++------ .../java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java b/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java index 3652f76f54f2..56114c161595 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java +++ b/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java @@ -566,9 +566,9 @@ private void drawTextbox( ); GlScissorStack.pop(scaledresolution); } else { -// String toRender = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(ChromaUtils.INSTANCE.chromaStringByColourCode( - String toRender = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(texts[yOffI], searchBarXSize - 10); - Minecraft.getMinecraft().fontRendererObj.drawString(toRender, x + 5, +// String display = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(ChromaUtils.INSTANCE.chromaStringByColourCode( + String display = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(texts[yOffI], searchBarXSize - 10); + Minecraft.getMinecraft().fontRendererObj.drawString(display, x + 5, y + (searchBarYSize - 8) / 2 + yOff, customTextColour ); } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt index f3807be83865..f0abb14273c6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt @@ -10,11 +10,11 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SendTitleHelper { companion object { - private var textToRender = "" + private var display = "" private var endTime = 0L fun sendTitle(text: String, duration: Int) { - textToRender = text + display = text endTime = System.currentTimeMillis() + duration } } @@ -36,7 +36,7 @@ class SendTitleHelper { GlStateManager.pushMatrix() GlStateManager.translate((width / 2).toFloat(), (height / 1.8).toFloat(), 0.0f) GlStateManager.scale(4.0f, 4.0f, 4.0f) - TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRender, renderer, 0f, 0f, false, 75, 0) + TextRenderUtils.drawStringCenteredScaledMaxWidth(display, renderer, 0f, 0f, false, 75, 0) GlStateManager.popMatrix() } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index eb6d98d3146b..200c3e69e832 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -15,18 +15,18 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BazaarBestSellMethod { companion object { - private var textToRender = "" + private var display = "" } @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.CloseWindowEvent) { - textToRender = "" + display = "" } @SubscribeEvent fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent.Post) { if (!isEnabled()) return - textToRender = getNewText(event) + display = getNewText(event) } private fun getNewText(event: GuiScreenEvent.DrawScreenEvent.Post): String { @@ -74,7 +74,7 @@ class BazaarBestSellMethod { fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { if (!isEnabled()) return - SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(textToRender) + SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(display) } private fun isEnabled(): Boolean { 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 672e2d262070..e40b66968b6d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DungeonDeathCounter { - private var textToRender = "" + private var display = "" private var deaths = 0 private fun isDeathMessage(message: String): Boolean = when { @@ -60,7 +60,7 @@ class DungeonDeathCounter { private fun update() { if (deaths == 0) { - textToRender = "" + display = "" return } @@ -69,7 +69,7 @@ class DungeonDeathCounter { 3 -> "§c" else -> "§4" } - textToRender = color + "Deaths: $deaths" + display = color + "Deaths: $deaths" } @SubscribeEvent @@ -89,7 +89,7 @@ class DungeonDeathCounter { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + textToRender) + SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + display) } private fun isEnabled(): Boolean { 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 9457d4a5dbd3..692a077de588 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -15,7 +15,7 @@ class DungeonMilestonesDisplay { companion object { - private var textToRender = "" + private var display = "" var color = "" var currentMilestone = 0 var timeReached = 0L @@ -40,8 +40,8 @@ class DungeonMilestonesDisplay { private fun checkVisibility() { if (currentMilestone >= 3) { if (System.currentTimeMillis() > timeReached + 3_000) - if (textToRender != "") { - textToRender = textToRender.substring(1) + if (display != "") { + display = display.substring(1) } } } @@ -68,12 +68,12 @@ class DungeonMilestonesDisplay { 2 -> "§e" else -> "§a" } - textToRender = "Current Milestone: $currentMilestone" + display = "Current Milestone: $currentMilestone" } @SubscribeEvent fun onWorldChange(event: WorldEvent.Load) { - textToRender = "" + display = "" currentMilestone = 0 } @@ -88,7 +88,7 @@ class DungeonMilestonesDisplay { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + textToRender) + SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + display) } private fun isEnabled(): Boolean { 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 d00d7a0df96f..44e9332f49d8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -23,7 +23,7 @@ class NonGodPotEffectDisplay { private var checkFooter = false private val activeEffects = mutableMapOf() - private val textToRender = mutableListOf() + private val display = mutableListOf() private var lastTick = 0L private var nonGodPotEffects = mapOf( @@ -58,7 +58,7 @@ class NonGodPotEffectDisplay { private fun format() { val now = System.currentTimeMillis() - textToRender.clear() + display.clear() if (activeEffects.values.removeIf { now > it }) { //to fetch the real amount of active pots totalEffectsCount = 0 @@ -72,12 +72,12 @@ class NonGodPotEffectDisplay { val color = colorForTime(seconds) - textToRender.add("$label $color$format") + display.add("$label $color$format") } val diff = totalEffectsCount - activeEffects.size if (diff > 0) { - textToRender.add("§eOpen the /effects inventory") - textToRender.add("§eto show the missing $diff effects!") + display.add("§eOpen the /effects inventory") + display.add("§eto show the missing $diff effects!") checkFooter = true } } @@ -182,7 +182,7 @@ class NonGodPotEffectDisplay { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(textToRender) + SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display) } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 3697838c7c00..ff28c52abef5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -430,20 +430,20 @@ object RenderUtils { if (string == null) return if (string == "") return - val textToRender = "§f$string" + val display = "§f$string" GlStateManager.pushMatrix() val resolution = ScaledResolution(minecraft) val renderer = minecraft.renderManager.fontRenderer ?: return - val offsetX = (200 - renderer.getStringWidth(textToRender.removeColor())) / 2 + val offsetX = (200 - renderer.getStringWidth(display.removeColor())) / 2 val x = getAbsX(resolution, 200) + offsetX val y = getAbsY(resolution, 16) + offsetY GlStateManager.translate(x + 1.0, y + 1.0, 0.0) - renderer.drawStringWithShadow(textToRender, 0f, 0f, 0) + renderer.drawStringWithShadow(display, 0f, 0f, 0) GlStateManager.popMatrix() } From f76d0a1b556e84a16825540c8db77416b18660cf Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 03:36:08 +0100 Subject: [PATCH 22/32] Removed player rank color from custom potion splash message. --- .../skyhanni/features/misc/CompactSplashPotionMessage.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt index 4cf8c7816925..99e6395fdaba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CompactSplashPotionMessage.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.util.ChatComponentText import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @@ -27,9 +28,9 @@ class CompactSplashPotionMessage { matcher = POTION_EFFECT_OTHERS_PATTERN.matcher(event.message) if (matcher.matches()) { - val playerName = matcher.group(1) + val playerName = matcher.group(1).removeColor() val effectName = matcher.group(2) - event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$effectName §7(by $playerName§7)") + event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$effectName §7(by §b$playerName§7)") } } } \ No newline at end of file From 7ddb5e78d3453fdb4806ac871b167a6c3e3f0094 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 03:47:44 +0100 Subject: [PATCH 23/32] More Kotlin love. --- .../java/at/hannibal2/skyhanni/data/HyPixelData.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt index 24738893fa15..2bb7c7678bdb 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -27,13 +27,10 @@ class HyPixelData { var bingo = false fun readSkyBlockArea(): String { - for (line in ScoreboardData.sidebarLinesFormatted()) { - if (line.startsWith(" §7⏣ ")) { - return line.substring(5).removeColor() - } - } - - return "invalid" + return ScoreboardData.sidebarLinesFormatted() + .firstOrNull { it.startsWith(" §7⏣ ") } + ?.substring(5)?.removeColor() + ?: "invalid" } } From 79aca07f30e8e3ed58f32d0d238ec3f4024c17c8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 04:58:27 +0100 Subject: [PATCH 24/32] Fixed error in Sea Creature Guide inventory. --- CHANGELOG.md | 3 ++- .../features/inventory/ItemDisplayOverlayFeatures.kt | 12 ++++++++---- .../at/hannibal2/skyhanni/utils/InventoryUtils.kt | 11 +++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72210d27a177..e8b1e9f92be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ + Do no longer prevent the selling of bazaar items to NPC when on ironman, stranded or bingo mode. ### Fixes -+ Dungeon level color fixed wrong colors. ++ Fixed wrong dungeon level colors. (in Party Finder) ++ Fixed error in Sea Creature Guide inventory. ## Version 0.13 diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 4e25e3c83b20..bc79fdbc5afe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.RenderItemTipEvent +import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -61,10 +62,13 @@ class ItemDisplayOverlayFeatures { } if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(4)) { - if (ItemUtils.isPet(name)) { - val level = name.between("Lvl ", "] ").toInt() - if (level != ItemUtils.maxPetLevel(name)) { - return "$level" + val chestName = InventoryUtils.openInventoryName() + if (!chestName.endsWith("Sea Creature Guide")) { + if (ItemUtils.isPet(name)) { + val level = name.between("Lvl ", "] ").toInt() + if (level != ItemUtils.maxPetLevel(name)) { + return "$level" + } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index 1d51d1be9b11..f1f107e2fb50 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -32,4 +32,15 @@ object InventoryUtils { } return list } + + fun openInventoryName(): String { + val guiChest = Minecraft.getMinecraft().currentScreen + val chestName = if (guiChest is GuiChest) { + val chest = guiChest.inventorySlots as ContainerChest + chest.lowerChestInventory.displayName.unformattedText.trim() + } else { + "" + } + return chestName + } } \ No newline at end of file From 76f1295374ab5210e5e7d69956a64096db4c9d6d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 05:39:53 +0100 Subject: [PATCH 25/32] Using getInventoryName methods. --- .../skyhanni/events/GuiContainerEvent.kt | 17 ++++++++++------- .../features/anvil/AnvilCombineHelper.kt | 6 +++--- .../features/bazaar/BazaarOrderHelper.kt | 3 ++- .../dungeon/CroesusUnopenedChestTracker.kt | 7 +------ .../features/dungeon/DungeonLevelColor.kt | 9 ++------- .../features/inventory/HideNotClickableItems.kt | 13 ++++--------- .../features/inventory/RngMeterInventory.kt | 15 ++------------- .../skyhanni/features/inventory/StatsTuning.kt | 14 ++------------ .../hannibal2/skyhanni/utils/InventoryUtils.kt | 11 ++++++++--- 9 files changed, 34 insertions(+), 61 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt index 9a993cb77f4a..437130bdde0f 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt @@ -2,15 +2,10 @@ package at.hannibal2.skyhanni.events import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.inventory.Container -import net.minecraft.inventory.ContainerChest import net.minecraft.inventory.Slot import net.minecraftforge.fml.common.eventhandler.Cancelable abstract class GuiContainerEvent(open val gui: GuiContainer, open val container: Container) : LorenzEvent() { - val chestName: String by lazy { - if (container !is ContainerChest) error("Container is not a chest") - return@lazy (container as ContainerChest).lowerChestInventory.displayName.unformattedText.trim() - } data class BackgroundDrawnEvent( override val gui: GuiContainer, @@ -27,10 +22,18 @@ abstract class GuiContainerEvent(open val gui: GuiContainer, open val container: abstract class DrawSlotEvent(gui: GuiContainer, container: Container, open val slot: Slot) : GuiContainerEvent(gui, container) { @Cancelable - data class GuiContainerDrawSlotPre(override val gui: GuiContainer, override val container: Container, override val slot: Slot) : + data class GuiContainerDrawSlotPre( + override val gui: GuiContainer, + override val container: Container, + override val slot: Slot + ) : DrawSlotEvent(gui, container, slot) - data class GuiContainerDrawSlotPost(override val gui: GuiContainer, override val container: Container, override val slot: Slot) : + data class GuiContainerDrawSlotPost( + override val gui: GuiContainer, + override val container: Container, + override val slot: Slot + ) : DrawSlotEvent(gui, container, slot) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt index 9604cb05c358..e03126fde555 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.anvil import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils @@ -18,9 +19,8 @@ class AnvilCombineHelper { if (!SkyHanniMod.feature.inventory.anvilCombineHelper) return if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chest = event.gui.inventorySlots as ContainerChest + val chestName = chest.getInventoryName() if (chestName != "Anvil") return diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt index 31bc1e978089..fb4c3079b171 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.bazaar import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor @@ -26,7 +27,7 @@ class BazaarOrderHelper { if (event.gui !is GuiChest) return val guiChest = event.gui val chest = guiChest.inventorySlots as ContainerChest - val inventoryName = chest.lowerChestInventory.displayName.unformattedText.trim() + val inventoryName = chest.getInventoryName() if (!isBazaarOrderInventory(inventoryName)) return out@ for (slot in chest.inventorySlots) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt index 024c05c86f71..20d7207f0093 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt @@ -7,8 +7,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -19,10 +17,7 @@ class CroesusUnopenedChestTracker { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.dungeon.croesusUnopenedChestTracker) return - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = InventoryUtils.openInventoryName() if (chestName == "Croesus") { for (slot in InventoryUtils.getItemsInOpenChest()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt index 9b9027d833fc..ff334737b658 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt @@ -1,11 +1,9 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.client.Minecraft -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @@ -20,10 +18,7 @@ class DungeonLevelColor { if (!SkyHanniMod.feature.dungeon.partyFinderColoredClassLevel) return if (event.toolTip == null) return - val guiChest = Minecraft.getMinecraft().currentScreen - if (guiChest !is GuiChest) return - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = InventoryUtils.openInventoryName() if (chestName != "Party Finder") return val stack = event.itemStack diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 4ec29baf216b..a72466a661ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -7,12 +7,12 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.StringUtils.removeColor import com.google.gson.JsonObject -import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest import net.minecraft.item.ItemStack @@ -70,7 +70,7 @@ class HideNotClickableItems { if (event.gui !is GuiChest) return val guiChest = event.gui val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = chest.getInventoryName() for (slot in chest.inventorySlots) { if (slot == null) continue @@ -92,10 +92,7 @@ class HideNotClickableItems { fun onTooltip(event: ItemTooltipEvent) { if (isDisabled()) return if (event.toolTip == null) return - val guiChest = Minecraft.getMinecraft().currentScreen - if (guiChest !is GuiChest) return - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = InventoryUtils.openInventoryName() val stack = event.itemStack if (InventoryUtils.getItemsInOpenChest().map { it.stack }.contains(stack)) return @@ -119,9 +116,7 @@ class HideNotClickableItems { fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (isDisabled()) return if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = InventoryUtils.openInventoryName() val slot = event.slot ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt index ec381a124d2d..eb2ead1fb2c6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt @@ -11,9 +11,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.between import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraft.client.Minecraft -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -21,11 +18,7 @@ class RngMeterInventory { @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { - val screen = Minecraft.getMinecraft().currentScreen - if (screen !is GuiChest) return - val chest = screen.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() - + val chestName = InventoryUtils.openInventoryName() val stack = event.stack if (SkyHanniMod.feature.inventory.rngMeterFloorName) { @@ -42,11 +35,7 @@ class RngMeterInventory { fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() - + val chestName = InventoryUtils.openInventoryName() if (SkyHanniMod.feature.inventory.rngMeterNoDrop) { if (chestName == "Catacombs RNG Meter") { for (slot in InventoryUtils.getItemsInOpenChest()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt index d33f030426a1..98383bd0c63d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt @@ -9,9 +9,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import net.minecraft.client.Minecraft -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @@ -22,10 +19,7 @@ class StatsTuning { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { - val screen = Minecraft.getMinecraft().currentScreen - if (screen !is GuiChest) return - val chest = screen.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + val chestName = InventoryUtils.openInventoryName() val stack = event.stack @@ -107,11 +101,7 @@ class StatsTuning { fun onDrawSelectedTemplate(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() - + val chestName = InventoryUtils.openInventoryName() if (SkyHanniMod.feature.inventory.statsTuningSelectedTemplate) { if (chestName == "Stats Tuning") { for (slot in InventoryUtils.getItemsInOpenChest()) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index f1f107e2fb50..feaaaa4813a4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -11,9 +11,10 @@ object InventoryUtils { fun currentlyOpenInventory(): String { val screen = Minecraft.getMinecraft().currentScreen if (screen !is GuiChest) return "" - val chest = screen.inventorySlots as ContainerChest + val inventorySlots = screen.inventorySlots + val chest = inventorySlots as ContainerChest - return chest.lowerChestInventory.displayName.unformattedText.trim() + return chest.getInventoryName() } fun getItemsInOpenChest(): List { @@ -37,10 +38,14 @@ object InventoryUtils { val guiChest = Minecraft.getMinecraft().currentScreen val chestName = if (guiChest is GuiChest) { val chest = guiChest.inventorySlots as ContainerChest - chest.lowerChestInventory.displayName.unformattedText.trim() + chest.getInventoryName() } else { "" } return chestName } + + fun ContainerChest.getInventoryName(): String { + return this.lowerChestInventory.displayName.unformattedText.trim() + } } \ No newline at end of file From dbb237f4bd98f5e261a079642c913597455e789f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 06:02:52 +0100 Subject: [PATCH 26/32] Fixed crash. --- .../skyhanni/features/inventory/HideNotClickableItems.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index a72466a661ff..afdc446f95dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.StringUtils.removeColor import com.google.gson.JsonObject +import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest import net.minecraft.item.ItemStack @@ -92,7 +93,10 @@ class HideNotClickableItems { fun onTooltip(event: ItemTooltipEvent) { if (isDisabled()) return if (event.toolTip == null) return - val chestName = InventoryUtils.openInventoryName() + + val guiChest = Minecraft.getMinecraft().currentScreen + if (guiChest !is GuiChest) return + val chestName = (guiChest.inventorySlots as ContainerChest).getInventoryName() val stack = event.itemStack if (InventoryUtils.getItemsInOpenChest().map { it.stack }.contains(stack)) return From 8d1fa19a94a9820e2be5e7fe6a5b41371922f175 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 07:12:36 +0100 Subject: [PATCH 27/32] Add Brewing Stand Overlay. --- CHANGELOG.md | 5 ++- FEATURES.md | 3 +- .../at/hannibal2/skyhanni/SkyHanniMod.java | 1 + .../skyhanni/config/features/Misc.java | 5 +++ .../hannibal2/skyhanni/data/ItemTipHelper.kt | 7 +++- .../events/RenderInventoryItemTipEvent.kt | 3 ++ .../features/misc/BrewingStandOverlay.kt | 39 +++++++++++++++++++ 7 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b1e9f92be5..98514c811c3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ ### Features + Added /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. -+ Added Compact Bingo Chat Messages -+ Added Compact Potion Effect Chat Messages ++ Added Compact Bingo Chat Messages. ++ Added Compact Potion Effect Chat Messages. ++ Added Brewing Stand Overlay. ### Changes + Don't render overlays when tab list key is pressed. diff --git a/FEATURES.md b/FEATURES.md index 9687098b0e74..eb6d2c742918 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -159,4 +159,5 @@ - Hide armor or just helmet of other player or yourself - Display the active non-god potion effects. - Option to hide blaze particles. -- Wishing compass uses amount display. \ No newline at end of file +- Wishing compass uses amount display. +- Brewing Stand Overlay. \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 298b01686de4..62ff318ae047 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -170,6 +170,7 @@ public void preInit(FMLPreInitializationEvent event) { loadModule(new CompactSplashPotionMessage()); loadModule(new CroesusUnopenedChestTracker()); loadModule(new CompactBingoChat()); + loadModule(new BrewingStandOverlay()); Commands.INSTANCE.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index a47b7979e6b7..58186b08eb91 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -139,4 +139,9 @@ public class Misc { @ConfigOption(name = "Collection Counter Position", desc = "Tracking the number of items you collect. §cDoes not work with sacks.") @ConfigEditorButton(runnableId = "collectionCounter", buttonText = "Edit") public Position collectionCounterPos = new Position(10, 10, false, true); + + @Expose + @ConfigOption(name = "Brewing Stand Overlay", desc = "Display the Item names directly inside the Brewing Stand") + @ConfigEditorBoolean + public boolean brewingStandOverlay = true; } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt index 30b9ad03f688..7937ab2aee66 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt @@ -5,10 +5,12 @@ import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.client.renderer.GlStateManager +import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -55,6 +57,8 @@ class ItemTipHelper { val gui = Minecraft.getMinecraft().currentScreen if (gui !is GuiChest) return + val chest = gui.inventorySlots as ContainerChest + var inventoryName = chest.getInventoryName() val guiLeft = (gui as AccessorGuiContainer).guiLeft val guiTop = (gui as AccessorGuiContainer).guiTop @@ -65,9 +69,8 @@ class ItemTipHelper { GlStateManager.disableBlend() for (slot in gui.inventorySlots.inventorySlots) { val stack = slot.stack ?: continue - if (stack.stackSize != 1) continue - val itemTipEvent = RenderInventoryItemTipEvent(stack) + val itemTipEvent = RenderInventoryItemTipEvent(inventoryName, slot, stack) itemTipEvent.postAndCatch() val stackTip = itemTipEvent.stackTip if (stackTip.isEmpty()) continue diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderInventoryItemTipEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderInventoryItemTipEvent.kt index 4576576bdee9..7bb4692ece5a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderInventoryItemTipEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderInventoryItemTipEvent.kt @@ -1,8 +1,11 @@ package at.hannibal2.skyhanni.events +import net.minecraft.inventory.Slot import net.minecraft.item.ItemStack class RenderInventoryItemTipEvent( + val inventoryName: String, + val slot: Slot, val stack: ItemStack, var stackTip: String = "", var offsetX: Int = 0, diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt new file mode 100644 index 000000000000..6496e3d4cc7e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt @@ -0,0 +1,39 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BrewingStandOverlay { + + @SubscribeEvent + fun onRenderItemTip(event: RenderInventoryItemTipEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.misc.brewingStandOverlay) return + + if (event.inventoryName != "Brewing Stand") return + + val stack = event.stack + val name = stack.name ?: return + + when (event.slot.slotNumber) { + 13, // Ingredient input + 21, // Progress + 42, // Output right side + -> { + } + + else -> return + } + + // Hide the progress slot when not active + if (name.contains(" or ")) return + + event.stackTip = name + event.offsetX = 3 + event.offsetY = -5 + event.alignLeft = false + } +} \ No newline at end of file From 7fcc7f07477c057d950681a2c6142d2553ab447f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 07:44:30 +0100 Subject: [PATCH 28/32] Better Brewing Stand Overlay design. --- .../skyhanni/features/misc/BrewingStandOverlay.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt index 6496e3d4cc7e..5557309a2f8c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt @@ -18,7 +18,8 @@ class BrewingStandOverlay { val stack = event.stack val name = stack.name ?: return - when (event.slot.slotNumber) { + val slotNumber = event.slot.slotNumber + when (slotNumber) { 13, // Ingredient input 21, // Progress 42, // Output right side @@ -28,11 +29,15 @@ class BrewingStandOverlay { else -> return } + if (slotNumber == 21) { + event.offsetX = 55 + } + // Hide the progress slot when not active if (name.contains(" or ")) return event.stackTip = name - event.offsetX = 3 + event.offsetX = event.offsetX + 3 event.offsetY = -5 event.alignLeft = false } From a57817c043b6d201dbb88ed4d3d7fefbcd827256 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 07:44:37 +0100 Subject: [PATCH 29/32] Code cleanup. --- .../hannibal2/skyhanni/features/inventory/StatsTuning.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt index 98383bd0c63d..dd17caf48136 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt @@ -19,12 +19,12 @@ class StatsTuning { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { - val chestName = InventoryUtils.openInventoryName() + val inventoryName = event.inventoryName val stack = event.stack if (SkyHanniMod.feature.inventory.statsTuningTemplateStats) { - if (chestName == "Stats Tuning") { + if (inventoryName == "Stats Tuning") { val name = stack.name ?: return if (name == "§aLoad") { var grab = false @@ -54,7 +54,7 @@ class StatsTuning { } } if (SkyHanniMod.feature.inventory.statsTuningSelectedStats) { - if (chestName == "Accessory Bag Thaumaturgy") { + if (inventoryName == "Accessory Bag Thaumaturgy") { val name = stack.name ?: return if (name == "§aStats Tuning") { var grab = false @@ -84,7 +84,7 @@ class StatsTuning { } } if (SkyHanniMod.feature.inventory.statsTuningPoints) { - if (chestName == "Stats Tuning") { + if (inventoryName == "Stats Tuning") { for (line in stack.getLore()) { val matcher = patternStatPoints.matcher(line) if (matcher.matches()) { From 950c145f3eb149185e480a0e2cc8c281b13115d6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:47:50 +0100 Subject: [PATCH 30/32] Added minion name display. --- .../skyhanni/config/features/Hidden.java | 5 +- .../skyhanni/config/features/Minions.java | 15 ++- .../skyhanni/features/minion/MinionData.kt | 5 + .../features/minion/MinionFeatures.kt | 98 +++++++++++++------ 4 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/minion/MinionData.kt diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java index eef96aa56d4b..b3d138269a53 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java @@ -14,5 +14,8 @@ public class Hidden { public String currentPet = ""; @Expose - public Map minions = new HashMap<>(); + public Map minionLastClick = new HashMap<>(); + + @Expose + public Map minionName = new HashMap<>(); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java b/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java index 718c46576bf4..d29eb45bd3c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java @@ -6,6 +6,11 @@ public class Minions { + @Expose + @ConfigOption(name = "Name Display", desc = "Show the minion name and tier over the minion.") + @ConfigEditorBoolean + public boolean nameDisplay = true; + @ConfigOption(name = "Last Clicked", desc = "") @ConfigEditorAccordion(id = 0) public boolean lastClickedMinion = false; @@ -43,15 +48,15 @@ public class Minions { public boolean emptiedTime = false; @Expose - @ConfigOption(name = "Emptied Time Display", desc = "Show the time when the hopper in the minion was last emptied") + @ConfigOption(name = "Emptied Time Display", desc = "Show the time when the hopper in the minion was last emptied.") @ConfigEditorBoolean @ConfigAccordionId(id = 1) public boolean emptiedTimeDisplay = false; @Expose @ConfigOption( - name = "Emptied Time Distance", - desc = "At what distance is this display shown" + name = "Distance", + desc = "At what distance is the minion display shown." ) @ConfigEditorSlider( minValue = 3, @@ -59,7 +64,7 @@ public class Minions { minStep = 1 ) @ConfigAccordionId(id = 1) - public int emptiedTimeDistance = 10; + public int distance = 10; @ConfigOption(name = "Hopper Profit", desc = "") @ConfigEditorAccordion(id = 2) @@ -69,7 +74,7 @@ public class Minions { @ConfigOption(name = "Hopper Profit Display", desc = "Using the held coins and the last empty time to calculate the coins a hopper collects in a day") @ConfigEditorBoolean @ConfigAccordionId(id = 2) - public boolean hopperProfitDisplay = false; + public boolean hopperProfitDisplay = true; @Expose @ConfigOption(name = "Best Sell Method Position", desc = "") diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionData.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionData.kt new file mode 100644 index 000000000000..02ee25b51815 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionData.kt @@ -0,0 +1,5 @@ +package at.hannibal2.skyhanni.features.minion + +import scala.Serializable + +class MinionData(var name: String,var lastClicked: Long) : Serializable \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index ee72ff54246f..5751fefd742c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.formatInteger import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.renderString import net.minecraft.client.Minecraft @@ -28,21 +29,24 @@ import java.awt.Color class MinionFeatures { - var lastClickedEntity: LorenzVec? = null - var lastMinion: LorenzVec? = null - var lastMinionOpened = 0L - var minionInventoryOpen = false + private var lastClickedEntity: LorenzVec? = null + private var lastMinion: LorenzVec? = null + private var lastMinionOpened = 0L + private var minionInventoryOpen = false - var lastCoinsRecived = 0L - var lastMinionPickedUp = 0L - val minions = mutableMapOf() - var coinsPerDay = "" + private var lastCoinsRecived = 0L + private var lastMinionPickedUp = 0L + private val minions = mutableMapOf() + private var coinsPerDay = "" @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { - for (minion in SkyHanniMod.feature.hidden.minions) { - val vec = LorenzVec.decodeFromString(minion.key) - minions[vec] = minion.value + for (minion in SkyHanniMod.feature.hidden.minionLastClick) { + val key = minion.key + val vec = LorenzVec.decodeFromString(key) + val name = SkyHanniMod.feature.hidden.minionName[key] ?: "§cNo name saved!" + val data = MinionData(name, minion.value) + minions[vec] = data } } @@ -90,9 +94,20 @@ class MinionFeatures { fun onTick(event: TickEvent.ClientTickEvent) { if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return - if (InventoryUtils.currentlyOpenInventory().contains("Minion")) { - if (lastClickedEntity != null) { - lastMinion = lastClickedEntity + val openInventory = InventoryUtils.currentlyOpenInventory() + if (openInventory.contains("Minion")) { + lastClickedEntity?.let { + val name = getMinionName(openInventory) + if (!minions.contains(it)) { + minions[it] = MinionData(name, 0) + saveConfig() + } else { + if (minions[it]!!.name != name) { + minions[it]!!.name = name + saveConfig() + } + } + lastMinion = it lastClickedEntity = null minionInventoryOpen = true lastMinionOpened = 0 @@ -106,11 +121,11 @@ class MinionFeatures { if (location != null) { if (System.currentTimeMillis() - lastCoinsRecived < 2_000) { - minions[location] = System.currentTimeMillis() + minions[location]!!.lastClicked = System.currentTimeMillis() saveConfig() } if (location !in minions) { - minions[location] = 0 + minions[location]!!.lastClicked = 0 } if (System.currentTimeMillis() - lastMinionPickedUp < 2_000) { @@ -130,6 +145,15 @@ class MinionFeatures { } } + private fun getMinionName(inventoryName: String): String { + var list = inventoryName.split(" ").toList() + val last = list.last() + val number = last.romanToDecimal() + list = list.dropLast(1) + + return list.joinToString(" ") + " $number" + } + private fun updateCoinsPerDay(): String { val loc = lastMinion!! val slot = InventoryUtils.getItemsInOpenChest().find { it.slotNumber == 28 } ?: return "" @@ -139,8 +163,8 @@ class MinionFeatures { if (coinsPerDay != "") return coinsPerDay - val lastClicked = minions.getOrDefault(loc, -1) - if (lastClicked == -1L) { + val lastClicked = minions[loc]!!.lastClicked + if (lastClicked == 0L) { return "Can't calculate coins/day: No time data available!" } val duration = System.currentTimeMillis() - lastClicked @@ -156,13 +180,17 @@ class MinionFeatures { } private fun saveConfig() { - val minionConfig = SkyHanniMod.feature.hidden.minions + val minionConfig = SkyHanniMod.feature.hidden.minionLastClick + val minionName = SkyHanniMod.feature.hidden.minionName minionConfig.clear() + minionName.clear() for (minion in minions) { - minionConfig[minion.key.encodeToString()] = minion.value + val coordinates = minion.key.encodeToString() + val data = minion.value + minionConfig[coordinates] = data.lastClicked + minionName[coordinates] = data.name } - } @SubscribeEvent @@ -189,21 +217,29 @@ class MinionFeatures { @SubscribeEvent fun onRenderLastEmptied(event: RenderWorldLastEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.minions.emptiedTimeDisplay) return if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return val playerLocation = LocationUtils.playerLocation() val playerEyeLocation = LocationUtils.playerEyeLocation() for (minion in minions) { - val location = minion.key - if (playerLocation.distance(location) < SkyHanniMod.feature.minions.emptiedTimeDistance) { - val lastEmptied = minion.value - if (lastEmptied == 0L) continue - val duration = System.currentTimeMillis() - lastEmptied - val format = StringUtils.formatDuration(duration / 1000) + " ago" - if (LocationUtils.canSee(playerEyeLocation, location)) { - val text = "§eHopper Emptied: $format" - event.drawString(location.add(0.0, 2.0, 0.0), text, true) + val location = minion.key.add(0.0, 1.0, 0.0) + if (LocationUtils.canSee(playerEyeLocation, location)) { + val lastEmptied = minion.value.lastClicked + if (playerLocation.distance(location) < SkyHanniMod.feature.minions.distance) { + + if (SkyHanniMod.feature.minions.nameDisplay) { + val name = "§9" + minion.value.name + event.drawString(location.add(0.0, 0.65, 0.0), name, true) + } + + if (SkyHanniMod.feature.minions.emptiedTimeDisplay) { + if (lastEmptied != 0L) { + val duration = System.currentTimeMillis() - lastEmptied + val format = StringUtils.formatDuration(duration / 1000) + " ago" + val text = "§eHopper Emptied: $format" + event.drawString(location.add(0.0, 1.15, 0.0), text, true) + } + } } } } From c8f9edb2bf070582f3049089c6168cbe24660732 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:47:56 +0100 Subject: [PATCH 31/32] Added minion name display. --- CHANGELOG.md | 1 + FEATURES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98514c811c3d..32156cdcebbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ + Added Compact Bingo Chat Messages. + Added Compact Potion Effect Chat Messages. + Added Brewing Stand Overlay. ++ Added minion name display with minion tier. ### Changes + Don't render overlays when tab list key is pressed. diff --git a/FEATURES.md b/FEATURES.md index eb6d2c742918..0788dd7c854c 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -86,6 +86,7 @@ - A marker to the last opened minion for a couple of seconds (seen through walls) - Option to hide mob nametags close to minions. - Minion hopper coins per day display (Using the held coins in the hopper and the last time the hopper was collected to calculate the coins a hopper collects in a day) +- Minion name display with minion tier. ## Bazaar - Showing colors in the order inventory for outbid or fully bought/sold items. From f365d1f6f2ebb3645ea7ad04736e98491781a284 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:48:40 +0100 Subject: [PATCH 32/32] 0.14 --- CHANGELOG.md | 2 +- build.gradle.kts | 2 +- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32156cdcebbb..51270877e7ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # SkyHanni - Change Log -## Version 0.13.1 +## Version 0.14 ### Features + Added /shtrackcollection - This tracks the number of items you collect, but it does not work with sacks. diff --git a/build.gradle.kts b/build.gradle.kts index 398adb850537..9f6014f26490 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "at.hannibal2.skyhanni" -version = "0.13.1" +version = "0.14" // Toolchains: java { diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 62ff318ae047..f6190fb101b4 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -62,7 +62,7 @@ public class SkyHanniMod { public static final String MODID = "skyhanni"; - public static final String VERSION = "0.13.1"; + public static final String VERSION = "0.14"; public static Features feature;