aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 16:43:20 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 16:43:20 +0200
commit1ff9c6ead7343eebc1f0efc980d5f29faa8f68ec (patch)
tree694179d8925b916cc0ff3769eb64ae78c00b341d /src
parent5b98edd63bb55754349508e0a6a6e6acca29b2d5 (diff)
downloadskyhanni-1ff9c6ead7343eebc1f0efc980d5f29faa8f68ec.tar.gz
skyhanni-1ff9c6ead7343eebc1f0efc980d5f29faa8f68ec.tar.bz2
skyhanni-1ff9c6ead7343eebc1f0efc980d5f29faa8f68ec.zip
Fixed the error message with HEMOVIBE not found in NEU Repo
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
index 08234bdf1..0b6178399 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
@@ -18,7 +18,6 @@ abstract class LorenzEvent : Event() {
if (it is NoSuchMethodError) {
LorenzUtils.chat("§c[SkyHanni] You need to use a newer version of NotEnoughUpdates (alpha-11 or newer)! If you need help downloading it, go to the skyhanni discord.")
} else {
- it.printStackTrace()
CopyErrorCommand.logError(it, "Caught an ${it::class.simpleName ?: "error"} at ${eventName}: '${it.message}'")
}
}.getOrDefault(isCanceled)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
index 5e2321e24..e6f646ef1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
@@ -48,8 +48,13 @@ class BazaarDataHolder {
fun getData(internalName: String) = bazaarData[internalName] ?: createNewData(internalName)
- private fun createNewData(internalName: String): BazaarData {
- val displayName = NEUItems.getItemStack(internalName).name!!.removeColor()
+ private fun createNewData(internalName: String): BazaarData? {
+ val stack = NEUItems.getItemStackOrNull(internalName)
+ if (stack == null) {
+ LorenzUtils.debug("Bazaar data is null: '$internalName'")
+ return null
+ }
+ val displayName = stack.name!!.removeColor()
val sellPrice = NEUItems.getPrice(internalName, true)
val buyPrice = NEUItems.getPrice(internalName, false)
val npcPrice = npcPrices[internalName].let {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 07e1c9318..dc98f3a0a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -134,15 +134,11 @@ object NEUItems {
.withKnownInternalName(internalName)
.resolveToItemStack()?.copy()
- fun getItemStack(internalName: String): ItemStack {
- val stack = getItemStackOrNull(internalName)
- if (stack == null) {
- val error = "ItemResolutionQuery returns null for internalName '$internalName'"
- LorenzUtils.error(error)
- throw RuntimeException(error)
- }
- return stack
- }
+ fun getItemStack(internalName: String): ItemStack = getItemStackOrNull(internalName)
+ ?: throw IllegalStateException(
+ "Could not find the Item '$internalName' in NEU Repo",
+ Error("ItemResolutionQuery returns null for internalName '$internalName'")
+ )
fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName())