diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt | 23 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 7 |
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) |
