diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index d7371cfa6..bc626a156 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -2,9 +2,10 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.NEUInternalName import net.minecraft.client.Minecraft import net.minecraft.network.play.server.S29PacketSoundEffect import net.minecraft.network.play.server.S2APacketParticles @@ -71,12 +72,12 @@ class MinecraftData { fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return val hand = InventoryUtils.getItemInHand() - val newItem = hand?.getInternalName_old() ?: "" + val newItem = hand?.getInternalName() ?: NEUInternalName.NONE if (newItem != InventoryUtils.itemInHandId) { ItemInHandChangeEvent(newItem, hand).postAndCatch() InventoryUtils.recentItemsInHand.keys.removeIf { it + 30_000 > System.currentTimeMillis() } - if (newItem != "") { + if (newItem != NEUInternalName.NONE) { InventoryUtils.recentItemsInHand[System.currentTimeMillis()] = newItem } InventoryUtils.itemInHandId = newItem @@ -86,7 +87,7 @@ class MinecraftData { @SubscribeEvent fun onWorldChange(event: LorenzWorldChangeEvent) { - InventoryUtils.itemInHandId = "" + InventoryUtils.itemInHandId = NEUInternalName.NONE InventoryUtils.recentItemsInHand.clear() } }
\ No newline at end of file |
