diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-24 12:26:26 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-24 12:26:26 +0100 |
commit | 80813c4ec241390f465231d6fccb9cf79e6096cb (patch) | |
tree | a77047a808d7e045d3ecc561791f5913ad716a4e /src/main/java/at | |
parent | 151feede0c62c9c062c35bec6600b43ed9d3c05e (diff) | |
download | skyhanni-80813c4ec241390f465231d6fccb9cf79e6096cb.tar.gz skyhanni-80813c4ec241390f465231d6fccb9cf79e6096cb.tar.bz2 skyhanni-80813c4ec241390f465231d6fccb9cf79e6096cb.zip |
Fixed ReplaceWith auto replace feature from IDEs for deprecated functions.
Diffstat (limited to 'src/main/java/at')
4 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt index 29b296baf..1c37d5249 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt @@ -47,7 +47,7 @@ object ErrorManager { } ?: "Error id not found!") } - @Deprecated("Use data as well", ReplaceWith("logErrorStateWithData()")) + @Deprecated("Use data as well", ReplaceWith("logErrorStateWithData(userMessage, internalMessage)")) fun logErrorState(userMessage: String, internalMessage: String) { logError(IllegalStateException(internalMessage), userMessage, ignoreErrorCache = false, noStackTrace = false) } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt index 036cad877..a65da4387 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt @@ -67,7 +67,7 @@ object ChatUtils { */ @Deprecated( "Do not send the user a non clickable non stacktrace containing error message.", - ReplaceWith("ErrorManager.logErrorStateWithData") + ReplaceWith("ErrorManager.logErrorStateWithData(message)") ) fun error(message: String) { println("error: '$message'") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 05a7cad36..77979a5aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -113,13 +113,13 @@ object LorenzUtils { fun formatPercentage(percentage: Double, format: String?): String = DecimalFormat(format).format(percentage * 100).replace(',', '.') + "%" - @Deprecated("old code", ReplaceWith("addSeparators()")) + @Deprecated("old code", ReplaceWith("i.addSeparators()")) fun formatInteger(i: Int): String = i.addSeparators() - @Deprecated("old code", ReplaceWith("addSeparators()")) + @Deprecated("old code", ReplaceWith("l.addSeparators()")) fun formatInteger(l: Long): String = l.addSeparators() - @Deprecated("old code", ReplaceWith("round() and addSeparators()")) + @Deprecated("old code", ReplaceWith("d.round(round).addSeparators()")) fun formatDouble(d: Double, round: Int = 1): String { return d.round(round).addSeparators() } @@ -330,7 +330,7 @@ object LorenzUtils { FMLCommonHandler.instance().handleExit(-1) } - @Deprecated("moved", ReplaceWith("ChatUtils.sendCommandToServer")) + @Deprecated("moved", ReplaceWith("ChatUtils.sendCommandToServer(command)")) fun sendCommandToServer(command: String) { ChatUtils.sendCommandToServer(command) } @@ -343,21 +343,21 @@ object LorenzUtils { return runCatching { this.group(groupName) }.getOrNull() } - @Deprecated("moved", ReplaceWith("ChatUtils.debug")) + @Deprecated("moved", ReplaceWith("ChatUtils.debug(message)")) fun debug(message: String) = ChatUtils.debug(message) - @Deprecated("moved", ReplaceWith("ChatUtils.userError")) + @Deprecated("moved", ReplaceWith("ChatUtils.userError(message)")) fun userError(message: String) = ChatUtils.userError(message) - @Deprecated("moved", ReplaceWith("ChatUtils.chat")) + @Deprecated("moved", ReplaceWith("ChatUtils.chat(message, prefix, prefixColor)")) fun chat(message: String, prefix: Boolean = true, prefixColor: String = "§e") = ChatUtils.chat(message, prefix, prefixColor) - @Deprecated("moved", ReplaceWith("ChatUtils.clickableChat")) + @Deprecated("moved", ReplaceWith("ChatUtils.clickableChat(message, command, prefix, prefixColor)")) fun clickableChat(message: String, command: String, prefix: Boolean = true, prefixColor: String = "§e") = ChatUtils.clickableChat(message, command, prefix, prefixColor) - @Deprecated("moved", ReplaceWith("ChatUtils.hoverableChat")) + @Deprecated("moved", ReplaceWith("ChatUtils.hoverableChat(message, hover, command, prefix, prefixColor)")) fun hoverableChat( message: String, hover: List<String>, @@ -366,6 +366,6 @@ object LorenzUtils { prefixColor: String = "§e", ) = ChatUtils.hoverableChat(message, hover, command, prefix, prefixColor) - @Deprecated("moved", ReplaceWith("ChatUtils.sendMessageToServer")) + @Deprecated("moved", ReplaceWith("ChatUtils.sendMessageToServer(message)")) fun sendMessageToServer(message: String) = ChatUtils.sendMessageToServer(message) } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt index 4ca07e423..df34ec70e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt @@ -30,7 +30,7 @@ object TimeUtils { else -> default } - @Deprecated("off sets by one second", ReplaceWith("Duration.format()")) + @Deprecated("Has an offset of one second", ReplaceWith("use kotlin Duration")) fun formatDuration( millis: Long, biggestUnit: TimeUnit = TimeUnit.YEAR, @@ -78,7 +78,7 @@ object TimeUtils { return builder.toString().trim() } - @Deprecated("Do no longer use long for time", ReplaceWith("getDuration()")) + @Deprecated("Do no longer use long for time", ReplaceWith("getDuration(string)")) fun getMillis(string: String) = getDuration(string).inWholeMilliseconds fun getDuration(string: String) = getMillis_(string.replace("m", "m ").replace(" ", " ").trim()) |