mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 15:09:17 +00:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e82cd59d72 | ||
|
|
6e384c248d | ||
|
|
e83cafb752 | ||
|
|
a4aa97006a | ||
|
|
3d1dce4567 | ||
|
|
45ef970521 | ||
|
|
16c9640163 | ||
|
|
8ed4dbc9d3 | ||
|
|
3805f8e2dd | ||
|
|
97e0832f7a | ||
|
|
99a3a1f4a9 | ||
|
|
87989ef899 | ||
|
|
754ab3b6fe | ||
|
|
8b0dfd4d8c | ||
|
|
bb73e2e8f7 | ||
|
|
4ab79995b3 | ||
|
|
4e3ba7321a | ||
|
|
0dbee3cead | ||
|
|
5c8cb3baf3 | ||
|
|
314d977a8b | ||
|
|
93c435be9e | ||
|
|
5293dd2095 | ||
|
|
1a9a9afab3 | ||
|
|
934de35447 | ||
|
|
909eaab967 | ||
|
|
27ddb0b97f | ||
|
|
6b0708cb5d | ||
|
|
c8bd1b379d | ||
|
|
683b3fe082 | ||
|
|
0b95669a35 | ||
|
|
f6a9493645 | ||
|
|
fb3aae24e0 | ||
|
|
9c05965b76 | ||
|
|
fdc12dda3d | ||
|
|
f79aad596f | ||
|
|
b29de7effb | ||
|
|
45725b95fe | ||
|
|
a350769ff2 | ||
|
|
9028db8309 | ||
|
|
1535ab476e | ||
|
|
908d929718 | ||
|
|
f410216ab8 | ||
|
|
26cc3be8a7 |
@@ -2,7 +2,7 @@ plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
kotlin("jvm") version "1.7.10"
|
||||
kotlin("jvm") version "1.9.20"
|
||||
id("com.github.johnrengelman.shadow") version "8.0.0"
|
||||
id("com.willfp.libreforge-gradle-plugin") version "1.0.0"
|
||||
}
|
||||
@@ -40,7 +40,7 @@ allprojects {
|
||||
dependencies {
|
||||
compileOnly("com.willfp:eco:6.56.0")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.20")
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -51,6 +51,7 @@ allprojects {
|
||||
tasks {
|
||||
shadowJar {
|
||||
relocate("com.willfp.libreforge.loader", "com.willfp.ecobosses.libreforge.loader")
|
||||
relocate("com.willfp.modelenginebridge", "com.willfp.ecobosses.modelenginebridge")
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
|
||||
@@ -4,7 +4,7 @@ version = rootProject.version
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
|
||||
compileOnly("com.github.lokka30:LevelledMobs:3.1.4")
|
||||
compileOnly("com.ticxo.modelengine:api:R3.1.6")
|
||||
implementation("com.willfp:ModelEngineBridge:1.2.0")
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
@@ -30,7 +30,9 @@ import com.willfp.libreforge.loader.LibreforgePlugin
|
||||
import com.willfp.libreforge.loader.configs.ConfigCategory
|
||||
import com.willfp.libreforge.mutators.Mutators
|
||||
import com.willfp.libreforge.registerHolderProvider
|
||||
import com.willfp.libreforge.registerSpecificHolderProvider
|
||||
import com.willfp.libreforge.triggers.Triggers
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Listener
|
||||
|
||||
class EcoBossesPlugin : LibreforgePlugin() {
|
||||
@@ -52,7 +54,9 @@ class EcoBossesPlugin : LibreforgePlugin() {
|
||||
}
|
||||
|
||||
override fun handleEnable() {
|
||||
registerHolderProvider { it.bossHolders }
|
||||
registerSpecificHolderProvider<Player> {
|
||||
it.bossHolders
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleReload() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.ticxo.modelengine.api.ModelEngineAPI
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
import com.willfp.eco.core.entities.CustomEntity
|
||||
@@ -42,6 +41,7 @@ import com.willfp.libreforge.Holder
|
||||
import com.willfp.libreforge.ViolationContext
|
||||
import com.willfp.libreforge.conditions.Conditions
|
||||
import com.willfp.libreforge.effects.Effects
|
||||
import com.willfp.modelenginebridge.ModelEngineBridge
|
||||
import net.kyori.adventure.bossbar.BossBar
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
@@ -306,8 +306,6 @@ class EcoBoss(
|
||||
|
||||
private val modelEngineID = config.getStringOrNull("model-engine-id")
|
||||
|
||||
private val modelEngineAnimation = config.getStringOrNull("model-engine-animation")
|
||||
|
||||
private val currentlyAlive = mutableMapOf<UUID, LivingEcoBoss>()
|
||||
|
||||
override val conditions = Conditions.compile(
|
||||
@@ -357,32 +355,15 @@ class EcoBoss(
|
||||
}
|
||||
|
||||
if (modelEngineID != null && Bukkit.getPluginManager().isPluginEnabled("ModelEngine")) {
|
||||
val model = ModelEngineAPI.createActiveModel(modelEngineID)
|
||||
val model = ModelEngineBridge.instance.createActiveModel(modelEngineID)
|
||||
|
||||
if (model == null) {
|
||||
plugin.logger.warning("Invalid Model Engine ID for boss $id")
|
||||
} else {
|
||||
val modelled = ModelEngineBridge.instance.createModeledEntity(mob)
|
||||
modelled.addModel(model)
|
||||
modelled.isBaseEntityVisible = false
|
||||
}
|
||||
|
||||
if (modelEngineAnimation != null) {
|
||||
val animationHandler = model.animationHandler
|
||||
val animationProperty = animationHandler.getAnimation(modelEngineAnimation)
|
||||
|
||||
if (animationProperty != null) {
|
||||
animationHandler.playAnimation(animationProperty, true)
|
||||
} else {
|
||||
plugin.logger.warning("Animation $modelEngineAnimation not found in model $modelEngineID, defaulting to walk!")
|
||||
val animationPropertyWalk = animationHandler.getAnimation("walk")
|
||||
if (animationPropertyWalk != null) {
|
||||
animationHandler.playAnimation(animationPropertyWalk, true)
|
||||
} else {
|
||||
plugin.logger.warning("Walk animation not found in $modelEngineID!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val modelled = ModelEngineAPI.createModeledEntity(mob)
|
||||
modelled.addModel(model, true)
|
||||
modelled.isBaseEntityVisible = false
|
||||
}
|
||||
|
||||
val boss = LivingEcoBoss(
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.display.DisplayPriority
|
||||
import com.willfp.eco.core.fast.fast
|
||||
import com.willfp.libreforge.SimpleProvidedHolder
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
@@ -27,7 +28,7 @@ class EggDisplay(
|
||||
val egg = itemStack.bossEgg ?: return
|
||||
|
||||
val lines = egg.spawnConditions
|
||||
.filterNot { it.isMet(player, SimpleProvidedHolder(egg)) }
|
||||
.filterNot { it.isMet(player.toDispatcher(), SimpleProvidedHolder(egg)) }
|
||||
.map { it.notMetLines.map { line -> Display.PREFIX + line } }
|
||||
.flatten()
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.bosses.EcoBoss
|
||||
import com.willfp.ecobosses.events.BossTryDropItemEvent
|
||||
import com.willfp.libreforge.effects.templates.MultiMultiplierEffect
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import org.bukkit.event.EventHandler
|
||||
|
||||
object EffectBossDropChanceMultiplier : MultiMultiplierEffect<EcoBoss>("boss_drop_chance_multiplier") {
|
||||
@@ -21,7 +22,7 @@ object EffectBossDropChanceMultiplier : MultiMultiplierEffect<EcoBoss>("boss_dro
|
||||
fun handle(event: BossTryDropItemEvent) {
|
||||
val player = event.player ?: return
|
||||
|
||||
val multiplier = getMultiplier(player, event.boss)
|
||||
val multiplier = getMultiplier(player.toDispatcher(), event.boss)
|
||||
|
||||
event.chance *= multiplier
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.willfp.ecobosses.libreforge
|
||||
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import com.willfp.libreforge.triggers.Trigger
|
||||
import com.willfp.libreforge.triggers.TriggerData
|
||||
import com.willfp.libreforge.triggers.TriggerParameter
|
||||
@@ -20,7 +21,7 @@ object TriggerKillBoss : Trigger("kill_boss") {
|
||||
val entity = event.boss.entity
|
||||
|
||||
this.dispatch(
|
||||
killer,
|
||||
killer.toDispatcher(),
|
||||
TriggerData(
|
||||
player = killer,
|
||||
victim = entity,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.willfp.ecobosses.libreforge
|
||||
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import com.willfp.libreforge.triggers.Trigger
|
||||
import com.willfp.libreforge.triggers.TriggerData
|
||||
import com.willfp.libreforge.triggers.TriggerParameter
|
||||
@@ -18,7 +19,7 @@ object TriggerSpawnBoss : Trigger("spawn_boss") {
|
||||
val location = event.location
|
||||
|
||||
this.dispatch(
|
||||
player,
|
||||
player.toDispatcher(),
|
||||
TriggerData(
|
||||
player = player,
|
||||
location = location
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.ecobosses.bosses.bossEgg
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.libreforge.SimpleProvidedHolder
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.block.Container
|
||||
@@ -79,7 +80,7 @@ class SpawnEggHandler(
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
if (!boss.spawnConditions.areMet(player, SimpleProvidedHolder(boss))) {
|
||||
if (!boss.spawnConditions.areMet(player.toDispatcher(), SimpleProvidedHolder(boss))) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.ecobosses.util.SpawnTotem
|
||||
import com.willfp.libreforge.SimpleProvidedHolder
|
||||
import com.willfp.libreforge.toDispatcher
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.block.Block
|
||||
@@ -55,7 +56,7 @@ class SpawnTotemHandler : Listener {
|
||||
|
||||
val player = event.player
|
||||
|
||||
if (!boss.spawnConditions.areMet(player, SimpleProvidedHolder(boss))) {
|
||||
if (!boss.spawnConditions.areMet(player.toDispatcher(), SimpleProvidedHolder(boss))) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
mob: illusioner attack-damage:50 health:600 hand:"iron_sword sharpness:5"
|
||||
|
||||
model-engine-id: ""
|
||||
model-engine-animation: ""
|
||||
|
||||
display-name: "&9Illusioner &7| &c%health%♥ &7| &e%time%"
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
name: ${pluginName}
|
||||
version: ${version}
|
||||
main: com.willfp.ecobosses.EcoBossesPlugin
|
||||
api-version: 1.19
|
||||
|
||||
dependencies:
|
||||
- name: eco
|
||||
required: true
|
||||
bootstrap: false
|
||||
|
||||
- name: libreforge
|
||||
required: false
|
||||
bootstrap: false
|
||||
|
||||
load-after:
|
||||
- name: eco
|
||||
bootstrap: false
|
||||
|
||||
|
||||
permissions:
|
||||
ecobosses.*:
|
||||
description: All ecobosses permissions
|
||||
default: op
|
||||
children:
|
||||
ecobosses.command.*: true
|
||||
ecobosses.command.*:
|
||||
description: All ecobosses commands
|
||||
default: op
|
||||
children:
|
||||
ecobosses.command.ecobosses: true
|
||||
ecobosses.command.reload: true
|
||||
ecobosses.command.spawn: true
|
||||
ecobosses.command.give: true
|
||||
|
||||
ecobosses.command.ecobosses:
|
||||
description: Allows the use of /ecobosses
|
||||
default: true
|
||||
|
||||
ecobosses.command.give:
|
||||
description: Allows the use of /ecobosses give
|
||||
default: op
|
||||
|
||||
ecobosses.command.spawn:
|
||||
description: Allows the use of /ecobosses spawn
|
||||
default: op
|
||||
|
||||
ecobosses.command.killall:
|
||||
description: Allows the use of /ecobosses killall
|
||||
default: op
|
||||
|
||||
ecobosses.command.reload:
|
||||
description: Allows the use of /ecobosses reload
|
||||
default: op
|
||||
@@ -1,5 +1,5 @@
|
||||
#libreforge-updater
|
||||
#Thu Jul 27 15:18:31 BST 2023
|
||||
#Wed Dec 20 15:56:34 GMT 2023
|
||||
kotlin.code.style=official
|
||||
libreforge-version=4.25.4
|
||||
version=9.24.4
|
||||
libreforge-version=4.50.0
|
||||
version=9.49.0
|
||||
|
||||
Reference in New Issue
Block a user