Skip to content

Commit

Permalink
Fix BonfireRemoved not being serializable, leaving furniture behind b…
Browse files Browse the repository at this point in the history
…ecause of error
  • Loading branch information
0ffz committed Dec 5, 2023
1 parent 6384817 commit 57b87bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
package com.mineinabyss.bonfire.components

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable @SerialName("bonfire:bonfire_removed")
class BonfireRemoved
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class BonfireListener : Listener {
if (!entity.isDead) return
val bonfireData = (entity as? ItemDisplay)?.toGearyOrNull()?.get<Bonfire>() ?: return

BlockyFurnitures.removeFurniture(entity as ItemDisplay)

bonfireData.bonfirePlayers.map { it.toOfflinePlayer() }.forEach { p ->
val onlinePlayer = p.player
if (onlinePlayer != null) {
Expand All @@ -170,7 +172,5 @@ class BonfireListener : Listener {
}
}
}

BlockyFurnitures.removeFurniture(entity as ItemDisplay)
}
}

0 comments on commit 57b87bf

Please sign in to comment.