From 2b45f35f1d2f329babfce103bb0a306443265ae1 Mon Sep 17 00:00:00 2001 From: odtheking Date: Thu, 31 Oct 2024 10:33:41 +0200 Subject: [PATCH] Readded chat emotes module Fixed ChocolateFactory eggs textures Fixed DeployableTimer SOS and Warning flares textures --- .../impl/skyblock/ChocolateFactory.kt | 4 +- .../odinmain/config/DungeonWaypointConfig.kt | 2 +- .../kotlin/me/odinmain/config/PBConfig.kt | 17 ++++--- .../features/impl/skyblock/ChatCommands.kt | 44 ++++++++++--------- .../features/impl/skyblock/DeployableTimer.kt | 4 +- 5 files changed, 36 insertions(+), 35 deletions(-) diff --git a/odinclient/src/main/kotlin/me/odinclient/features/impl/skyblock/ChocolateFactory.kt b/odinclient/src/main/kotlin/me/odinclient/features/impl/skyblock/ChocolateFactory.kt index e8965721d..da7aaef0d 100644 --- a/odinclient/src/main/kotlin/me/odinclient/features/impl/skyblock/ChocolateFactory.kt +++ b/odinclient/src/main/kotlin/me/odinclient/features/impl/skyblock/ChocolateFactory.kt @@ -167,8 +167,8 @@ object ChocolateFactory : Module( } private data object BunnyEggTextures { - const val DINNER_EGG_TEXTURE = "ewogICJ0aW1lc3RhbXAiIDogMTcxMTQ2MjY0OTcwMSwKICAicHJvZmlsZUlkIiA6ICI3NGEwMzQxNWY1OTI0ZTA4YjMyMGM2MmU1NGE3ZjJhYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZXp6aXIiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTVlMzYxNjU4MTlmZDI4NTBmOTg1NTJlZGNkNzYzZmY5ODYzMTMxMTkyODNjMTI2YWNlMGM0Y2M0OTVlNzZhOCIKICAgIH0KICB9Cn0" + const val DINNER_EGG_TEXTURE = "ewogICJ0aW1lc3RhbXAiIDogMTcxM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CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTQ5MzMzZDg1YjhhMzE1ZDAzMzZlYjJkZjM3ZDhhNzE0Y2EyNGM1MWI4YzYwNzRmMWI1YjkyN2RlYjUxNmMyNCIKICAgIH0KICB9Cn0" + const val BREAKFAST_EGG_TEXTURE = "ewogICJ0aW1lc3RhbXAiIDogMTcxMTQ2MjY3MzE0OSwKICAicHJvZmlsZUlkIiA6ICJiN2I4ZTlhZjEwZGE0NjFmOTY2YTQxM2RmOWJiM2U4OCIsCiAgInByb2ZpbGVOYW1lIiA6ICJBbmFiYW5hbmFZZzciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTQ5MzMzZDg1YjhhMzE1ZDAzMzZlYjJkZjM3ZDhhNzE0Y2EyNGM1MWI4YzYwNzRmMWI1YjkyN2RlYjUxNmMyNCIKICAgIH0KICB9Cn0=" } } diff --git a/src/main/kotlin/me/odinmain/config/DungeonWaypointConfig.kt b/src/main/kotlin/me/odinmain/config/DungeonWaypointConfig.kt index 977f545c0..ac12a970c 100644 --- a/src/main/kotlin/me/odinmain/config/DungeonWaypointConfig.kt +++ b/src/main/kotlin/me/odinmain/config/DungeonWaypointConfig.kt @@ -29,7 +29,7 @@ object DungeonWaypointConfig { try { createNewFile() } catch (_: Exception) { - println("Error initializing module config") + println("Error creating dungeon waypoints config file.") } } diff --git a/src/main/kotlin/me/odinmain/config/PBConfig.kt b/src/main/kotlin/me/odinmain/config/PBConfig.kt index dad4b6237..c1c10085f 100644 --- a/src/main/kotlin/me/odinmain/config/PBConfig.kt +++ b/src/main/kotlin/me/odinmain/config/PBConfig.kt @@ -2,7 +2,7 @@ package me.odinmain.config import com.google.gson.GsonBuilder import com.google.gson.reflect.TypeToken -import kotlinx.coroutines.DelicateCoroutinesApi +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import me.odinmain.OdinMain.logger import me.odinmain.OdinMain.mc @@ -17,32 +17,31 @@ object PBConfig { private val configFile = File(mc.mcDataDir, "config/odin/personal-bests.json").apply { try { createNewFile() - } catch (e: Exception) { - println("Error initializing personal bests config") + } catch (_: Exception) { + println("Error creating personal bests config file.") } } fun loadConfig() { try { with(configFile.bufferedReader().use { it.readText() }) { - if (this == "") return + if (isEmpty()) return pbs = gson.fromJson( - this, - object : TypeToken>>() {}.type + this, + object : TypeToken>>() {}.type ) println("Successfully loaded pb config $pbs") } - } catch (e: Exception) { + } catch (e: Exception) { println("Odin: Error parsing pbs.") println(e.message) logger.error("Error parsing pbs.", e) } } - @OptIn(DelicateCoroutinesApi::class) fun saveConfig() { - scope.launch { + scope.launch(Dispatchers.IO) { try { configFile.bufferedWriter().use { it.write(gson.toJson(pbs)) diff --git a/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt b/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt index 095967824..930b4e84c 100644 --- a/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt +++ b/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt @@ -20,32 +20,33 @@ object ChatCommands : Module( category = Category.SKYBLOCK, description = "Type !help in the corresponding channel for cmd list. Use /blacklist.", ) { - private var party by BooleanSetting(name = "Party commands", default = true, description = "Toggles chat commands in party chat.") - private var guild by BooleanSetting(name = "Guild commands", default = true, description = "Toggles chat commands in guild chat.") - private var private by BooleanSetting(name = "Private commands", default = true, description = "Toggles chat commands in private chat.") + private val chatEmotes by BooleanSetting(name = "Chat Emotes", default = true, description = "Replaces chat emotes with their corresponding emojis.") + private val party by BooleanSetting(name = "Party commands", default = true, description = "Toggles chat commands in party chat.") + private val guild by BooleanSetting(name = "Guild commands", default = true, description = "Toggles chat commands in guild chat.") + private val private by BooleanSetting(name = "Private commands", default = true, description = "Toggles chat commands in private chat.") private val whitelistOnly by DualSetting("Whitelist Only", left = "blacklist", right = "Whitelist", default = false, description = "Whether the list should act like a whitelist or a blacklist.") - private var showSettings by DropdownSetting(name = "Show Settings", default = false) - - private var warp by BooleanSetting(name = "Warp", default = true, description = "Executes the /party warp commnad.").withDependency { showSettings } - private var warptransfer by BooleanSetting(name = "Warp & pt (warptransfer)", default = true, description = "Executes the /party warp and /party transfer commands.").withDependency { showSettings } - private var coords by BooleanSetting(name = "Coords (coords)", default = true, description = "Sends your current coordinates.").withDependency { showSettings } - private var allinvite by BooleanSetting(name = "Allinvite", default = true, description = "Executes the /party settings allinvite command.").withDependency { showSettings } - private var odin by BooleanSetting(name = "Odin", default = true, description = "Sends the odin discord link.").withDependency { showSettings } - private var boop by BooleanSetting(name = "Boop", default = true, description = "Executes the /boop command.").withDependency { showSettings } - private var cf by BooleanSetting(name = "Coinflip (cf)", default = true, description = "Sends the result of a coinflip..").withDependency { showSettings } - private var eightball by BooleanSetting(name = "Eightball", default = true, description = "Sends a random 8ball response.").withDependency { showSettings } - private var dice by BooleanSetting(name = "Dice", default = true, description = "Rolls a dice.").withDependency { showSettings } - private var pt by BooleanSetting(name = "Party transfer (pt)", default = false, description = "Executes the /party transfer command.").withDependency { showSettings } - private var ping by BooleanSetting(name = "Ping", default = true, description = "Sends your current ping.").withDependency { showSettings } - private var tps by BooleanSetting(name = "TPS", default = true, description = "Sends the server's current TPS.").withDependency { showSettings } - private var fps by BooleanSetting(name = "FPS", default = true, description = "Sends your current FPS.").withDependency { showSettings } - private var dt by BooleanSetting(name = "DT", default = true, description = "Sets a reminder for the end of the run.").withDependency { showSettings } + private val showSettings by DropdownSetting(name = "Show Settings", default = false) + + private val warp by BooleanSetting(name = "Warp", default = true, description = "Executes the /party warp commnad.").withDependency { showSettings } + private val warptransfer by BooleanSetting(name = "Warp & pt (warptransfer)", default = true, description = "Executes the /party warp and /party transfer commands.").withDependency { showSettings } + private val coords by BooleanSetting(name = "Coords (coords)", default = true, description = "Sends your current coordinates.").withDependency { showSettings } + private val allinvite by BooleanSetting(name = "Allinvite", default = true, description = "Executes the /party settings allinvite command.").withDependency { showSettings } + private val odin by BooleanSetting(name = "Odin", default = true, description = "Sends the odin discord link.").withDependency { showSettings } + private val boop by BooleanSetting(name = "Boop", default = true, description = "Executes the /boop command.").withDependency { showSettings } + private val cf by BooleanSetting(name = "Coinflip (cf)", default = true, description = "Sends the result of a coinflip..").withDependency { showSettings } + private val eightball by BooleanSetting(name = "Eightball", default = true, description = "Sends a random 8ball response.").withDependency { showSettings } + private val dice by BooleanSetting(name = "Dice", default = true, description = "Rolls a dice.").withDependency { showSettings } + private val pt by BooleanSetting(name = "Party transfer (pt)", default = false, description = "Executes the /party transfer command.").withDependency { showSettings } + private val ping by BooleanSetting(name = "Ping", default = true, description = "Sends your current ping.").withDependency { showSettings } + private val tps by BooleanSetting(name = "TPS", default = true, description = "Sends the server's current TPS.").withDependency { showSettings } + private val fps by BooleanSetting(name = "FPS", default = true, description = "Sends your current FPS.").withDependency { showSettings } + private val dt by BooleanSetting(name = "DT", default = true, description = "Sets a reminder for the end of the run.").withDependency { showSettings } private val invite by BooleanSetting(name = "invite", default = true, description = "Invites the player to your party.").withDependency { showSettings } private val racism by BooleanSetting(name = "Racism", default = true, description = "Sends a random racism percentage.").withDependency { showSettings } private val queInstance by BooleanSetting(name = "Queue instance cmds", default = true, description = "Queue dungeons commands.").withDependency { showSettings } private val time by BooleanSetting(name = "Time", default = false, description = "Sends the current time.").withDependency { showSettings } - private var demote by BooleanSetting(name = "Demote", default = false, description = "Executes the /party demote command.").withDependency { showSettings } - private var promote by BooleanSetting(name = "Promote", default = false, description = "Executes the /party promote command.").withDependency { showSettings } + private val demote by BooleanSetting(name = "Demote", default = false, description = "Executes the /party demote command.").withDependency { showSettings } + private val promote by BooleanSetting(name = "Promote", default = false, description = "Executes the /party promote command.").withDependency { showSettings } private var dtPlayer: String? = null private val dtReason = mutableListOf>() @@ -152,6 +153,7 @@ object ChatCommands : Module( @SubscribeEvent fun onMessageSent(event: MessageSentEvent) { + if (!chatEmotes) return if (event.message.startsWith("/") && !listOf("/pc", "/ac", "/gc", "/msg", "/w", "/r").any { event.message.startsWith(it) }) return replaced = false diff --git a/src/main/kotlin/me/odinmain/features/impl/skyblock/DeployableTimer.kt b/src/main/kotlin/me/odinmain/features/impl/skyblock/DeployableTimer.kt index 1a753f63b..212250ed4 100644 --- a/src/main/kotlin/me/odinmain/features/impl/skyblock/DeployableTimer.kt +++ b/src/main/kotlin/me/odinmain/features/impl/skyblock/DeployableTimer.kt @@ -82,8 +82,8 @@ object DeployableTimer : Module( } private data object FlareTextures { - const val WARNING_FLARE_TEXTURE = "ewogICJ0aW1lc3RhbXAiIDogMTY0NjY4NzMwNjIyMywKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjJlMmJmNmMxZWMzMzAyNDc5MjdiYTYzNDc5ZTU4NzJhYzY2YjA2OTAzYzg2YzgyYjUyZGFjOWYxYzk3MTQ1OCIKICAgIH0KICB9Cn0=" + const val WARNING_FLARE_TEXTURE = "ewogICJ0aW1lc3RhbXAiIDogMTY2MjY4Mjg0NTU4NiwKICAicHJvZmlsZUlkIiA6ICIwODFiZTAxZmZlMmU0ODMyODI3MDIwMjBlNmI1M2ExNyIsCiAgInByb2ZpbGVOYW1lIiA6ICJMeXJpY1BsYXRlMjUyNDIiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ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