9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-23 17:09:27 +00:00

Fixed stupidity (part 2)

This commit is contained in:
Auxilor
2022-02-06 13:35:00 +00:00
parent 64b22a17d6
commit 4765b20d20
3 changed files with 12 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ import com.willfp.ecobosses.defence.MountHandler
import com.willfp.ecobosses.defence.PickupHandler
import com.willfp.ecobosses.integrations.levelledmobs.IntegrationLevelledMobs
import com.willfp.ecobosses.lifecycle.CompatibilityListeners
import com.willfp.ecobosses.lifecycle.DeathListeners
import com.willfp.ecobosses.lifecycle.LifecycleHandlers
import com.willfp.ecobosses.spawn.AutospawnHandler
import com.willfp.ecobosses.spawn.SpawnEggHandler
@@ -53,7 +54,8 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
PickupHandler(),
ImmunitiesHandler(),
CompatibilityListeners(),
SpawnTotemHandler()
SpawnTotemHandler(),
DeathListeners()
)
}

View File

@@ -45,4 +45,8 @@ class LivingEcoBoss(
boss.markDead(uuid)
}
override fun toString(): String {
return "LivingEcoBoss{boss=${boss}, uuid=${uuid}}"
}
}

View File

@@ -16,10 +16,11 @@ class DeathListeners : Listener {
fun handle(event: EntityDeathByEntityEvent) {
val boss = Bosses[event.victim] ?: return
boss.remove()
val deathEvent = BossKillEvent(boss, event.killer.tryAsPlayer(), event.deathEvent)
Bukkit.getPluginManager().callEvent(deathEvent)
boss.remove()
}
@EventHandler(
@@ -28,10 +29,10 @@ class DeathListeners : Listener {
fun handle(event: EntityDeathEvent) {
val boss = Bosses[event.entity] ?: return
boss.remove()
val deathEvent = BossKillEvent(boss, null, event)
Bukkit.getPluginManager().callEvent(deathEvent)
boss.remove()
}
@EventHandler(