mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 23:19:17 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d47b4b9567 | ||
|
|
613632e7a9 | ||
|
|
b8d8d4999f | ||
|
|
aa7000b2aa | ||
|
|
afe6b34c65 | ||
|
|
c9173c06da | ||
|
|
57a4f1a708 | ||
|
|
f031fb51c6 | ||
|
|
8745ee5425 | ||
|
|
428f022d97 | ||
|
|
f17eb06b03 | ||
|
|
e4a805c627 | ||
|
|
ce24ea4cf4 | ||
|
|
47e9ff13dc |
@@ -4,6 +4,7 @@ import com.willfp.eco.core.command.impl.PluginCommand
|
|||||||
import com.willfp.eco.core.display.DisplayModule
|
import com.willfp.eco.core.display.DisplayModule
|
||||||
import com.willfp.eco.core.entities.ai.EntityGoals
|
import com.willfp.eco.core.entities.ai.EntityGoals
|
||||||
import com.willfp.eco.core.integrations.IntegrationLoader
|
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||||
|
import com.willfp.eco.util.toSingletonList
|
||||||
import com.willfp.ecomobs.category.MobCategories
|
import com.willfp.ecomobs.category.MobCategories
|
||||||
import com.willfp.ecomobs.category.spawning.spawnpoints.SpawnPointGenerator
|
import com.willfp.ecomobs.category.spawning.spawnpoints.SpawnPointGenerator
|
||||||
import com.willfp.ecomobs.commands.CommandEcoMobs
|
import com.willfp.ecomobs.commands.CommandEcoMobs
|
||||||
@@ -19,8 +20,13 @@ import com.willfp.ecomobs.integrations.libsdisguises.IntegrationLibsDisguises
|
|||||||
import com.willfp.ecomobs.integrations.modelengine.IntegrationModelEngine
|
import com.willfp.ecomobs.integrations.modelengine.IntegrationModelEngine
|
||||||
import com.willfp.ecomobs.mob.EcoMobs
|
import com.willfp.ecomobs.mob.EcoMobs
|
||||||
import com.willfp.ecomobs.mob.damage.TopDamagerHandler
|
import com.willfp.ecomobs.mob.damage.TopDamagerHandler
|
||||||
|
import com.willfp.ecomobs.mob.impl.ecoMob
|
||||||
|
import com.willfp.libreforge.EmptyProvidedHolder.holder
|
||||||
|
import com.willfp.libreforge.EntityProvidedHolder
|
||||||
import com.willfp.libreforge.loader.LibreforgePlugin
|
import com.willfp.libreforge.loader.LibreforgePlugin
|
||||||
import com.willfp.libreforge.loader.configs.ConfigCategory
|
import com.willfp.libreforge.loader.configs.ConfigCategory
|
||||||
|
import com.willfp.libreforge.registerSpecificHolderProvider
|
||||||
|
import org.bukkit.entity.Mob
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
internal lateinit var plugin: EcoMobsPlugin
|
internal lateinit var plugin: EcoMobsPlugin
|
||||||
@@ -34,6 +40,14 @@ class EcoMobsPlugin : LibreforgePlugin() {
|
|||||||
plugin = this
|
plugin = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun handleEnable() {
|
||||||
|
registerSpecificHolderProvider<Mob> {
|
||||||
|
it.ecoMob?.entityHolder.toSingletonList().map { holder ->
|
||||||
|
EntityProvidedHolder(holder, it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun handleLoad() {
|
override fun handleLoad() {
|
||||||
EntityGoals.register(EntityGoalRandomTeleport.Deserializer)
|
EntityGoals.register(EntityGoalRandomTeleport.Deserializer)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.willfp.ecomobs.category.MobCategory
|
|||||||
import com.willfp.ecomobs.integrations.MobIntegration
|
import com.willfp.ecomobs.integrations.MobIntegration
|
||||||
import com.willfp.ecomobs.mob.event.MobEvent
|
import com.willfp.ecomobs.mob.event.MobEvent
|
||||||
import com.willfp.ecomobs.mob.options.SpawnEgg
|
import com.willfp.ecomobs.mob.options.SpawnEgg
|
||||||
|
import com.willfp.libreforge.Holder
|
||||||
import com.willfp.libreforge.triggers.DispatchedTrigger
|
import com.willfp.libreforge.triggers.DispatchedTrigger
|
||||||
import org.bukkit.Location
|
import org.bukkit.Location
|
||||||
import org.bukkit.entity.Mob
|
import org.bukkit.entity.Mob
|
||||||
@@ -50,6 +51,11 @@ interface EcoMob : KRegistrable {
|
|||||||
*/
|
*/
|
||||||
val customEntity: CustomEntity
|
val customEntity: CustomEntity
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The entity holder.
|
||||||
|
*/
|
||||||
|
val entityHolder: Holder
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a living mob from a bukkit mob.
|
* Get a living mob from a bukkit mob.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.willfp.ecomobs.mob.damage
|
package com.willfp.ecomobs.mob.damage
|
||||||
|
|
||||||
import com.willfp.eco.util.savedDisplayName
|
import com.willfp.eco.util.savedDisplayName
|
||||||
|
import com.willfp.eco.util.toNiceString
|
||||||
import com.willfp.eco.util.tryAsPlayer
|
import com.willfp.eco.util.tryAsPlayer
|
||||||
import com.willfp.ecomobs.EcoMobsPlugin
|
import com.willfp.ecomobs.EcoMobsPlugin
|
||||||
import com.willfp.libreforge.NamedValue
|
import com.willfp.libreforge.NamedValue
|
||||||
@@ -62,7 +63,7 @@ class TopDamagerHandler(
|
|||||||
),
|
),
|
||||||
NamedValue(
|
NamedValue(
|
||||||
"top_damager_${index + 1}_damage",
|
"top_damager_${index + 1}_damage",
|
||||||
damager.damage.toString()
|
damager.damage.toNiceString()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,14 +49,19 @@ import com.willfp.ecomobs.tick.TickHandlerBossBar
|
|||||||
import com.willfp.ecomobs.tick.TickHandlerDisplayName
|
import com.willfp.ecomobs.tick.TickHandlerDisplayName
|
||||||
import com.willfp.ecomobs.tick.TickHandlerLifespan
|
import com.willfp.ecomobs.tick.TickHandlerLifespan
|
||||||
import com.willfp.libreforge.ConfigViolation
|
import com.willfp.libreforge.ConfigViolation
|
||||||
|
import com.willfp.libreforge.Holder
|
||||||
import com.willfp.libreforge.ViolationContext
|
import com.willfp.libreforge.ViolationContext
|
||||||
|
import com.willfp.libreforge.conditions.ConditionList
|
||||||
import com.willfp.libreforge.conditions.Conditions
|
import com.willfp.libreforge.conditions.Conditions
|
||||||
|
import com.willfp.libreforge.conditions.emptyConditionList
|
||||||
|
import com.willfp.libreforge.effects.EffectList
|
||||||
import com.willfp.libreforge.effects.Effects
|
import com.willfp.libreforge.effects.Effects
|
||||||
import com.willfp.libreforge.enumValueOfOrNull
|
import com.willfp.libreforge.enumValueOfOrNull
|
||||||
import com.willfp.libreforge.triggers.DispatchedTrigger
|
import com.willfp.libreforge.triggers.DispatchedTrigger
|
||||||
import net.kyori.adventure.bossbar.BossBar
|
import net.kyori.adventure.bossbar.BossBar
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.Location
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.NamespacedKey
|
||||||
import org.bukkit.entity.Mob
|
import org.bukkit.entity.Mob
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent
|
import org.bukkit.event.entity.CreatureSpawnEvent
|
||||||
@@ -311,6 +316,17 @@ internal class ConfigDrivenEcoMob(
|
|||||||
this.spawn(it, SpawnReason.COMMAND)!!.entity
|
this.spawn(it, SpawnReason.COMMAND)!!.entity
|
||||||
}.apply { register() }
|
}.apply { register() }
|
||||||
|
|
||||||
|
override val entityHolder = object : Holder {
|
||||||
|
override val id = plugin.createNamespacedKey(getID())
|
||||||
|
|
||||||
|
override val effects: EffectList = Effects.compile(
|
||||||
|
config.getSubsections("effects.permanent-effects"),
|
||||||
|
context.with("effects").with("permanent effects")
|
||||||
|
)
|
||||||
|
|
||||||
|
override val conditions = emptyConditionList()
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------
|
----------
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -52,43 +52,67 @@ custom-ai:
|
|||||||
# How the mob should behave.
|
# How the mob should behave.
|
||||||
entity-goals: [ ]
|
entity-goals: [ ]
|
||||||
|
|
||||||
# Effects are done from the player's perspective: to treat the player as the victim,
|
# Some effects are ran from the perspective of the entity, and others from the perspective
|
||||||
# either use self_as_victim in args, or use player_as_victim in mutators.
|
# of the player - each section is marked with which perspective it is run from.
|
||||||
|
|
||||||
# You can use display name placeholders in effects
|
# You can use display name placeholders in effects
|
||||||
# You can also use top damager placeholders:
|
# You can also use top damager placeholders:
|
||||||
# %top_damager_<place>_name%, %top_damager_<place>_damage%, %top_damager_<place>_display%
|
# %top_damager_<place>_name%, %top_damager_<place>_damage%, %top_damager_<place>_display%
|
||||||
effects:
|
effects:
|
||||||
|
# Effects that are active all the time
|
||||||
|
# Ran from the perspective of the entity
|
||||||
|
permanent-effects: [ ]
|
||||||
|
|
||||||
# Effects ran when the mob spawns
|
# Effects ran when the mob spawns
|
||||||
|
# Ran from the perspective of the entity
|
||||||
spawn: [ ]
|
spawn: [ ]
|
||||||
|
|
||||||
# Effects ran when the mob despawns
|
# Effects ran when the mob despawns
|
||||||
|
# Ran from the perspective of the entity
|
||||||
despawn: [ ]
|
despawn: [ ]
|
||||||
|
|
||||||
# Effects ran when the player interacts with the mob
|
# Effects ran when the player interacts with the mob
|
||||||
|
# Ran from the perspective of the player
|
||||||
interact: [ ]
|
interact: [ ]
|
||||||
|
|
||||||
# Effects ran when the player melee attacks the mob
|
# Effects ran when the player melee attacks the mob
|
||||||
|
# Ran from the perspective of the player
|
||||||
melee-attack: [ ]
|
melee-attack: [ ]
|
||||||
|
|
||||||
# Effects ran when the player does a ranged attack on the mob
|
# Effects ran when the player does a ranged attack on the mob
|
||||||
|
# Ran from the perspective of the player
|
||||||
ranged-attack: [ ]
|
ranged-attack: [ ]
|
||||||
|
|
||||||
# Effects ran when the player attacks the mob
|
# Effects ran when the player attacks the mob
|
||||||
|
# Ran from the perspective of the player
|
||||||
any-attack: [ ]
|
any-attack: [ ]
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# Effects ran when the mob takes damage
|
# Effects ran when the mob takes damage
|
||||||
|
# Ran from the perspective of the entity
|
||||||
take-damage: [ ]
|
take-damage: [ ]
|
||||||
|
|
||||||
# Effects ran when the player is damaged by the mob
|
# Effects ran when the player is damaged by the mob
|
||||||
|
=======
|
||||||
|
# Effects ran when the mob takes damage
|
||||||
|
# Ran from the perspective of the entity
|
||||||
|
take-damage: [ ]
|
||||||
|
|
||||||
|
# Effects ran when the player is damaged by the mob
|
||||||
|
>>>>>>> f031fb51c6a3787bc44e8bc099d3655e74366f70
|
||||||
|
# Ran from the perspective of the player
|
||||||
damage-player: [ ]
|
damage-player: [ ]
|
||||||
|
|
||||||
# Effects ran when the player is killed by the mob
|
# Effects ran when the player is killed by the mob
|
||||||
|
# Ran from the perspective of the player
|
||||||
kill-player: [ ]
|
kill-player: [ ]
|
||||||
|
|
||||||
# Effects ran when the mob dies
|
# Effects ran when the mob dies
|
||||||
|
# Ran from the perspective of the entity
|
||||||
death: [ ]
|
death: [ ]
|
||||||
|
|
||||||
# Effects ran when the mob is killed by the player
|
# Effects ran when the mob is killed by the player
|
||||||
|
# Ran from the perspective of the player
|
||||||
kill: [ ]
|
kill: [ ]
|
||||||
|
|
||||||
# The lifespan of the mob, in seconds. Set to -1 to disable.
|
# The lifespan of the mob, in seconds. Set to -1 to disable.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#libreforge-updater
|
#libreforge-updater
|
||||||
#Mon Jan 01 20:02:24 GMT 2024
|
#Thu Feb 08 19:50:40 GMT 2024
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libreforge-version=4.52.0
|
libreforge-version=4.56.0
|
||||||
version=10.0.0-b3
|
version=10.1.0
|
||||||
|
|||||||
Reference in New Issue
Block a user