diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-20 20:49:30 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-20 20:49:30 +0100 |
commit | a7fdf009c3012522289c73d330e442005418743d (patch) | |
tree | 55308af2c7738eb7d99280d18d52c9e69a54a8c7 /src | |
parent | 3b89042f6576ac1d0c1f9ad317ff0212e4635187 (diff) | |
download | skyhanni-a7fdf009c3012522289c73d330e442005418743d.tar.gz skyhanni-a7fdf009c3012522289c73d330e442005418743d.tar.bz2 skyhanni-a7fdf009c3012522289c73d330e442005418743d.zip |
Fixed diana mobs being invisible because of Fix Ghost Entities and four season pet skin.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt index bb273efe7..4cc1cc5ae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt @@ -18,10 +18,12 @@ object FixGhostEntities { private val config get() = SkyHanniMod.feature.misc private var recentlyRemovedEntities = ArrayDeque<Int>() + private var recentlySpawnedEntities = ArrayDeque<Int>() @SubscribeEvent fun onWorldChange(event: LorenzWorldChangeEvent) { recentlyRemovedEntities = ArrayDeque() + recentlySpawnedEntities = ArrayDeque() } @SubscribeEvent @@ -34,15 +36,20 @@ object FixGhostEntities { if (packet.entityID in recentlyRemovedEntities) { event.cancel() } + recentlySpawnedEntities.addLast(packet.entityID) } else if (packet is S0FPacketSpawnMob) { if (packet.entityID in recentlyRemovedEntities) { event.cancel() } + recentlySpawnedEntities.addLast(packet.entityID) } else if (packet is S13PacketDestroyEntities) { for (entityID in packet.entityIDs) { - recentlyRemovedEntities.addLast(entityID) - if (recentlyRemovedEntities.size == 10) { - recentlyRemovedEntities.removeFirst() + // ingore entities that got properly spawned and then removed + if (entityID !in recentlySpawnedEntities) { + recentlyRemovedEntities.addLast(entityID) + if (recentlyRemovedEntities.size == 10) { + recentlyRemovedEntities.removeFirst() + } } } } |