mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-20 15:39:31 +00:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 {
|
dependencies {
|
||||||
compileOnly 'com.willfp:eco:6.35.1'
|
compileOnly 'com.willfp:eco:6.35.1'
|
||||||
implementation 'com.willfp:libreforge:3.77.0'
|
implementation 'com.willfp:libreforge:3.84.0'
|
||||||
implementation 'org.joml:joml:1.10.4'
|
implementation 'org.joml:joml:1.10.4'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.bukkit.entity.Mob
|
|||||||
|
|
||||||
class LivingEcoBoss(
|
class LivingEcoBoss(
|
||||||
plugin: EcoPlugin,
|
plugin: EcoPlugin,
|
||||||
private val mob: Mob,
|
val entity: Mob,
|
||||||
val boss: EcoBoss,
|
val boss: EcoBoss,
|
||||||
private val tickers: Set<BossTicker>
|
private val tickers: Set<BossTicker>
|
||||||
) {
|
) {
|
||||||
@@ -17,9 +17,6 @@ class LivingEcoBoss(
|
|||||||
}
|
}
|
||||||
}.apply { runTaskTimer(1, 1) }
|
}.apply { runTaskTimer(1, 1) }
|
||||||
|
|
||||||
val entity: Mob
|
|
||||||
get() = mob
|
|
||||||
|
|
||||||
val chunk: Chunk
|
val chunk: Chunk
|
||||||
get() = entity.location.chunk
|
get() = entity.location.chunk
|
||||||
|
|
||||||
@@ -46,13 +43,11 @@ class LivingEcoBoss(
|
|||||||
ticker.cancel()
|
ticker.cancel()
|
||||||
entity.remove()
|
entity.remove()
|
||||||
tickers.forEach { it.onDeath(this, currentTick) }
|
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 {
|
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 com.willfp.ecobosses.events.BossKillEvent
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
|
import org.bukkit.event.EventPriority
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
import org.bukkit.event.entity.EntityDeathEvent
|
import org.bukkit.event.entity.EntityDeathEvent
|
||||||
|
|
||||||
@@ -25,7 +26,8 @@ class DeathListeners : Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(
|
@EventHandler(
|
||||||
ignoreCancelled = true
|
ignoreCancelled = true,
|
||||||
|
priority = EventPriority.HIGHEST
|
||||||
)
|
)
|
||||||
fun handle(event: EntityDeathEvent) {
|
fun handle(event: EntityDeathEvent) {
|
||||||
val boss = Bosses[event.entity] ?: return
|
val boss = Bosses[event.entity] ?: return
|
||||||
|
|||||||
@@ -18,4 +18,9 @@ class ChunkTicker : BossTicker {
|
|||||||
currentChunk.isForceLoaded = true
|
currentChunk.isForceLoaded = true
|
||||||
boss.forceLoadedChunks.add(currentChunk)
|
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
|
#libreforge-updater
|
||||||
#Sun Jul 24 22:49:25 BST 2022
|
#Tue Aug 16 18:45:53 CEST 2022
|
||||||
version=8.62.0
|
version=8.69.0
|
||||||
plugin-name=EcoBosses
|
plugin-name=EcoBosses
|
||||||
|
|||||||
Reference in New Issue
Block a user