mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 15:09:17 +00:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64726f665f | ||
|
|
e4fdaeec1d | ||
|
|
3c5fbd6151 | ||
|
|
4329431994 | ||
|
|
c55692e89f | ||
|
|
03466f7892 | ||
|
|
1a6ebd4455 | ||
|
|
486f071dea | ||
|
|
fb4eac5e5e | ||
|
|
49d1d3f054 | ||
|
|
6dc7426146 | ||
|
|
00c5ead347 | ||
|
|
9bd501dfbe | ||
|
|
67d55bbdc2 | ||
|
|
46aa086366 | ||
|
|
9f00334ea4 | ||
|
|
e6db159bfb | ||
|
|
3df7b75737 | ||
|
|
c243a425b3 | ||
|
|
e57fe61d22 | ||
|
|
9830aed484 | ||
|
|
999b89bcb0 | ||
|
|
e7f326efbb | ||
|
|
0cb5b0b7b7 | ||
|
|
8e2d901e9b | ||
|
|
724eede36e | ||
|
|
01a2cc7118 | ||
|
|
20aace3727 | ||
|
|
05cf399e77 | ||
|
|
de2b8f7526 |
@@ -63,7 +63,7 @@ allprojects {
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.35.1'
|
||||
implementation 'com.willfp:libreforge:3.77.0'
|
||||
implementation 'com.willfp:libreforge:3.87.1'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.entity.Mob
|
||||
|
||||
class LivingEcoBoss(
|
||||
plugin: EcoPlugin,
|
||||
private val mob: Mob,
|
||||
val entity: Mob,
|
||||
val boss: EcoBoss,
|
||||
private val tickers: Set<BossTicker>
|
||||
) {
|
||||
@@ -17,9 +17,6 @@ class LivingEcoBoss(
|
||||
}
|
||||
}.apply { runTaskTimer(1, 1) }
|
||||
|
||||
val entity: Mob
|
||||
get() = mob
|
||||
|
||||
val chunk: Chunk
|
||||
get() = entity.location.chunk
|
||||
|
||||
@@ -46,13 +43,11 @@ class LivingEcoBoss(
|
||||
ticker.cancel()
|
||||
entity.remove()
|
||||
tickers.forEach { it.onDeath(this, currentTick) }
|
||||
forceLoadedChunks.forEach { it.isForceLoaded = false }
|
||||
forceLoadedChunks.clear()
|
||||
|
||||
boss.markDead(mob.uniqueId)
|
||||
boss.markDead(entity.uniqueId)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "LivingEcoBoss{boss=${boss}, uuid=${mob.uniqueId}}"
|
||||
return "LivingEcoBoss{boss=${boss}, uuid=${entity.uniqueId}}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.entity.EntityDeathEvent
|
||||
|
||||
@@ -25,7 +26,8 @@ class DeathListeners : Listener {
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
ignoreCancelled = true
|
||||
ignoreCancelled = true,
|
||||
priority = EventPriority.HIGHEST
|
||||
)
|
||||
fun handle(event: EntityDeathEvent) {
|
||||
val boss = Bosses[event.entity] ?: return
|
||||
|
||||
@@ -18,4 +18,9 @@ class ChunkTicker : BossTicker {
|
||||
currentChunk.isForceLoaded = true
|
||||
boss.forceLoadedChunks.add(currentChunk)
|
||||
}
|
||||
|
||||
override fun onDeath(boss: LivingEcoBoss, tick: Int) {
|
||||
boss.forceLoadedChunks.forEach { it.isForceLoaded = false }
|
||||
boss.forceLoadedChunks.clear()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#libreforge-updater
|
||||
#Sun Jul 24 22:49:25 BST 2022
|
||||
version=8.62.0
|
||||
#Wed Aug 24 11:57:32 CEST 2022
|
||||
version=8.72.1
|
||||
plugin-name=EcoBosses
|
||||
|
||||
Reference in New Issue
Block a user