diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-26 23:59:20 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-26 23:59:20 +0200 |
commit | 370cf58f29a5d32040f83ca17465fd493cc88f61 (patch) | |
tree | 6594beafb7a903785bbcbcd1fd2c12897c5979ef /src/main/java/at/hannibal2/skyhanni/data | |
parent | eef49c780202dc5c64c943269f00973e70010dec (diff) | |
download | skyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.tar.gz skyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.tar.bz2 skyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.zip |
Added Horsezooka Hider
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index c28db9a9d..b9e2b45dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -1,6 +1,8 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.* +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import net.minecraft.client.Minecraft @@ -64,4 +66,21 @@ class MinecraftData { tick++ LorenzTickEvent(tick).postAndCatch() } + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!LorenzUtils.inSkyBlock) return + val hand = InventoryUtils.getItemInHand() + val newItem = hand?.getInternalName() ?: "" + if (newItem != InventoryUtils.itemInHandId) { + ItemInHandChangeEvent(newItem, hand).postAndCatch() + InventoryUtils.itemInHandId = newItem + InventoryUtils.latestItemInHand = hand + } + } + + @SubscribeEvent + fun onWorldChange(event: LorenzWorldChangeEvent) { + InventoryUtils.itemInHandId = "" + } }
\ No newline at end of file |