diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-02 22:17:42 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-02 22:17:42 +0200 |
commit | d6ea5e105a9fd83f58ffd9c6e1883f5ab551e684 (patch) | |
tree | eb733ac965de6117111e968899c309c1afb62f5c /src/main/java/at/hannibal2 | |
parent | 9cb2848ebbabbd9942fa56179f4dcd68363ebeda (diff) | |
download | skyhanni-d6ea5e105a9fd83f58ffd9c6e1883f5ab551e684.tar.gz skyhanni-d6ea5e105a9fd83f58ffd9c6e1883f5ab551e684.tar.bz2 skyhanni-d6ea5e105a9fd83f58ffd9c6e1883f5ab551e684.zip |
add workaround for empty internal name
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index dd6a37bcd..5bafff0ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import net.minecraft.item.ItemStack import net.minecraft.network.play.server.S2FPacketSetSlot @@ -21,6 +22,8 @@ class OwnInventoryData { @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) fun onChatPacket(event: PacketEvent.ReceiveEvent) { + if (!LorenzUtils.inSkyBlock) return + val packet = event.packet if (packet is S2FPacketSetSlot) { val windowId = packet.func_149175_c() @@ -82,6 +85,11 @@ class OwnInventoryData { val (_, amount) = NEUItems.getMultiplier(internalName) if (amount > 1) return + if (internalName == "") { + LorenzUtils.debug("OwnInventoryData add is empty for: '$internalName'") + return + } + addMultiplier(internalName, add) } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index cf2515ac1..23ed9be71 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -88,7 +88,7 @@ object NEUItems { fun getItemStack(internalName: String): ItemStack { val stack = getItemStackOrNull(internalName) if (stack == null) { - val error = "ItemResolutionQuery returns null for internalName $internalName" + val error = "ItemResolutionQuery returns null for internalName '$internalName'" LorenzUtils.error(error) throw RuntimeException(error) } |