mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-20 07:29:21 +00:00
Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486f071dea | ||
|
|
fb4eac5e5e | ||
|
|
49d1d3f054 | ||
|
|
6dc7426146 | ||
|
|
00c5ead347 | ||
|
|
9bd501dfbe | ||
|
|
67d55bbdc2 | ||
|
|
46aa086366 | ||
|
|
9f00334ea4 | ||
|
|
e6db159bfb | ||
|
|
3df7b75737 | ||
|
|
c243a425b3 | ||
|
|
e57fe61d22 | ||
|
|
9830aed484 | ||
|
|
999b89bcb0 | ||
|
|
e7f326efbb | ||
|
|
0cb5b0b7b7 | ||
|
|
8e2d901e9b | ||
|
|
724eede36e | ||
|
|
01a2cc7118 | ||
|
|
20aace3727 | ||
|
|
ec9d4c0dd6 | ||
|
|
b3a0c1fa67 | ||
|
|
88294a17cd | ||
|
|
1ac6a350ec | ||
|
|
a9333cb8b5 | ||
|
|
05cf399e77 | ||
|
|
de2b8f7526 | ||
|
|
23085e74e2 | ||
|
|
80f02a07a4 | ||
|
|
a63625593d | ||
|
|
1dfd7bac1f | ||
|
|
34b983b185 | ||
|
|
33b2fd9e13 | ||
|
|
85cfb542dc | ||
|
|
197f9e91aa | ||
|
|
9d4a91805a | ||
|
|
87b91c46d1 | ||
|
|
4a7e6e9ff1 | ||
|
|
b59e54be01 | ||
|
|
d26f0294cc | ||
|
|
150433d46b | ||
|
|
7de4d75c93 | ||
|
|
9790459a26 | ||
|
|
666a80b401 | ||
|
|
59810059aa | ||
|
|
7b604c7812 | ||
|
|
81eab18e42 | ||
|
|
fa54c7022b | ||
|
|
26f976a7ca | ||
|
|
4fa070dabe | ||
|
|
f73327b204 | ||
|
|
d9b702f2f1 | ||
|
|
7692e84a60 | ||
|
|
ffd6037e73 | ||
|
|
7c959d7221 | ||
|
|
91ad33334d | ||
|
|
c1b8ed5b48 | ||
|
|
2f3c5f60a4 | ||
|
|
f3387668e6 | ||
|
|
b62e79d904 | ||
|
|
d7afeecc27 | ||
|
|
72e61940c5 | ||
|
|
245445473b | ||
|
|
46772ac97a | ||
|
|
29a1e541a2 | ||
|
|
89a6bc97b7 | ||
|
|
c59707e6ac | ||
|
|
99bc2a04ab | ||
|
|
b4e90d9bda | ||
|
|
72c3722429 | ||
|
|
c14b2f0a80 | ||
|
|
0b6c7152e8 | ||
|
|
6e551eeaeb | ||
|
|
d5610ae804 | ||
|
|
79c8ed4992 | ||
|
|
947a0f3c6d | ||
|
|
ce8b0af155 | ||
|
|
a41e5b702d | ||
|
|
f04bf3aeea | ||
|
|
08941461c9 | ||
|
|
743dbac656 | ||
|
|
2e8d1ea4cc | ||
|
|
d31a98fd99 | ||
|
|
f7244a7d7f | ||
|
|
268ed76951 | ||
|
|
d0ccb78c17 | ||
|
|
34de040849 | ||
|
|
6b01f8e64a | ||
|
|
2a4d5a8fd2 | ||
|
|
f9d7315fd3 | ||
|
|
497f42ccc6 | ||
|
|
d149eb7907 | ||
|
|
47277d0dd8 | ||
|
|
f307f13d1e | ||
|
|
ac3370c0be | ||
|
|
4f616ac8c8 | ||
|
|
24256e9789 | ||
|
|
bbf20e77d0 | ||
|
|
8a506c015b | ||
|
|
744883630d | ||
|
|
8519f4fc23 | ||
|
|
d1cb11ef79 | ||
|
|
edcc185b58 |
10
build.gradle
10
build.gradle
@@ -4,7 +4,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,15 +58,17 @@ allprojects {
|
|||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
relocate('com.willfp.libreforge', 'com.willfp.ecobosses.libreforge')
|
relocate('com.willfp.libreforge', 'com.willfp.ecobosses.libreforge')
|
||||||
|
relocate('org.joml', 'com.willfp.ecobosses.libreforge.joml')
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'com.willfp:eco:6.34.0'
|
compileOnly 'com.willfp:eco:6.35.1'
|
||||||
implementation 'com.willfp:libreforge:3.34.1'
|
implementation 'com.willfp:libreforge:3.83.0'
|
||||||
|
implementation 'org.joml:joml:1.10.4'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
|
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.willfp.ecobosses
|
package com.willfp.ecobosses
|
||||||
|
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand
|
import com.willfp.eco.core.command.impl.PluginCommand
|
||||||
|
import com.willfp.eco.core.display.DisplayModule
|
||||||
import com.willfp.eco.core.integrations.IntegrationLoader
|
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||||
import com.willfp.ecobosses.bosses.Bosses
|
import com.willfp.ecobosses.bosses.Bosses
|
||||||
|
import com.willfp.ecobosses.bosses.EggDisplay
|
||||||
import com.willfp.ecobosses.bosses.bossHolders
|
import com.willfp.ecobosses.bosses.bossHolders
|
||||||
import com.willfp.ecobosses.commands.CommandEcobosses
|
import com.willfp.ecobosses.commands.CommandEcobosses
|
||||||
import com.willfp.ecobosses.config.EcoBossesYml
|
import com.willfp.ecobosses.config.EcoBossesYml
|
||||||
@@ -23,7 +25,7 @@ import com.willfp.ecobosses.util.TopDamagerListener
|
|||||||
import com.willfp.libreforge.LibReforgePlugin
|
import com.willfp.libreforge.LibReforgePlugin
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
class EcoBossesPlugin : LibReforgePlugin() {
|
||||||
val ecoBossesYml: EcoBossesYml
|
val ecoBossesYml: EcoBossesYml
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -44,6 +46,10 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
|||||||
Bosses.getAllAlive().forEach { it.remove() }
|
Bosses.getAllAlive().forEach { it.remove() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun createDisplayModule(): DisplayModule {
|
||||||
|
return EggDisplay(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun loadPluginCommands(): List<PluginCommand> {
|
override fun loadPluginCommands(): List<PluginCommand> {
|
||||||
return listOf(
|
return listOf(
|
||||||
CommandEcobosses(this)
|
CommandEcobosses(this)
|
||||||
@@ -74,7 +80,7 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getMinimumEcoVersion(): String {
|
override fun getMinimumEcoVersion(): String {
|
||||||
return "6.24.0"
|
return "6.35.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.willfp.ecobosses.bosses
|
package com.willfp.ecobosses.bosses
|
||||||
|
|
||||||
|
import com.willfp.eco.core.fast.fast
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin
|
import com.willfp.ecobosses.EcoBossesPlugin
|
||||||
import com.willfp.libreforge.Holder
|
import com.willfp.libreforge.Holder
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
@@ -13,7 +14,7 @@ val Player.bossHolders: Iterable<Holder>
|
|||||||
|
|
||||||
for (boss in Bosses.values()) {
|
for (boss in Bosses.values()) {
|
||||||
for (livingBoss in boss.getAllAlive()) {
|
for (livingBoss in boss.getAllAlive()) {
|
||||||
val entity = livingBoss.entity ?: continue
|
val entity = livingBoss.entity
|
||||||
|
|
||||||
if (entity.world != this.world) {
|
if (entity.world != this.world) {
|
||||||
continue
|
continue
|
||||||
@@ -42,8 +43,7 @@ var ItemStack.bossEgg: EcoBoss?
|
|||||||
this.itemMeta = meta
|
this.itemMeta = meta
|
||||||
}
|
}
|
||||||
get() {
|
get() {
|
||||||
val meta = this.itemMeta ?: return null
|
val pdc = this.fast().persistentDataContainer
|
||||||
val pdc = meta.persistentDataContainer
|
|
||||||
val id = pdc.get(spawnEggKey, PersistentDataType.STRING) ?: return null
|
val id = pdc.get(spawnEggKey, PersistentDataType.STRING) ?: return null
|
||||||
return Bosses.getByID(id)
|
return Bosses.getByID(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class EcoBoss(
|
|||||||
val config: Config,
|
val config: Config,
|
||||||
private val plugin: EcoPlugin
|
private val plugin: EcoPlugin
|
||||||
) : Holder {
|
) : Holder {
|
||||||
val id: String = config.getString("id")
|
override val id: String = config.getString("id")
|
||||||
|
|
||||||
val displayName: String = config.getString("displayName")
|
val displayName: String = config.getString("displayName")
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ class EcoBoss(
|
|||||||
|
|
||||||
val boss = LivingEcoBoss(
|
val boss = LivingEcoBoss(
|
||||||
plugin,
|
plugin,
|
||||||
mob.uniqueId,
|
mob,
|
||||||
this,
|
this,
|
||||||
createTickers()
|
createTickers()
|
||||||
)
|
)
|
||||||
@@ -345,7 +345,8 @@ class EcoBoss(
|
|||||||
LifespanTicker(),
|
LifespanTicker(),
|
||||||
DisplayNameTicker(),
|
DisplayNameTicker(),
|
||||||
TargetTicker(),
|
TargetTicker(),
|
||||||
TeleportHandler()
|
TeleportHandler(),
|
||||||
|
ChunkTicker()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isBossBarEnabled) {
|
if (isBossBarEnabled) {
|
||||||
@@ -371,7 +372,7 @@ class EcoBoss(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun processRewards(event: BossKillEvent) {
|
fun processRewards(event: BossKillEvent) {
|
||||||
val entity = event.boss.entity ?: return
|
val entity = event.boss.entity
|
||||||
val location = entity.location
|
val location = entity.location
|
||||||
val player = event.killer
|
val player = event.killer
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.willfp.ecobosses.bosses
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.core.display.Display
|
||||||
|
import com.willfp.eco.core.display.DisplayModule
|
||||||
|
import com.willfp.eco.core.display.DisplayPriority
|
||||||
|
import com.willfp.eco.core.fast.fast
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import org.bukkit.inventory.ItemStack
|
||||||
|
|
||||||
|
class EggDisplay(
|
||||||
|
plugin: EcoPlugin
|
||||||
|
) : DisplayModule(
|
||||||
|
plugin,
|
||||||
|
DisplayPriority.LOW
|
||||||
|
) {
|
||||||
|
override fun display(itemStack: ItemStack, player: Player?, vararg args: Any) {
|
||||||
|
if (player == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val fis = itemStack.fast()
|
||||||
|
|
||||||
|
val lore = fis.lore.toMutableList()
|
||||||
|
|
||||||
|
val egg = itemStack.bossEgg ?: return
|
||||||
|
|
||||||
|
val lines = egg.spawnConditions
|
||||||
|
.filterNot { it.isMet(player) }
|
||||||
|
.mapNotNull { it.notMetLines?.map { line -> Display.PREFIX + line } }
|
||||||
|
.flatten()
|
||||||
|
|
||||||
|
|
||||||
|
if (lines.isNotEmpty()) {
|
||||||
|
lore.add(Display.PREFIX)
|
||||||
|
lore.addAll(lines)
|
||||||
|
}
|
||||||
|
|
||||||
|
fis.lore = lore
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,13 +2,12 @@ package com.willfp.ecobosses.bosses
|
|||||||
|
|
||||||
import com.willfp.eco.core.EcoPlugin
|
import com.willfp.eco.core.EcoPlugin
|
||||||
import com.willfp.ecobosses.tick.BossTicker
|
import com.willfp.ecobosses.tick.BossTicker
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Chunk
|
||||||
import org.bukkit.entity.Mob
|
import org.bukkit.entity.Mob
|
||||||
import java.util.UUID
|
|
||||||
|
|
||||||
class LivingEcoBoss(
|
class LivingEcoBoss(
|
||||||
plugin: EcoPlugin,
|
plugin: EcoPlugin,
|
||||||
private val uuid: UUID,
|
val entity: Mob,
|
||||||
val boss: EcoBoss,
|
val boss: EcoBoss,
|
||||||
private val tickers: Set<BossTicker>
|
private val tickers: Set<BossTicker>
|
||||||
) {
|
) {
|
||||||
@@ -18,15 +17,17 @@ class LivingEcoBoss(
|
|||||||
}
|
}
|
||||||
}.apply { runTaskTimer(1, 1) }
|
}.apply { runTaskTimer(1, 1) }
|
||||||
|
|
||||||
val entity: Mob?
|
val chunk: Chunk
|
||||||
get() = Bukkit.getEntity(uuid) as? Mob
|
get() = entity.location.chunk
|
||||||
|
|
||||||
|
val forceLoadedChunks = mutableListOf<Chunk>()
|
||||||
|
|
||||||
val deathTime = System.currentTimeMillis() + (boss.lifespan * 1000)
|
val deathTime = System.currentTimeMillis() + (boss.lifespan * 1000)
|
||||||
|
|
||||||
private var currentTick = 1 // Start at 1 as 0 is divisible by everything
|
private var currentTick = 1 // Start at 1 as 0 is divisible by everything
|
||||||
|
|
||||||
private fun tick(): Boolean {
|
private fun tick(): Boolean {
|
||||||
if (entity == null || entity?.isDead == true) {
|
if (entity.isDead) {
|
||||||
remove()
|
remove()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -40,13 +41,13 @@ class LivingEcoBoss(
|
|||||||
|
|
||||||
fun remove() {
|
fun remove() {
|
||||||
ticker.cancel()
|
ticker.cancel()
|
||||||
entity?.remove()
|
entity.remove()
|
||||||
tickers.forEach { it.onDeath(this, currentTick) }
|
tickers.forEach { it.onDeath(this, currentTick) }
|
||||||
|
|
||||||
boss.markDead(uuid)
|
boss.markDead(entity.uniqueId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "LivingEcoBoss{boss=${boss}, uuid=${uuid}}"
|
return "LivingEcoBoss{boss=${boss}, uuid=${entity.uniqueId}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class TargetMode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getTarget(boss: LivingEcoBoss): LivingEntity? {
|
fun getTarget(boss: LivingEcoBoss): LivingEntity? {
|
||||||
val entity = boss.entity ?: return null
|
val entity = boss.entity
|
||||||
|
|
||||||
return function(
|
return function(
|
||||||
entity.getNearbyEntities(
|
entity.getNearbyEntities(
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class ConsoleLoggers(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val loc = event.boss.entity?.location
|
val loc = event.boss.entity.location
|
||||||
val location = "${loc?.world?.name}: ${loc?.x}, ${loc?.y}, ${loc?.z}"
|
val location = "${loc.world?.name}: ${loc.x}, ${loc.y}, ${loc.z}"
|
||||||
|
|
||||||
plugin.logger.info("&a${event.boss.boss.id}&r was killed by &a${event.killer?.name}&r at &a$location")
|
plugin.logger.info("&a${event.boss.boss.id}&r was killed by &a${event.killer?.name}&r at &a$location")
|
||||||
}
|
}
|
||||||
@@ -48,8 +48,8 @@ class ConsoleLoggers(
|
|||||||
if (!plugin.configYml.getBool("log-spawn-kill")) {
|
if (!plugin.configYml.getBool("log-spawn-kill")) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val loc = event.boss.entity?.location
|
val loc = event.boss.entity.location
|
||||||
val location = "${loc?.world?.name}: ${loc?.x}, ${loc?.y}, ${loc?.z}"
|
val location = "${loc.world?.name}: ${loc.x}, ${loc.y}, ${loc.z}"
|
||||||
|
|
||||||
plugin.logger.info("&a${event.boss.boss.id}&r despawned at &a$location")
|
plugin.logger.info("&a${event.boss.boss.id}&r despawned at &a$location")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.willfp.ecobosses.lifecycle
|
package com.willfp.ecobosses.lifecycle
|
||||||
|
|
||||||
import com.willfp.eco.core.events.EntityDeathByEntityEvent
|
import com.willfp.eco.core.events.EntityDeathByEntityEvent
|
||||||
|
import com.willfp.eco.util.tryAsPlayer
|
||||||
import com.willfp.ecobosses.bosses.Bosses
|
import com.willfp.ecobosses.bosses.Bosses
|
||||||
import com.willfp.ecobosses.events.BossKillEvent
|
import com.willfp.ecobosses.events.BossKillEvent
|
||||||
import com.willfp.libreforge.tryAsPlayer
|
|
||||||
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
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class LifecycleHandlers : Listener {
|
|||||||
priority = EventPriority.MONITOR
|
priority = EventPriority.MONITOR
|
||||||
)
|
)
|
||||||
fun handle(event: BossKillEvent) {
|
fun handle(event: BossKillEvent) {
|
||||||
val entity = event.boss.entity ?: return
|
val entity = event.boss.entity
|
||||||
|
|
||||||
event.boss.boss.handleLifecycle(BossLifecycle.KILL, entity.location, entity)
|
event.boss.boss.handleLifecycle(BossLifecycle.KILL, entity.location, entity)
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ class LifecycleHandlers : Listener {
|
|||||||
priority = EventPriority.MONITOR
|
priority = EventPriority.MONITOR
|
||||||
)
|
)
|
||||||
fun handle(event: BossDespawnEvent) {
|
fun handle(event: BossDespawnEvent) {
|
||||||
val entity = event.boss.entity ?: return
|
val entity = event.boss.entity
|
||||||
|
|
||||||
event.boss.boss.handleLifecycle(BossLifecycle.DESPAWN, entity.location, entity)
|
event.boss.boss.handleLifecycle(BossLifecycle.DESPAWN, entity.location, entity)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class BossBarTicker(
|
|||||||
private val bar: BossBar
|
private val bar: BossBar
|
||||||
) : BossTicker {
|
) : BossTicker {
|
||||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||||
val entity = boss.entity ?: return
|
val entity = boss.entity
|
||||||
|
|
||||||
bar.name(entity.customName!!.toComponent())
|
bar.name(entity.customName!!.toComponent())
|
||||||
bar.progress((entity.health / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH)!!.value).toFloat())
|
bar.progress((entity.health / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH)!!.value).toFloat())
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.willfp.ecobosses.tick
|
||||||
|
|
||||||
|
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||||
|
|
||||||
|
class ChunkTicker : BossTicker {
|
||||||
|
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||||
|
val currentChunk = boss.chunk
|
||||||
|
|
||||||
|
if (tick % 10 != 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentChunk.isLoaded && currentChunk.isForceLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentChunk.load()
|
||||||
|
currentChunk.isForceLoaded = true
|
||||||
|
boss.forceLoadedChunks.add(currentChunk)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDeath(boss: LivingEcoBoss, tick: Int) {
|
||||||
|
boss.forceLoadedChunks.forEach { it.isForceLoaded = false }
|
||||||
|
boss.forceLoadedChunks.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import kotlin.math.ceil
|
|||||||
|
|
||||||
class DisplayNameTicker : BossTicker {
|
class DisplayNameTicker : BossTicker {
|
||||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||||
val entity = boss.entity ?: return
|
val entity = boss.entity
|
||||||
|
|
||||||
val timeLeft = ceil(
|
val timeLeft = ceil(
|
||||||
(boss.deathTime - System.currentTimeMillis()) / 1000.0
|
(boss.deathTime - System.currentTimeMillis()) / 1000.0
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class LifespanTicker : BossTicker {
|
|||||||
boss.remove()
|
boss.remove()
|
||||||
boss.boss.handleLifecycle(
|
boss.boss.handleLifecycle(
|
||||||
BossLifecycle.DESPAWN,
|
BossLifecycle.DESPAWN,
|
||||||
boss.entity?.location ?: return,
|
boss.entity.location,
|
||||||
boss.entity
|
boss.entity
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.willfp.ecobosses.bosses.LivingEcoBoss
|
|||||||
|
|
||||||
class TargetTicker : BossTicker {
|
class TargetTicker : BossTicker {
|
||||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||||
val entity = boss.entity ?: return
|
val entity = boss.entity
|
||||||
|
|
||||||
if (tick % 10 != 0) {
|
if (tick % 10 != 0) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.bukkit.block.BlockFace
|
|||||||
|
|
||||||
class TeleportHandler : BossTicker {
|
class TeleportHandler : BossTicker {
|
||||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||||
val entity = boss.entity ?: return
|
val entity = boss.entity
|
||||||
if (!boss.boss.canTeleport) {
|
if (!boss.boss.canTeleport) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.willfp.ecobosses.util
|
package com.willfp.ecobosses.util
|
||||||
|
|
||||||
|
import com.willfp.eco.util.tryAsPlayer
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin
|
import com.willfp.ecobosses.EcoBossesPlugin
|
||||||
import com.willfp.libreforge.tryAsPlayer
|
|
||||||
import org.bukkit.entity.LivingEntity
|
import org.bukkit.entity.LivingEntity
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.EventPriority
|
import org.bukkit.event.EventPriority
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent
|
import org.bukkit.event.entity.EntityDamageByEntityEvent
|
||||||
import java.util.UUID
|
import java.util.*
|
||||||
|
|
||||||
data class Damager(
|
data class Damager(
|
||||||
val uuid: UUID,
|
val uuid: UUID,
|
||||||
|
|||||||
3
eco-core/core-plugin/src/main/resources/eco.yml
Normal file
3
eco-core/core-plugin/src/main/resources/eco.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
resource-id: 525
|
||||||
|
bstats-id: 10635
|
||||||
|
color: "&9"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
name: EcoBosses
|
name: EcoBosses
|
||||||
version: ${projectVersion}
|
version: ${projectVersion}
|
||||||
main: com.willfp.ecobosses.EcoBossesPlugin
|
main: com.willfp.ecobosses.EcoBossesPlugin
|
||||||
api-version: 1.16
|
api-version: 1.17
|
||||||
authors: [Auxilor]
|
authors: [Auxilor]
|
||||||
website: willfp.com
|
website: willfp.com
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
@@ -9,13 +9,17 @@ depend:
|
|||||||
- eco
|
- eco
|
||||||
softdepend:
|
softdepend:
|
||||||
- LevelledMobs
|
- LevelledMobs
|
||||||
- EcoSkills
|
|
||||||
- AureliumSkills
|
- AureliumSkills
|
||||||
- Jobs
|
- Jobs
|
||||||
- mcMMO
|
- mcMMO
|
||||||
- Vault
|
- Vault
|
||||||
- ShopGUIPlus
|
- TMMobcoins
|
||||||
- DeluxeSellwands
|
- EcoEnchants
|
||||||
|
- Talismans
|
||||||
|
- EcoArmor
|
||||||
|
- EcoItems
|
||||||
|
- EcoSkills
|
||||||
|
- Boosters
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
ecobosses:
|
ecobosses:
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
version = 8.21.1
|
#libreforge-updater
|
||||||
|
#Sun Aug 14 17:30:33 CEST 2022
|
||||||
|
version=8.68.0
|
||||||
plugin-name=EcoBosses
|
plugin-name=EcoBosses
|
||||||
Reference in New Issue
Block a user