summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-06-21 07:39:24 +1000
committerGitHub <noreply@github.com>2024-06-20 23:39:24 +0200
commitd534f73b63578d384c7a69462ca18cf0883926f5 (patch)
tree80e21e1f0ec41c5dee47712c5d2144281afeb0e7 /src/main/java/at/hannibal2/skyhanni/utils
parent6410dcf999a08d4b6625fdc25f2db148c9df8338 (diff)
downloadskyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.tar.gz
skyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.tar.bz2
skyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.zip
Backend: Remove deprecated function ChatUtils.error (#2021)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt23
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt7
2 files changed, 2 insertions, 28 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
index aff0e745a..664def423 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
@@ -33,7 +33,6 @@ object ChatUtils {
private const val DEBUG_PREFIX = "[SkyHanni Debug] §7"
private const val USER_ERROR_PREFIX = "§c[SkyHanni] "
- private val ERROR_PREFIX by lazy { "§c[SkyHanni-${SkyHanniMod.version}] " }
private const val CHAT_PREFIX = "[SkyHanni] "
/**
@@ -63,28 +62,6 @@ object ChatUtils {
}
/**
- * Sends a message to the user that an error occurred caused by something in the code.
- * This should be used for errors that are not caused by the user.
- *
- * Why deprecate this? Even if this message is descriptive for the user and the developer,
- * we don't want inconsistencies in errors, and we would need to search
- * for the code line where this error gets printed any way.
- * So it's better to use the stack trace still.
- *
- * @param message The message to be sent
- *
- * @see ERROR_PREFIX
- */
- @Deprecated(
- "Do not send the user a non clickable non stacktrace containing error message.",
- ReplaceWith("ErrorManager.logErrorStateWithData(message)")
- )
- fun error(message: String) {
- println("error: '$message'")
- internalChat(ERROR_PREFIX + message)
- }
-
- /**
* Sends a message to the user
* @param message The message to be sent
* @param prefix Whether to prefix the message with the chat prefix, default true
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 6af19e382..54cdfa91e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull
import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matches
-import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.cachedData
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRecombobulated
@@ -61,10 +60,8 @@ object ItemUtils {
fun getItemsInInventory(withCursorItem: Boolean = false): List<ItemStack> {
val list: LinkedList<ItemStack> = LinkedList()
val player = Minecraft.getMinecraft().thePlayer
- if (player == null) {
- ChatUtils.error("getItemsInInventoryWithSlots: player is null!")
- return list
- }
+ ?: ErrorManager.skyHanniError("getItemsInInventoryWithSlots: player is null!")
+
for (slot in player.openContainer.inventorySlots) {
if (slot.hasStack) {
list.add(slot.stack)