diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-19 22:30:23 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-19 22:30:23 +0100 |
commit | 4abd0d1fa483a67972aced65dc322ad5b510aee5 (patch) | |
tree | 851ceb651fece0441089f9f0cb2b6c7a9425509d /src/main/java/at | |
parent | 6639173b3865e86981a5a02f0fe22e62ae6c8a6c (diff) | |
download | skyhanni-4abd0d1fa483a67972aced65dc322ad5b510aee5.tar.gz skyhanni-4abd0d1fa483a67972aced65dc322ad5b510aee5.tar.bz2 skyhanni-4abd0d1fa483a67972aced65dc322ad5b510aee5.zip |
Fixed farming weight no longer updating on block breaking.
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt | 11 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index d6bd2d892..4c6058b26 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi @@ -30,9 +31,17 @@ class OwnInventoryData { fun onChatPacket(event: PacketEvent.ReceiveEvent) { if (!LorenzUtils.inSkyBlock) return - if (event.packet.let { it is S2FPacketSetSlot || it is S0DPacketCollectItem }) { + val packet = event.packet + if (packet is S2FPacketSetSlot || packet is S0DPacketCollectItem) { dirty = true } + if (packet is S2FPacketSetSlot) { + val windowId = packet.func_149175_c() + if (windowId == 0) { + val item = packet.func_149174_e() ?: return + OwnInventoryItemUpdateEvent(item).postAndCatch() + } + } } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index f32da7867..f776a9c86 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -387,8 +387,8 @@ class FarmingWeightDisplay { private fun chatOffScreenChange(direction: String, oldPosition: Int) { farmingChatMessage( "§7Since your last visit to the §aGarden§7, " + - "you have $direction §7on the §dFarming Leaderboard§7. " + - "§7(§e#${oldPosition.addSeparators()} §7-> §e#${leaderboardPosition.addSeparators()}§7)" + "you have $direction §7on the §dFarming Leaderboard§7. " + + "§7(§e#${oldPosition.addSeparators()} §7-> §e#${leaderboardPosition.addSeparators()}§7)" ) } |