From 43d07fc791e63bba61695e0d4b766b78eb699132 Mon Sep 17 00:00:00 2001 From: inglettronald Date: Sat, 25 Mar 2023 04:36:31 -0500 Subject: Config Syntax Change and switch to oneconfig --- src/main/kotlin/dulkirmod/DulkirMod.kt | 12 +- .../kotlin/dulkirmod/command/EnchantRuneCommand.kt | 3 +- src/main/kotlin/dulkirmod/command/FairyCommand.kt | 3 +- .../command/FarmingControlSchemeCommand.kt | 4 +- .../kotlin/dulkirmod/command/HurtCamCommand.kt | 4 +- .../kotlin/dulkirmod/command/JoinDungeonCommand.kt | 4 +- .../kotlin/dulkirmod/command/LeapNameCommand.kt | 8 +- .../kotlin/dulkirmod/command/SettingsCommand.kt | 2 +- src/main/kotlin/dulkirmod/config/Config.kt | 636 -------------------- src/main/kotlin/dulkirmod/config/DulkirConfig.kt | 646 +++++++++++++++++++++ src/main/kotlin/dulkirmod/features/AlarmClock.kt | 18 +- src/main/kotlin/dulkirmod/features/ArachneTimer.kt | 8 +- .../kotlin/dulkirmod/features/BrokenHypeNotif.kt | 8 +- src/main/kotlin/dulkirmod/features/Croesus.kt | 4 +- src/main/kotlin/dulkirmod/features/DragonTimer.kt | 8 +- src/main/kotlin/dulkirmod/features/DungeonLeap.kt | 6 +- .../dulkirmod/features/GardenVisitorAlert.kt | 22 +- .../kotlin/dulkirmod/features/HurtCamSlider.kt | 6 +- .../kotlin/dulkirmod/features/KeeperWaypoints.kt | 6 +- src/main/kotlin/dulkirmod/features/MatchoAlert.kt | 10 +- .../kotlin/dulkirmod/features/MemoryLeakFix.kt | 4 +- .../kotlin/dulkirmod/features/ScalableTooltips.kt | 6 +- .../kotlin/dulkirmod/features/chat/AbiphoneDND.kt | 8 +- src/main/kotlin/dulkirmod/features/chat/Bridge.kt | 20 +- .../dulkirmod/features/chat/ThrottleNotif.kt | 6 +- .../dulkirmod/features/chat/VanquisherTrigger.kt | 4 +- src/main/kotlin/dulkirmod/utils/ConfigData.kt | 24 +- src/main/kotlin/dulkirmod/utils/TitleUtils.kt | 6 +- src/main/kotlin/dulkirmod/utils/Utils.kt | 24 +- 29 files changed, 764 insertions(+), 756 deletions(-) delete mode 100644 src/main/kotlin/dulkirmod/config/Config.kt create mode 100644 src/main/kotlin/dulkirmod/config/DulkirConfig.kt (limited to 'src/main') diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index 3ce2c41..10c477d 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -1,7 +1,7 @@ package dulkirmod import dulkirmod.command.* -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.events.ChatEvent import dulkirmod.features.* import dulkirmod.features.chat.AbiphoneDND @@ -90,7 +90,7 @@ class DulkirMod { @SubscribeEvent fun onTick(event: ClientTickEvent) { - if (Config.noReverse3rdPerson && mc.gameSettings.thirdPersonView == 2) + if (DulkirConfig.noReverse3rdPerson && mc.gameSettings.thirdPersonView == 2) mc.gameSettings.thirdPersonView = 0 if (event.phase == TickEvent.Phase.START && display != null) { @@ -113,10 +113,10 @@ class DulkirMod { @SubscribeEvent fun onKey(event: KeyInputEvent) { - if (keyBinds[0].isPressed) display = config.gui() + if (keyBinds[0].isPressed) config.openGui() if (keyBinds[1].isPressed) { - Config.noReverse3rdPerson = !Config.noReverse3rdPerson - TextUtils.toggledMessage("No Selfie Camera", Config.noReverse3rdPerson) + DulkirConfig.noReverse3rdPerson = !DulkirConfig.noReverse3rdPerson + TextUtils.toggledMessage("No Selfie Camera", DulkirConfig.noReverse3rdPerson) } if (keyBinds[2].isPressed) { FarmingControlSchemeCommand.toggleControls(); @@ -130,7 +130,7 @@ class DulkirMod { const val CHAT_PREFIX = "§f<§3DulkirMod§f>§r" val mc: Minecraft = Minecraft.getMinecraft() - var config = Config + var config = DulkirConfig var display: GuiScreen? = null val scope = CoroutineScope(EmptyCoroutineContext) diff --git a/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt b/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt index 36e8b69..7b489e7 100644 --- a/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt +++ b/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt @@ -10,7 +10,6 @@ class EnchantRuneCommand : ClientCommandBase("enchantrune") { override fun processCommand(sender: ICommandSender, args: Array) { config.hideEnchantRune = !config.hideEnchantRune TextUtils.toggledMessage("Enchant Rune Hider", config.hideEnchantRune) - config.markDirty() - config.writeData() + config.save() } } \ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/FairyCommand.kt b/src/main/kotlin/dulkirmod/command/FairyCommand.kt index a6c1b00..b8231b7 100644 --- a/src/main/kotlin/dulkirmod/command/FairyCommand.kt +++ b/src/main/kotlin/dulkirmod/command/FairyCommand.kt @@ -10,7 +10,6 @@ class FairyCommand : ClientCommandBase("fairy") { override fun processCommand(sender: ICommandSender, args: Array) { config.hideHealerFairy = !config.hideHealerFairy TextUtils.toggledMessage("Healer Fairy Hider", config.hideHealerFairy) - config.markDirty() - config.writeData() + config.save() } } \ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/FarmingControlSchemeCommand.kt b/src/main/kotlin/dulkirmod/command/FarmingControlSchemeCommand.kt index 8bbad18..5d67fb3 100644 --- a/src/main/kotlin/dulkirmod/command/FarmingControlSchemeCommand.kt +++ b/src/main/kotlin/dulkirmod/command/FarmingControlSchemeCommand.kt @@ -1,6 +1,6 @@ package dulkirmod.command -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import net.minecraft.client.Minecraft import net.minecraft.client.settings.KeyBinding @@ -38,7 +38,7 @@ class FarmingControlSchemeCommand : ClientCommandBase("farmcontrols") { KeyBinding.setKeyBindState(jumpKey.keyCode, false) jumpKey.keyCode = 57 // 57 = space key code - minecraft.gameSettings.mouseSensitivity = Config.defaultSens / 2 + minecraft.gameSettings.mouseSensitivity = DulkirConfig.defaultSens / 2 } // Save the changes to the control settings diff --git a/src/main/kotlin/dulkirmod/command/HurtCamCommand.kt b/src/main/kotlin/dulkirmod/command/HurtCamCommand.kt index 200fa22..21d2e7e 100644 --- a/src/main/kotlin/dulkirmod/command/HurtCamCommand.kt +++ b/src/main/kotlin/dulkirmod/command/HurtCamCommand.kt @@ -1,6 +1,6 @@ package dulkirmod.command -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import net.minecraft.command.CommandException import net.minecraft.command.ICommandSender @@ -8,7 +8,7 @@ import net.minecraft.command.ICommandSender class HurtCamCommand : ClientCommandBase("ouch") { @Throws(CommandException::class) override fun processCommand(sender: ICommandSender, args: Array) { - Config.hurtCamIntensity = 7f + DulkirConfig.hurtCamIntensity = 7f TextUtils.info("§6§lOUCH! THAT HURT!") } } \ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/JoinDungeonCommand.kt b/src/main/kotlin/dulkirmod/command/JoinDungeonCommand.kt index f6f5a5e..d5e58c4 100644 --- a/src/main/kotlin/dulkirmod/command/JoinDungeonCommand.kt +++ b/src/main/kotlin/dulkirmod/command/JoinDungeonCommand.kt @@ -1,6 +1,6 @@ package dulkirmod.command -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import net.minecraft.command.CommandException import net.minecraft.command.ICommandSender @@ -24,7 +24,7 @@ class JoinDungeonCommand : ClientCommandBase("joindungeon") { } } catch (_: NumberFormatException) {} - if (Config.dungeonCommandConfirm) { + if (DulkirConfig.dungeonCommandConfirm) { TextUtils.info("§6Running command: $type$num") } TextUtils.sendMessage("/joindungeon $arguments") diff --git a/src/main/kotlin/dulkirmod/command/LeapNameCommand.kt b/src/main/kotlin/dulkirmod/command/LeapNameCommand.kt index f4a86a9..d564acd 100644 --- a/src/main/kotlin/dulkirmod/command/LeapNameCommand.kt +++ b/src/main/kotlin/dulkirmod/command/LeapNameCommand.kt @@ -1,6 +1,6 @@ package dulkirmod.command -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TextUtils import net.minecraft.command.CommandException @@ -26,7 +26,7 @@ class LeapNameCommand : ClientCommandBase("hl") { else -> findUserNameFor(username, false) } if (foundPlayer) { - TextUtils.info("§6Selected Leap Highlight for username: §f${Config.highlightLeapName}§6.") + TextUtils.info("§6Selected Leap Highlight for username: §f${DulkirConfig.highlightLeapName}§6.") } } private fun findUserNameFor(input: String, isClassName: Boolean): Boolean { @@ -37,7 +37,7 @@ class LeapNameCommand : ClientCommandBase("hl") { for (l in scoreboardList) { if (l.contains(input)) { val strArr = l.split(" ") - Config.highlightLeapName = strArr[1] + DulkirConfig.highlightLeapName = strArr[1] return true } } @@ -51,7 +51,7 @@ class LeapNameCommand : ClientCommandBase("hl") { if (strArr.size < 2) continue val username = strArr[1] if (username.lowercase() == input.lowercase()) { - Config.highlightLeapName = username + DulkirConfig.highlightLeapName = username return true } } diff --git a/src/main/kotlin/dulkirmod/command/SettingsCommand.kt b/src/main/kotlin/dulkirmod/command/SettingsCommand.kt index 5f16652..9fa6964 100644 --- a/src/main/kotlin/dulkirmod/command/SettingsCommand.kt +++ b/src/main/kotlin/dulkirmod/command/SettingsCommand.kt @@ -5,6 +5,6 @@ import net.minecraft.command.ICommandSender class SettingsCommand : ClientCommandBase("dulkir") { override fun processCommand(sender: ICommandSender?, args: Array?) { - DulkirMod.display = DulkirMod.config.gui() + DulkirMod.config.openGui() } } \ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/config/Config.kt b/src/main/kotlin/dulkirmod/config/Config.kt deleted file mode 100644 index 3745ee6..0000000 --- a/src/main/kotlin/dulkirmod/config/Config.kt +++ /dev/null @@ -1,636 +0,0 @@ -package dulkirmod.config - -import dulkirmod.DulkirMod -import dulkirmod.utils.Utils -import gg.essential.vigilance.Vigilant -import gg.essential.vigilance.data.Category -import gg.essential.vigilance.data.Property -import gg.essential.vigilance.data.PropertyType -import gg.essential.vigilance.data.SortingBehavior -import java.io.File - -object Config : Vigilant(File("./config/dulkirmod/config.toml"), "DulkirMod", sortingBehavior = ConfigSorting) { - - @Property( - type = PropertyType.SWITCH, - name = "Patch Crimson Isle memory leak", - description = "This is a temporary fix for the memory leak on crimson isles. It will be removed when Hypixel fixes the issue.", - category = "General" - ) - var crimsonIslesMemoryLeakPatch = true - - @Property( - type = PropertyType.SWITCH, - name = "Hide Enchant Rune Particles", - description = "ugly go bye-bye", - category = "General" - ) - var hideEnchantRune = false - - @Property( - type = PropertyType.SWITCH, - name = "Abiphone Do-Not-Disturb", - description = "Detects incoming calls and mutes ring audio for like 5 seconds. \nWorks as long as u don't lag particularly hard at the same time you're being called.", - category = "General" - ) - var abiDND = false - - @Property( - type = PropertyType.SWITCH, - name = "Abiphone Caller ID", - description = "If DND is on, still give the player a quick 1 liner to tell them who is calling.", - category = "General" - ) - var abiCallerID = false - - @Property( - type = PropertyType.SWITCH, - name = "Hurt Cam Slider", - description = "more or less ouchie", - category = "General" - ) - var hurtCamSlider = false - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Hurt Cam Intensity", - description = "1 is default, make sure other mods noHurtCam stuff is off", - category = "General", - minF = 0f, - maxF = 2f, - decimalPlaces = 1 - ) - var hurtCamIntensity = 1f - - @Property( - type = PropertyType.SWITCH, - name = "Tooltip Features", - description = "Turns on scrollable and (optional) scalable tooltips.", - category = "General" - ) - var scaledTooltips = false - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Tooltip Scale", - description = "1 is default", - category = "General", - minF = 0f, - maxF = 2f, - decimalPlaces = 1 - ) - var tooltipSize = 1f - - @Property( - type = PropertyType.SWITCH, - name = "Hide Healer fairy", - description = "Now only runs in dungeons lol", - category = "Dungeons" - ) - var hideHealerFairy = false - - @Property( - type = PropertyType.SWITCH, - name = "Hide Heart Particles", - description = "Useful for hyperion and healer bullshit", - category = "Dungeons" - ) - var hideHeartParticles = false - - @Property( - type = PropertyType.SWITCH, - name = "Throttle Notifier", - description = "Im pretty sure this is mostly patched? Idk I'm leaving it in", - category = "Dungeons" - ) - var throttleNotifier = true - - @Property( - type = PropertyType.SWITCH, - name = "Vanquisher Broadcaster", - description = "sends patcher sendcoords msg when you spawn a vanquisher. might make this put a waypoint later", - category = "Random Beta Features" - ) - var vanqBroadcast = false - - @Property( - type = PropertyType.TEXT, - name = "Throttle Notifier String", - description = "How do you want to tell people you are throttled?", - category = "Dungeons", - placeholder = "i am being throttled zzz", - protectedText = false - ) - var customMessage: String = "i am being throttled zzz" - - @Property( - type = PropertyType.SWITCH, - name = "Throttle Notifier Spam", - description = "LET EM KNOW!", - category = "Dungeons" - ) - var throttleNotifierSpam = true - - @Property( - type = PropertyType.SWITCH, - name = "M7 Dragon Timer", - description = "Large in-world text timers to help you see when dragons will spawn.", - category = "Dungeons" - ) - var dragonTimer = true - - @Property( - type = PropertyType.SWITCH, - name = "Better M7 Dragon Killbox", - description = "Mostly stolen from odin", - category = "Dungeons" - ) - var dragonKillBox = true - - @Property( - type = PropertyType.SWITCH, - name = "Hide Extra Nametags", - description = "Prevents some nametags not covered by skytils \"Hide non-starred nametags\" from rendering.", - category = "General" - ) - var hideTags = true - - // CUSTOM ANIMATIONS - @Property( - type = PropertyType.SWITCH, - name = "Global Toggle", - description = "Change the look of your held item", - category = "Animations" - ) - var customAnimations = false - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Size", - description = "Scales the size of your currently held item. Default: 0", - category = "Animations", - minF = -1.5f, - maxF = 1.5f, - decimalPlaces = 2 - ) - var customSize = 0f - - @Property( - type = PropertyType.CHECKBOX, - name = "Scale Swing", - description = "Also scale the size of the swing animation.", - category = "Animations" - ) - var doesScaleSwing = true - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "X", - description = "Moves the held item. Default: 0", - category = "Animations", - minF = -1.5f, - maxF = 1.5f, - decimalPlaces = 2 - ) - var customX = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Y", - description = "Moves the held item. Default: 0", - category = "Animations", - minF = -1.5f, - maxF = 1.5f, - decimalPlaces = 2 - ) - var customY = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Z", - description = "Moves the held item. Default: 0", - category = "Animations", - minF = -1.5f, - maxF = 1.5f, - decimalPlaces = 2 - ) - var customZ = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Yaw", - description = "Rotates your held item. Default: 0", - category = "Animations", - minF = -180f, - maxF = 180f, - decimalPlaces = 0 - ) - var customYaw = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Pitch", - description = "Rotates your held item. Default: 0", - category = "Animations", - minF = -180f, - maxF = 180f, - decimalPlaces = 0 - ) - var customPitch = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Roll", - description = "Rotates your held item. Default: 0", - category = "Animations", - minF = -180f, - maxF = 180f, - decimalPlaces = 0 - ) - var customRoll = 0f - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Speed", - description = "Speed of the swing animation.", - category = "Animations", - minF = -2f, - maxF = 1f, - decimalPlaces = 2 - ) - var customSpeed = 0f - - @Property( - type = PropertyType.CHECKBOX, - name = "Ignore Haste", - description = "Makes the chosen speed override haste modifiers.", - category = "Animations" - ) - var ignoreHaste = true - - @Property( - type = PropertyType.SELECTOR, - name = "Drinking Fix", - description = "Pick how to handle drinking animations.", - category = "Animations", - options = ["No fix", "Rotationless", "Fixed"] - ) - var drinkingSelector = 2 - - @Property( - type = PropertyType.BUTTON, - name = "Reset Item Values", - description = "Vanilla Look! Closes Settings GUI.", - category = "Animations" - ) - fun demoButton() { - customSize = 0f - customX = 0f - customY = 0f - customZ = 0f - customRoll = 0f - customPitch = 0f - customYaw = 0f - doesScaleSwing = true - ignoreHaste = true - customSpeed = 0f - DulkirMod.mc.displayGuiScreen(null) - } - - @Property( - type = PropertyType.BUTTON, - name = "Export Preset as String", - description = "Base64 representation of your current config - will copy to clipboard when pressed.", - category = "Animations", - subcategory = "Presets" - ) - fun presetString() { - Utils.animationConfigToString() - } - - @Property( - type = PropertyType.BUTTON, - name = "Import Preset from Clipboard", - description = "Base64 representation of your config accepted from clipboard. Closes gui.", - category = "Animations", - subcategory = "Presets" - ) - fun stringToConfig() { - Utils.animationStringtoConfig() - } - - @Property( - type = PropertyType.SWITCH, - name = "JoinDungeon Command Confirmation", - description = "Chat notification when you push the button. Useful if you suck at navigating a numpad.", - category = "Dungeons" - ) - var dungeonCommandConfirm = true - - @Property( - type = PropertyType.SWITCH, - name = "Hide Chests that are already opened at Croesus", - description = "Just doesn't render the item if it has the chest opened string", - category = "Dungeons" - ) - var hideOpenedChests = false - - @Property( - type = PropertyType.SWITCH, - name = "Highlight custom player for leap in menu", - description = "Changes texture to green wool! Use the \"/hl\" command for convenient assignment.", - category = "Dungeons" - ) - var highlightLeap = false - - @Property( - type = PropertyType.TEXT, - name = "Highlighted player name", - description = "case-sensitive", - category = "Dungeons", - placeholder = "Dilkur", - protectedText = false - ) - var highlightLeapName: String = "Dilkur" - - @Property( - type = PropertyType.SWITCH, - name = "Remove Selfie Camera", - description = "Get rid of pesky reverse third person!", - category = "General" - ) - var noReverse3rdPerson = false - - @Property( - type = PropertyType.SWITCH, - name = "Bridge Bot Formatter", - description = "Global Toggle", - category = "Bridge" - ) - var bridgeBot = false - - @Property( - type = PropertyType.TEXT, - name = "Bridge Bot Name", - description = "Not case-sensitive", - category = "Bridge", - placeholder = "Bweefing", - protectedText = false - ) - var botName: String = "Bweefing" - - @Property( - type = PropertyType.SELECTOR, - name = "Bridge Chatter Name Color", - description = "Pick how the player name looks.", - category = "Bridge", - options = ["§0Black", - "§1Dark Blue", - "§2Dark Green", - "§3Dark Aqua", - "§4Dark Red", - "§5Dark Purple", - "§6Gold", - "§7Gray", - "§8Dark Gray", - "§9Blue", - "§aGreen", - "§bAqua", - "§cRed", - "§dLight Purple", - "§eYellow", - "§fWhite", - "§zSBA Chroma" - ] - ) - var bridgeColor = 6 - - @Property( - type = PropertyType.SWITCH, - name = "Ghast Notification", - description = "Shows a title at 9:00pm for bestiary", - category = "Bestiary", - subcategory = "Notifications" - ) - var notifyGhast = false - - @Property( - type = PropertyType.SWITCH, - name = "Zombie Villager Notification", - description = "Shows a title at 8:00pm for bestiary", - category = "Bestiary", - subcategory = "Notifications" - ) - var notifyZombieVillager = false - - @Property( - type = PropertyType.SWITCH, - name = "Broken Hype Notification", - description = "Tells you if you are no longer getting bestiary! Requires champion and book of stats on your item. LEAVE OFF IF FISHING.", - category = "Bestiary", - subcategory = "Notifications" - ) - var notifyHype = false - - @Property( - type = PropertyType.SWITCH, - name = "Matcho Spawn Alert!", - description = "Alerts you if your lobby becomes EXPLOSIVE!", - category = "Bestiary", - subcategory = "Notifications" - ) - var notifyMatcho = false - - @Property( - type = PropertyType.SELECTOR, - name = "Bestiary Notification Color", - description = "Changes color some bestiary features.", - category = "Bestiary", - subcategory = "Notifications", - options = ["§0Black", - "§1Dark Blue", - "§2Dark Green", - "§3Dark Aqua", - "§4Dark Red", - "§5Dark Purple", - "§6Gold", - "§7Gray", - "§8Dark Gray", - "§9Blue", - "§aGreen", - "§bAqua", - "§cRed", - "§dLight Purple", - "§eYellow", - "§fWhite", - "§zSBA Chroma" - ] - ) - var bestiaryNotifColor = 15 - - @Property( - type = PropertyType.SWITCH, - name = "Text Shadow", - description = "Shows text shadow for notification", - category = "Bestiary", - subcategory = "Notifications" - ) - var bestiaryTextShadow = false - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Scale", - description = "Size of notification!", - category = "Bestiary", - subcategory = "Notifications", - minF = 0f, - maxF = 1f, - decimalPlaces = 1 - ) - var bestiaryNotifSize = .7f - - - @Property( - type = PropertyType.SWITCH, - name = "Alert Noises", - description = "Uses relevant mob sounds, doesn't override audio/patcher settings", - category = "Bestiary", - subcategory = "Audio" - ) - var bestiaryAlertSounds = false - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Alert Volume", - description = "Volume of notification!", - category = "Bestiary", - subcategory = "Audio", - minF = 0f, - maxF = 1f, - decimalPlaces = 1 - ) - var bestiaryNotifVol = .7f - - @Property( - type = PropertyType.BUTTON, - name = "Demo Volume Selection", - description = "Plays the Ghast Noise as Reference, Might add individual sliders later but this seems like enough", - category = "Bestiary", - subcategory = "Audio" - ) - fun demoVolume() { - DulkirMod.mc.thePlayer.playSound("mob.ghast.scream", 1f * bestiaryNotifVol, 1f) - } - - @Property( - type = PropertyType.SWITCH, - name = "Hide Arachne Loot Nametags", - description = "Useful when killing a lot of them", - category = "Bestiary", - subcategory = "Arachne" - ) - var hideArachneTags = false - - @Property( - type = PropertyType.SWITCH, - name = "Arachne kill timer", - description = "Shows in chat.", - category = "Bestiary", - subcategory = "Arachne" - ) - var arachneKillTimer = false - - @Property( - type = PropertyType.SWITCH, - name = "Arachne spawn countdown", - description = "Shows how long it takes for the arachne to spawn (in world).", - category = "Bestiary", - subcategory = "Arachne" - ) - var arachneSpawnTimer = false - - @Property( - type = PropertyType.SWITCH, - name = "Show Arachne Keeper Spawn Locations", - description = "simple text waypoints", - category = "Bestiary", - subcategory = "Arachne" - ) - var keeperWaypoints = false - - @Property( - type = PropertyType.SWITCH, - name = "Focus Mode", - description = "only show the nametags of keepers. make sure to turn off when you're done", - category = "Bestiary", - subcategory = "Arachne" - ) - var keeperFocus = false - - @Property( - type = PropertyType.SWITCH, - name = "Garden Visitor Alert", - description = "Notifies you if you have max garden visitors in queue", - category = "Farming" - ) - var notifyMaxVisitors = false - - @Property( - type = PropertyType.SWITCH, - name = "Persistent alert", - description = "If turned on, the alert will continue to flash until dealt with.", - category = "Farming" - ) - var persistentAlert = true - - @Property( - type = PropertyType.DECIMAL_SLIDER, - name = "Default Sensitivity", - description = "For use with the /farmcontrols command toggle", - category = "Farming", - minF = 0f, - maxF = 2f, - decimalPlaces = 2 - ) - var defaultSens = .7f - - @Property( - type = PropertyType.SWITCH, - name = "Turn off re-equip animation", - description = "Will stop the spam re-equip when stuff like cultivating is updating", - category = "Animations" - ) - var cancelReequip = false - - fun init() { - initialize() - addDependency("customMessage", "throttleNotifier") - addDependency("throttleNotifierSpam", "throttleNotifier") - addDependency("bestiaryNotifVol", "bestiaryAlertSounds") - addDependency("demoVolume", "bestiaryAlertSounds") - addDependency("highlightLeapName", "highlightLeap") - addDependency("abiCallerID", "abiDND") - addDependency("hurtCamIntensity", "hurtCamSlider") - addDependency("tooltipSize", "scaledTooltips") - addDependency("persistentAlert", "notifyMaxVisitors") - - setCategoryDescription( - "Custom Animations", - "All settings that are related to custom animations. Mostly help from Aton." - ) - setCategoryDescription( - "Bridge", - "Dm me on discord with formatting issues." - ) - } - - private object ConfigSorting : SortingBehavior() { - override fun getCategoryComparator(): Comparator = Comparator { o1, o2 -> - if (o1.name == "General") return@Comparator -1 - if (o2.name == "General") return@Comparator 1 - else compareValuesBy(o1, o2) { - it.name - } - } - } -} diff --git a/src/main/kotlin/dulkirmod/config/DulkirConfig.kt b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt new file mode 100644 index 0000000..8ea114a --- /dev/null +++ b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt @@ -0,0 +1,646 @@ +package dulkirmod.config + +import cc.polyfrost.oneconfig.config.Config +import cc.polyfrost.oneconfig.config.annotations.* +import cc.polyfrost.oneconfig.config.data.Mod +import cc.polyfrost.oneconfig.config.data.ModType +import dulkirmod.DulkirMod +import dulkirmod.utils.Utils + +object DulkirConfig : Config(Mod("DulkirMod", ModType.SKYBLOCK), "dulkirmod-config.json") { + + + @Switch( + name = "Patch Crimson Isle memory leak", + description = "This is a temporary fix for the memory leak on crimson isles. It will be removed when Hypixel fixes the issue.", + category = "General", + subcategory = "General" + ) + var crimsonIslesMemoryLeakPatch = true + + @Property( + type = PropertyType.SWITCH, + name = "Hide Enchant Rune Particles", + description = "ugly go bye-bye", + category = "General", + subcategory = "General" + ) + var hideEnchantRune = false + + @Switch( + name = "Abiphone Do-Not-Disturb", + description = "Detects incoming calls and mutes ring audio for like 5 seconds. \nWorks as long as u don't lag particularly hard at the same time you're being called.", + category = "General", + subcategory = "General" + ) + var abiDND = false + + @Property( + type = PropertyType.SWITCH, + name = "Abiphone Caller ID", + description = "If DND is on, still give the player a quick 1 liner to tell them who is calling.", + category = "General", + subcategory = "General" + ) + var abiCallerID = false + + @Switch( + name = "Hurt Cam Slider", + description = "more or less ouchie", + category = "General", + subcategory = "General" + ) + var hurtCamSlider = false + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "Hurt Cam Intensity", + description = "1 is default, make sure other mods noHurtCam stuff is off", + category = "General", + minF = 0f, + maxF = 2f, + decimalPlaces = 1 + ) + var hurtCamIntensity = 1f + + @Switch( + name = "Tooltip Features", + description = "Turns on scrollable and (optional) scalable tooltips.", + category = "General", + subcategory = "General" + ) + var scaledTooltips = false + + @Slider( + name = "Tooltip Scale", + description = "1 is default", + category = "General", + subcategory = "General", + min = 0f, + max = 2f, + step = 0 + ) + var tooltipSize = 1f + + @Switch( + name = "Hide Healer fairy", + description = "Now only runs in dungeons lol", + category = "Dungeons", + subcategory = "Dungeons" + ) + var hideHealerFairy = false + + @Switch( + name = "Hide Heart Particles", + description = "Useful for hyperion and healer bullshit", + category = "Dungeons", + subcategory = "Dungeons" + ) + var hideHeartParticles = false + + @Switch( + name = "Throttle Notifier", + description = "Im pretty sure this is mostly patched? Idk I'm leaving it in", + category = "Dungeons", + subcategory = "Dungeons" + ) + var throttleNotifier = true + + @Switch( + name = "Vanquisher Broadcaster", + description = "sends patcher sendcoords msg when you spawn a vanquisher. might make this put a waypoint later", + category = "Random Beta Features", + subcategory = "Random Beta Features" + ) + var vanqBroadcast = false + + @Property( + type = PropertyType.TEXT, + name = "Throttle Notifier String", + description = "How do you want to tell people you are throttled?", + category = "Dungeons", + subcategory = "Dungeons", + placeholder = "i am being throttled zzz", + protectedText = false + ) + var customMessage: String = "i am being throttled zzz" + + @Property( + type = PropertyType.SWITCH, + name = "Throttle Notifier Spam", + description = "LET EM KNOW!", + category = "Dungeons", + subcategory = "Dungeons" + ) + var throttleNotifierSpam = true + + @Property( + type = PropertyType.SWITCH, + name = "M7 Dragon Timer", + description = "Large in-world text timers to help you see when dragons will spawn.", + category = "Dungeons", + subcategory = "Dungeons" + ) + var dragonTimer = true + + @Switch( + name = "Better M7 Dragon Killbox", + description = "Mostly stolen from odin", + category = "Dungeons", + subcategory = "Dungeons" + ) + var dragonKillBox = true + + @Switch( + name = "Hide Extra Nametags", + description = "Prevents some nametags not covered by skytils \"Hide non-starred nametags\" from rendering.", + category = "General", + subcategory = "General" + ) + var hideTags = true + + // CUSTOM ANIMATIONS + @Property( + type = PropertyType.SWITCH, + name = "Global Toggle", + description = "Change the look of your held item", + category = "Animations", + subcategory = "Animations" + ) + var customAnimations = false + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "Size", + description = "Scales the size of your currently held item. Default: 0", + category = "Animations", + subcategory = "Dungeons", + min = -1.5f, + max = 1.5f, + step = 0 + ) + var customSize = 0f + + @Checkbox( + name = "Scale Swing", + description = "Also scale the size of the swing animation.", + category = "Animations", + subcategory = "Animations" + ) + var doesScaleSwing = true + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "X", + description = "Moves the held item. Default: 0", + category = "Animations", + minF = -1.5f, + maxF = 1.5f, + decimalPlaces = 2 + ) + var customX = 0f + + @Slider( + name = "Y", + description = "Moves the held item. Default: 0", + category = "Animations", + subcategory = "Animations", + min = -1.5f, + max = 1.5f, + step = 0 + ) + var customY = 0f + + @Slider( + name = "Z", + description = "Moves the held item. Default: 0", + category = "Animations", + subcategory = "Animations", + min = -1.5f, + max = 1.5f, + step = 0 + ) + var customZ = 0f + + @Slider( + name = "Yaw", + description = "Rotates your held item. Default: 0", + category = "Animations", + subcategory = "Animations", + min = -180f, + max = 180f, + step = 1 + ) + var customYaw = 0f + + @Slider( + name = "Pitch", + description = "Rotates your held item. Default: 0", + category = "Animations", + subcategory = "Animations", + min = -180f, + max = 180f, + step = 1 + ) + var customPitch = 0f + + @Slider( + name = "Roll", + description = "Rotates your held item. Default: 0", + category = "Animations", + subcategory = "Animations", + min = -180f, + max = 180f, + step = 1 + ) + var customRoll = 0f + + @Slider( + name = "Speed", + description = "Speed of the swing animation.", + category = "Animations", + subcategory = "Animations", + min = -2f, + max = 1f, + step = 0 + ) + var customSpeed = 0f + + @Property( + type = PropertyType.CHECKBOX, + name = "Ignore Haste", + description = "Makes the chosen speed override haste modifiers.", + category = "Animations", + subcategory = "Animations", + ) + var ignoreHaste = true + + @Property( + type = PropertyType.SELECTOR, + name = "Drinking Fix", + description = "Pick how to handle drinking animations.", + category = "Animations", + subcategory = "Fixes", + options = ["No fix", "Rotationless", "Fixed"] + ) + var drinkingSelector = 2 + + @Property( + type = PropertyType.BUTTON, + name = "Reset Item Values", + description = "Vanilla Look! Closes Settings GUI.", + category = "Animations" + ) + fun demoButton() { + customSize = 0f + customX = 0f + customY = 0f + customZ = 0f + customRoll = 0f + customPitch = 0f + customYaw = 0f + doesScaleSwing = true + ignoreHaste = true + customSpeed = 0f + DulkirMod.mc.displayGuiScreen(null) + } + + @Property( + type = PropertyType.BUTTON, + name = "Export Preset as String", + description = "Base64 representation of your current config - will copy to clipboard when pressed.", + category = "Animations", + subcategory = "Presets", + text = "Export!" + ) + fun presetString() = Utils.animationConfigToString() + + + @Button( + name = "Import Preset from Clipboard", + description = "Base64 representation of your config accepted from clipboard. Closes gui.", + category = "Animations", + subcategory = "Presets", + text = "Import!" + ) + fun stringToConfig() = Utils.animationStringtoConfig() + + + @Property( + type = PropertyType.SWITCH, + name = "JoinDungeon Command Confirmation", + description = "Chat notification when you push the button. Useful if you suck at navigating a numpad.", + category = "Dungeons", + subcategory = "Dungeons" + ) + var dungeonCommandConfirm = true + + @Property( + type = PropertyType.SWITCH, + name = "Hide Chests that are already opened at Croesus", + description = "Just doesn't render the item if it has the chest opened string", + category = "Dungeons", + subcategory = "Dungeons" + ) + var hideOpenedChests = false + + @Property( + type = PropertyType.SWITCH, + name = "Highlight custom player for leap in menu", + description = "Changes texture to green wool! Use the \"/hl\" command for convenient assignment.", + category = "Dungeons", + subcategory = "Dungeons" + ) + var highlightLeap = false + + @Property( + type = PropertyType.TEXT, + name = "Highlighted player name", + description = "case-sensitive", + category = "Dungeons", + subcategory = "Dungeons", + placeholder = "Dilkur", + protectedText = false + ) + var highlightLeapName: String = "Dilkur" + + @Property( + type = PropertyType.SWITCH, + name = "Remove Selfie Camera", + description = "Get rid of pesky reverse third person!", + category = "General", + subcategory = "General" + ) + var noReverse3rdPerson = false + + @Property( + type = PropertyType.SWITCH, + name = "Bridge Bot Formatter", + description = "Global Toggle", + category = "Bridge", + subcategory = "Bridge" + ) + var bridgeBot = false + + @Property( + type = PropertyType.TEXT, + name = "Bridge Bot Name", + description = "Not case-sensitive", + category = "Bridge", + subcategory = "Bridge", + placeholder = "Bweefing", + protectedText = false + ) + var botName: String = "Bweefing" + + @Property( + type = PropertyType.SELECTOR, + name = "Bridge Chatter Name Color", + description = "Pick how the player name looks.", + category = "Bridge", + subcategory = "Bridge", + options = ["§0Black", + "§1Dark Blue", + "§2Dark Green", + "§3Dark Aqua", + "§4Dark Red", + "§5Dark Purple", + "§6Gold", + "§7Gray", + "§8Dark Gray", + "§9Blue", + "§aGreen", + "§bAqua", + "§cRed", + "§dLight Purple", + "§eYellow", + "§fWhite", + "§zSBA Chroma" + ] + ) + var bridgeColor = 6 + + @Property( + type = PropertyType.SWITCH, + name = "Ghast Notification", + description = "Shows a title at 9:00pm for bestiary", + category = "Bestiary", + subcategory = "Notifications" + ) + var notifyGhast = false + + @Property( + type = PropertyType.SWITCH, + name = "Zombie Villager Notification", + description = "Shows a title at 8:00pm for bestiary", + category = "Bestiary", + subcategory = "Notifications" + ) + var notifyZombieVillager = false + + @Property( + type = PropertyType.SWITCH, + name = "Broken Hype Notification", + description = "Tells you if you are no longer getting bestiary! Requires champion and book of stats on your item. LEAVE OFF IF FISHING.", + category = "Bestiary", + subcategory = "Notifications" + ) + var notifyHype = false + + @Property( + type = PropertyType.SWITCH, + name = "Matcho Spawn Alert!", + description = "Alerts you if your lobby becomes EXPLOSIVE!", + category = "Bestiary", + subcategory = "Notifications" + ) + var notifyMatcho = false + + @Property( + type = PropertyType.SELECTOR, + name = "Bestiary Notification Color", + description = "Changes color some bestiary features.", + category = "Bestiary", + subcategory = "Notifications", + options = ["§0Black", + "§1Dark Blue", + "§2Dark Green", + "§3Dark Aqua", + "§4Dark Red", + "§5Dark Purple", + "§6Gold", + "§7Gray", + "§8Dark Gray", + "§9Blue", + "§aGreen", + "§bAqua", + "§cRed", + "§dLight Purple", + "§eYellow", + "§fWhite", + "§zSBA Chroma" + ] + ) + var bestiaryNotifColor = 15 + + @Property( + type = PropertyType.SWITCH, + name = "Text Shadow", + description = "Shows text shadow for notification", + category = "Bestiary", + subcategory = "Notifications" + ) + var bestiaryTextShadow = false + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "Scale", + description = "Size of notification!", + category = "Bestiary", + subcategory = "Notifications", + minF = 0f, + maxF = 1f, + decimalPlaces = 1 + ) + var bestiaryNotifSize = .7f + + + @Property( + type = PropertyType.SWITCH, + name = "Alert Noises", + description = "Uses relevant mob sounds, doesn't override audio/patcher settings", + category = "Bestiary", + subcategory = "Audio" + ) + var bestiaryAlertSounds = false + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "Alert Volume", + description = "Volume of notification!", + category = "Bestiary", + subcategory = "Audio", + minF = 0f, + maxF = 1f, + decimalPlaces = 1 + ) + var bestiaryNotifVol = .7f + + @Property( + type = PropertyType.BUTTON, + name = "Demo Volume Selection", + description = "Plays the Ghast Noise as Reference, Might add individual sliders later but this seems like enough", + category = "Bestiary", + subcategory = "Audio" + ) + fun demoVolume() { + DulkirMod.mc.thePlayer.playSound("mob.ghast.scream", 1f * bestiaryNotifVol, 1f) + } + + @Property( + type = PropertyType.SWITCH, + name = "Hide Arachne Loot Nametags", + description = "Useful when killing a lot of them", + category = "Bestiary", + subcategory = "Arachne" + ) + var hideArachneTags = false + + @Property( + type = PropertyType.SWITCH, + name = "Arachne kill timer", + description = "Shows in chat.", + category = "Bestiary", + subcategory = "Arachne" + ) + var arachneKillTimer = false + + @Property( + type = PropertyType.SWITCH, + name = "Arachne spawn countdown", + description = "Shows how long it takes for the arachne to spawn (in world).", + category = "Bestiary", + subcategory = "Arachne" + ) + var arachneSpawnTimer = false + + @Property( + type = PropertyType.SWITCH, + name = "Show Arachne Keeper Spawn Locations", + description = "simple text waypoints", + category = "Bestiary", + subcategory = "Arachne" + ) + var keeperWaypoints = false + + @Property( + type = PropertyType.SWITCH, + name = "Focus Mode", + description = "only show the nametags of keepers. make sure to turn off when you're done", + category = "Bestiary", + subcategory = "Arachne" + ) + var keeperFocus = false + + @Property( + type = PropertyType.SWITCH, + name = "Garden Visitor Alert", + description = "Notifies you if you have max garden visitors in queue", + category = "Farming", + subcategory = "Farming" + ) + var notifyMaxVisitors = false + + @Property( + type = PropertyType.SWITCH, + name = "Persistent alert", + description = "If turned on, the alert will continue to flash until dealt with.", + category = "Farming", + subcategory = "Farming" + ) + var persistentAlert = true + + @Property( + type = PropertyType.DECIMAL_SLIDER, + name = "Default Sensitivity", + description = "For use with the /farmcontrols command toggle", + category = "Farming", + minF = 0f, + maxF = 2f, + decimalPlaces = 2 + ) + var defaultSens = .7f + + @Property( + type = PropertyType.SWITCH, + name = "Turn off re-equip animation", + description = "Will stop the spam re-equip when stuff like cultivating is updating", + category = "Animations", + subcategory = "Fixes" + ) + var cancelReequip = false + + fun init() { + initialize() + addDependency("customMessage", "throttleNotifier") + addDependency("throttleNotifierSpam", "throttleNotifier") + addDependency("bestiaryNotifVol", "bestiaryAlertSounds") + addDependency("demoVolume", "bestiaryAlertSounds") + addDependency("highlightLeapName", "highlightLeap") + addDependency("abiCallerID", "abiDND") + addDependency("hurtCamIntensity", "hurtCamSlider") + addDependency("tooltipSize", "scaledTooltips") + addDependency("persistentAlert", "notifyMaxVisitors") + + } + + private object ConfigSorting : SortingBehavior() { + override fun getCategoryComparator(): Comparator = Comparator { o1, o2 -> + if (o1.name == "General") return@Comparator -1 + if (o2.name == "General") return@Comparator 1 + else compareValuesBy(o1, o2) { + it.name + } + } + } +} diff --git a/src/main/kotlin/dulkirmod/features/AlarmClock.kt b/src/main/kotlin/dulkirmod/features/AlarmClock.kt index f4c11d4..4792259 100644 --- a/src/main/kotlin/dulkirmod/features/AlarmClock.kt +++ b/src/main/kotlin/dulkirmod/features/AlarmClock.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.ScoreBoardUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils @@ -16,20 +16,20 @@ fun alarmClock() { val lines = ScoreBoardUtils.getLines() for (l in lines) { // ZOMBIE VILLAGER - if (Config.notifyZombieVillager && l.contains("8:00pm") && (currTime - lastUpdate) > 15000) { + if (DulkirConfig.notifyZombieVillager && l.contains("8:00pm") && (currTime - lastUpdate) > 15000) { lastUpdate = currTime - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Zombie Villager", 5000) - if (Config.bestiaryAlertSounds) - mc.thePlayer.playSound("mob.villager.yes", 1f * Config.bestiaryNotifVol, 0f) + if (DulkirConfig.bestiaryAlertSounds) + mc.thePlayer.playSound("mob.villager.yes", 1f * DulkirConfig.bestiaryNotifVol, 0f) } // GHASTS - else if (Config.notifyGhast && l.contains("9:00pm") && (currTime - lastUpdate) > 15000) { + else if (DulkirConfig.notifyGhast && l.contains("9:00pm") && (currTime - lastUpdate) > 15000) { lastUpdate = currTime - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Ghast", 5000) - if (Config.bestiaryAlertSounds) - mc.thePlayer.playSound("mob.ghast.scream", 1f * Config.bestiaryNotifVol, 1f) + if (DulkirConfig.bestiaryAlertSounds) + mc.thePlayer.playSound("mob.ghast.scream", 1f * DulkirConfig.bestiaryNotifVol, 1f) } } diff --git a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt index 4cb63f9..7cbcd5f 100644 --- a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt +++ b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt @@ -1,6 +1,6 @@ package dulkirmod.features -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import dulkirmod.utils.Utils import dulkirmod.utils.WorldRenderUtils @@ -18,7 +18,7 @@ object ArachneTimer { @SubscribeEvent(receiveCanceled = true, priority = EventPriority.LOW) fun onChat(event: ClientChatReceivedEvent) { - if (!Config.arachneKillTimer) return + if (!DulkirConfig.arachneKillTimer) return var killtime: Float = -1f @@ -46,10 +46,10 @@ object ArachneTimer { @SubscribeEvent fun onWorldRenderLast(event: RenderWorldLastEvent) { - if (!Config.arachneSpawnTimer) return + if (!DulkirConfig.arachneSpawnTimer) return if (spawnmillis > startmillis) { - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) var time: Int time = if (bigboy) { (40 - (System.currentTimeMillis() - spawnmillis) / 1000).toInt() diff --git a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt index 589c046..f2c8c0e 100644 --- a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt +++ b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils @@ -13,7 +13,7 @@ var oldChampionXp = -1.0 var oldID = "" fun brokenHypeNotif() { - if (!Config.notifyHype) return + if (!DulkirConfig.notifyHype) return var kill = -1 var championXp = -1.0 @@ -59,8 +59,8 @@ fun brokenHypeNotif() { // If this section of the code is reached, then we have the same item, and we can check for updated stats if (oldKill != kill && oldChampionXp == championXp && TabListUtils.area != "Private Island") { - mc.thePlayer.playSound("random.anvil_land", 1f * Config.bestiaryNotifVol, 0f) - val color = Utils.getColorString(Config.bestiaryNotifColor) + mc.thePlayer.playSound("random.anvil_land", 1f * DulkirConfig.bestiaryNotifVol, 0f) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Hype Broken", 5000) } // update item regardless of whether it is bugged or not diff --git a/src/main/kotlin/dulkirmod/features/Croesus.kt b/src/main/kotlin/dulkirmod/features/Croesus.kt index ea8b022..9369140 100644 --- a/src/main/kotlin/dulkirmod/features/Croesus.kt +++ b/src/main/kotlin/dulkirmod/features/Croesus.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.ContainerNameUtil import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.Slot @@ -19,7 +19,7 @@ object Croesus { val lastInCroesus = inCroesusBool var pageNumber = 1 - if (!Config.hideOpenedChests) return + if (!DulkirConfig.hideOpenedChests) return if (mc.currentScreen == null || !(mc.currentScreen is GuiChest)) { inCroesusBool = false return diff --git a/src/main/kotlin/dulkirmod/features/DragonTimer.kt b/src/main/kotlin/dulkirmod/features/DragonTimer.kt index ad1506f..c8affee 100644 --- a/src/main/kotlin/dulkirmod/features/DragonTimer.kt +++ b/src/main/kotlin/dulkirmod/features/DragonTimer.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.ScoreBoardUtils import dulkirmod.utils.WorldRenderUtils import net.minecraft.util.BlockPos @@ -30,7 +30,7 @@ object DragonTimer { * Called from within the MixinWorld Class */ fun handleNewParticle(pID: Int, x: Double, y: Double, z: Double) { - if (!Config.dragonTimer) return + if (!DulkirConfig.dragonTimer) return if (!ScoreBoardUtils.isInM7) return if (pID != 26) return @@ -46,7 +46,7 @@ object DragonTimer { fun onRenderWorld(event: RenderWorldLastEvent) { renderDragonBoxes() - if (!Config.dragonTimer) return + if (!DulkirConfig.dragonTimer) return if (!ScoreBoardUtils.isInM7) return val curTime = System.currentTimeMillis() @@ -116,7 +116,7 @@ object DragonTimer { } private fun renderDragonBoxes() { - if (!Config.dragonKillBox) return + if (!DulkirConfig.dragonKillBox) return if (!ScoreBoardUtils.isInM7) return if (mc.thePlayer.positionVector.yCoord > 45) return // Blue diff --git a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt index bfbfe50..5185516 100644 --- a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt +++ b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.ContainerNameUtil import dulkirmod.utils.Utils import net.minecraft.client.gui.inventory.GuiChest @@ -19,7 +19,7 @@ object DungeonLeap { fun onTick(event: TickEvent.ClientTickEvent) { val lastInLeap = inLeapMenu - if (!Config.highlightLeap) return + if (!DulkirConfig.highlightLeap) return if (mc.currentScreen == null || mc.currentScreen !is GuiChest) { inLeapMenu = false return @@ -37,7 +37,7 @@ object DungeonLeap { if (slotIn.stack == null) continue val stack = slotIn.stack - if (Utils.stripColorCodes(stack.displayName).equals(Config.highlightLeapName, true)) { + if (Utils.stripColorCodes(stack.displayName).equals(DulkirConfig.highlightLeapName, true)) { leapPlayers[i - 11] = true } } diff --git a/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt index 8bcd145..0bf6bbe 100644 --- a/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt +++ b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils @@ -11,7 +11,7 @@ object GardenVisitorAlert { private var lastAlert = 0 fun alert() { - if (!Config.notifyMaxVisitors) return + if (!DulkirConfig.notifyMaxVisitors) return if (!Utils.isInSkyblock()) return if (TabListUtils.area != "Garden") { @@ -19,24 +19,24 @@ object GardenVisitorAlert { } if (TabListUtils.maxVisitors && !hasSentAlert) { - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Max Visitors", 5000) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .3f) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .6f) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .9f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .3f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .6f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .9f) hasSentAlert = true lastAlert = System.currentTimeMillis().toInt() } else if (!TabListUtils.maxVisitors) hasSentAlert = false val timeSinceLastAlert = System.currentTimeMillis().toInt() - lastAlert - if (TabListUtils.maxVisitors && hasSentAlert && timeSinceLastAlert > 5000 && Config.persistentAlert) { + if (TabListUtils.maxVisitors && hasSentAlert && timeSinceLastAlert > 5000 && DulkirConfig.persistentAlert) { lastAlert = System.currentTimeMillis().toInt() - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Max Visitors", 5000) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .3f) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .6f) - DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .9f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .3f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .6f) + DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.bestiaryNotifVol, .9f) } } diff --git a/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt b/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt index 7237d95..4ba4798 100644 --- a/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt +++ b/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt @@ -1,14 +1,14 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import net.minecraft.client.renderer.GlStateManager import net.minecraft.entity.EntityLivingBase import net.minecraft.util.MathHelper object HurtCamSlider { fun renderHurt(partialTicks: Float): Boolean { - if (!Config.hurtCamSlider) return false + if (!DulkirConfig.hurtCamSlider) return false if (mc.renderViewEntity is EntityLivingBase) { val entitylivingbase = mc.renderViewEntity as EntityLivingBase var f: Float = (entitylivingbase.hurtTime.toFloat() - partialTicks) @@ -23,7 +23,7 @@ object HurtCamSlider { f = MathHelper.sin(f * f * f * f * Math.PI.toFloat()) val f2 = entitylivingbase.attackedAtYaw GlStateManager.rotate(-f2, 0.0f, 1.0f, 0.0f) - GlStateManager.rotate(-f * 14.0f * Config.hurtCamIntensity, 0.0f, 0.0f, 1.0f) + GlStateManager.rotate(-f * 14.0f * DulkirConfig.hurtCamIntensity, 0.0f, 0.0f, 1.0f) GlStateManager.rotate(f2, 0.0f, 1.0f, 0.0f) } return true diff --git a/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt index c65b3dd..a8770c2 100644 --- a/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt +++ b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.Utils import dulkirmod.utils.WorldRenderUtils @@ -13,7 +13,7 @@ import kotlin.math.max object KeeperWaypoints { @SubscribeEvent fun onWorldRenderLast(event: RenderWorldLastEvent) { - if (!Config.keeperWaypoints) return + if (!DulkirConfig.keeperWaypoints) return if (TabListUtils.area != "Spider's Den") return val vec1 = Vec3(-208.5, 44.5, -259.5) @@ -37,7 +37,7 @@ object KeeperWaypoints { val scale8 = max(1f, playerVec.distanceTo(vec8).toFloat()/10f) val scale9 = max(1f, playerVec.distanceTo(vec9).toFloat()/10f) - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) WorldRenderUtils.renderString(vec1, "${color}1", false, scale1, true) WorldRenderUtils.renderString(vec2, "${color}2", false, scale2, true) WorldRenderUtils.renderString(vec3, "${color}3", false, scale3, true) diff --git a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt index 50f433e..54abc99 100644 --- a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt +++ b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils @@ -11,7 +11,7 @@ object MatchoAlert { var hasSentAlert = false fun alert() { - if (!Config.notifyMatcho) return + if (!DulkirConfig.notifyMatcho) return if (!Utils.isInSkyblock()) return if (TabListUtils.area != "Crimson Isle") { @@ -19,10 +19,10 @@ object MatchoAlert { } if (TabListUtils.explosivity && !hasSentAlert) { - val color = Utils.getColorString(Config.bestiaryNotifColor) + val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Matcho", 5000) - if (Config.bestiaryAlertSounds) - DulkirMod.mc.thePlayer.playSound("mob.villager.yes", 1f * Config.bestiaryNotifVol, 0f) + if (DulkirConfig.bestiaryAlertSounds) + DulkirMod.mc.thePlayer.playSound("mob.villager.yes", 1f * DulkirConfig.bestiaryNotifVol, 0f) hasSentAlert = true } else if (!TabListUtils.explosivity) hasSentAlert = false } diff --git a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt index dd69f24..dcb46ef 100644 --- a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt +++ b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import net.minecraft.entity.Entity import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent @@ -11,7 +11,7 @@ object MemoryLeakFix { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { - if (!Config.crimsonIslesMemoryLeakPatch) return + if (!DulkirConfig.crimsonIslesMemoryLeakPatch) return if (System.currentTimeMillis() - lastClear >= 30000L) { val world = mc.theWorld ?: return diff --git a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt index 7d1d623..53cb9ea 100644 --- a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt +++ b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt @@ -1,7 +1,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer import net.minecraft.client.gui.GuiChat @@ -28,7 +28,7 @@ object ScalableTooltips { screenHeight: Int, font: FontRenderer, ): Boolean { - if(!Config.scaledTooltips) return false + if(!DulkirConfig.scaledTooltips) return false if(textLines.isEmpty()) return true // Calculate the amount of translation that should be applied based on how much the user has scrolled @@ -59,7 +59,7 @@ object ScalableTooltips { } } - val scale = (Config.tooltipSize + scaleScale).coerceAtLeast(0f) + val scale = (DulkirConfig.tooltipSize + scaleScale).coerceAtLeast(0f) // Calculate the width and height of the tooltip box var width = 0 diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index 9b429cb..0d6f47f 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -1,6 +1,6 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent import net.minecraftforge.client.event.sound.PlaySoundEvent @@ -14,7 +14,7 @@ object AbiphoneDND { //BLOCK ABIPHONE SOUNDS @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) fun onSound(event: PlaySoundEvent) { - if (!Config.abiDND) return + if (!DulkirConfig.abiDND) return if (System.currentTimeMillis() - lastRing < 5000) { if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { event.result = null @@ -23,12 +23,12 @@ object AbiphoneDND { } fun handle(event: ClientChatReceivedEvent, unformatted: String) { - if (!Config.abiDND) return + if (!DulkirConfig.abiDND) return if (unformatted matches abiphoneFormat) { val matchResult = abiphoneFormat.find(unformatted) event.isCanceled = true lastRing = System.currentTimeMillis() - if (Config.abiCallerID) { + if (DulkirConfig.abiCallerID) { val blocked = if (Math.random() < .001) "Breefing" else matchResult?.groups?.get(1)?.value TextUtils.info("§6Call blocked from $blocked!") diff --git a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt index 83efb98..245fe22 100644 --- a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt +++ b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt @@ -1,6 +1,6 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.Utils import net.minecraft.util.ChatComponentText import net.minecraft.util.EnumChatFormatting @@ -16,12 +16,12 @@ object Bridge { fun handle(event: ClientChatReceivedEvent) { val message = event.message.unformattedText - if (guildFormat matches message && Config.bridgeBot) { + if (guildFormat matches message && DulkirConfig.bridgeBot) { val matchResult = guildFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) @@ -32,12 +32,12 @@ object Bridge { } // OTHER FORMAT - else if (alternateFormat matches message && Config.bridgeBot) { + else if (alternateFormat matches message && DulkirConfig.bridgeBot) { val matchResult = alternateFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) @@ -47,12 +47,12 @@ object Bridge { } } - else if (otherAltFormat matches message && Config.bridgeBot) { + else if (otherAltFormat matches message && DulkirConfig.bridgeBot) { val matchResult = otherAltFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) diff --git a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt index fbd2437..736ee43 100644 --- a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt +++ b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt @@ -1,7 +1,7 @@ package dulkirmod.features.chat import dulkirmod.DulkirMod -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent @@ -13,9 +13,9 @@ object ThrottleNotif { && TabListUtils.isInDungeons ) { event.isCanceled = true - if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) { + if (!DulkirConfig.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) { TextUtils.sendPartyChatMessage(DulkirMod.config.customMessage) - } else if (Config.throttleNotifierSpam) { + } else if (DulkirConfig.throttleNotifierSpam) { TextUtils.sendPartyChatMessage(DulkirMod.config.customMessage) } lastThrottle = System.currentTimeMillis() diff --git a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt index d607df2..93d15d2 100644 --- a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt +++ b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt @@ -1,11 +1,11 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils object VanquisherTrigger { fun handle(message: String) { - if (!Config.vanqBroadcast) return + if (!DulkirConfig.vanqBroadcast) return if (message == "A Vanquisher is spawning nearby!") { TextUtils.sendMessage("/patcher sendcoords") } diff --git a/src/main/kotlin/dulkirmod/utils/ConfigData.kt b/src/main/kotlin/dulkirmod/utils/ConfigData.kt index b881248..60a4a0f 100644 --- a/src/main/kotlin/dulkirmod/utils/ConfigData.kt +++ b/src/main/kotlin/dulkirmod/utils/ConfigData.kt @@ -1,17 +1,17 @@ package dulkirmod.utils -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig data class ConfigData( - val size: Float = Config.customSize, - val scaleSwing: Boolean = Config.doesScaleSwing, - val x: Float = Config.customX, - val y: Float = Config.customY, - val z: Float = Config.customZ, - val yaw: Float = Config.customYaw, - val pitch: Float = Config.customPitch, - val roll: Float = Config.customRoll, - val speed: Float = Config.customSpeed, - val ignoreHaste: Boolean = Config.ignoreHaste, - val drinkingFix: Int = Config.drinkingSelector, + val size: Float = DulkirConfig.customSize, + val scaleSwing: Boolean = DulkirConfig.doesScaleSwing, + val x: Float = DulkirConfig.customX, + val y: Float = DulkirConfig.customY, + val z: Float = DulkirConfig.customZ, + val yaw: Float = DulkirConfig.customYaw, + val pitch: Float = DulkirConfig.customPitch, + val roll: Float = DulkirConfig.customRoll, + val speed: Float = DulkirConfig.customSpeed, + val ignoreHaste: Boolean = DulkirConfig.ignoreHaste, + val drinkingFix: Int = DulkirConfig.drinkingSelector, ) diff --git a/src/main/kotlin/dulkirmod/utils/TitleUtils.kt b/src/main/kotlin/dulkirmod/utils/TitleUtils.kt index 8932878..f5c6325 100644 --- a/src/main/kotlin/dulkirmod/utils/TitleUtils.kt +++ b/src/main/kotlin/dulkirmod/utils/TitleUtils.kt @@ -1,7 +1,7 @@ package dulkirmod.utils import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.client.event.RenderGameOverlayEvent @@ -18,12 +18,12 @@ object TitleUtils { val width = mc.fontRendererObj.getStringWidth(curString) val screenWidth = ScaledResolution(mc).scaledWidth_double val screenHeight = ScaledResolution(mc).scaledHeight_double - var scale = ((screenWidth - 100) * Config.bestiaryNotifSize) / width + var scale = ((screenWidth - 100) * DulkirConfig.bestiaryNotifSize) / width scale = min(scale, 10.0) GlStateManager.pushMatrix() GlStateManager.translate((screenWidth / 2 - width * scale / 2), screenHeight / 2 - (4.5 * scale), 0.0) GlStateManager.scale(scale, scale, scale) - mc.fontRendererObj.drawString(curString, 0f, 0f, 0, Config.bestiaryTextShadow) + mc.fontRendererObj.drawString(curString, 0f, 0f, 0, DulkirConfig.bestiaryTextShadow) GlStateManager.popMatrix() } diff --git a/src/main/kotlin/dulkirmod/utils/Utils.kt b/src/main/kotlin/dulkirmod/utils/Utils.kt index ce19b32..6340a6b 100644 --- a/src/main/kotlin/dulkirmod/utils/Utils.kt +++ b/src/main/kotlin/dulkirmod/utils/Utils.kt @@ -2,7 +2,7 @@ package dulkirmod.utils import com.google.gson.Gson import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import net.minecraft.util.EnumChatFormatting import java.awt.Toolkit import java.awt.datatransfer.Clipboard @@ -33,17 +33,17 @@ object Utils { try { val jsonString = String(Base64.getDecoder().decode(base64)) val import = gson.fromJson(jsonString, ConfigData::class.java) - Config.customSize = import.size - Config.customSpeed = import.speed - Config.doesScaleSwing = import.scaleSwing - Config.customX = import.x - Config.customY = import.y - Config.customZ = import.z - Config.customYaw = import.yaw - Config.customPitch = import.pitch - Config.customRoll = import.roll - Config.drinkingSelector = import.drinkingFix - Config.ignoreHaste = import.ignoreHaste + DulkirConfig.customSize = import.size + DulkirConfig.customSpeed = import.speed + DulkirConfig.doesScaleSwing = import.scaleSwing + DulkirConfig.customX = import.x + DulkirConfig.customY = import.y + DulkirConfig.customZ = import.z + DulkirConfig.customYaw = import.yaw + DulkirConfig.customPitch = import.pitch + DulkirConfig.customRoll = import.roll + DulkirConfig.drinkingSelector = import.drinkingFix + DulkirConfig.ignoreHaste = import.ignoreHaste } catch (e: Exception) { TextUtils.info("§6§lCurrent clipboard is not a recognizable Custom Animation Preset.") } -- cgit