Skip to content

Commit

Permalink
Fix crash when swapping worlds really quickly idk (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o authored Oct 8, 2023
1 parent 2d9aa2f commit f95b676
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ object SpamHider : PersistentSave(File(Skytils.modDir, "spamhider.json")) {
fun onChatPacket(event: ReceiveEvent) {
val packet = event.packet
if (Utils.inSkyblock && packet is S0BPacketAnimation && packet.animationType == 0) {
val entity = mc.theWorld.getEntityByID(packet.entityID) ?: return
val entity = mc.theWorld?.getEntityByID(packet.entityID) ?: return
if (entity !is EntityOtherPlayerMP) return
if (entity.heldItem?.item != deadBush || entity.getDistanceSqToEntity(mc.thePlayer) > 4 * 4) return
lastSpooked = System.currentTimeMillis()
Expand Down

0 comments on commit f95b676

Please sign in to comment.