aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-20 20:49:30 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-20 20:49:30 +0100
commita7fdf009c3012522289c73d330e442005418743d (patch)
tree55308af2c7738eb7d99280d18d52c9e69a54a8c7 /src/main/java/at
parent3b89042f6576ac1d0c1f9ad317ff0212e4635187 (diff)
downloadskyhanni-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/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt13
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()
+ }
}
}
}