Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19b52eaaa7 | ||
|
|
e9f33fd298 | ||
|
|
fc66efff53 | ||
|
|
1409620b92 | ||
|
|
f1acc877b7 | ||
|
|
d7e725822c | ||
|
|
d613e569ed | ||
|
|
22274a9bdf | ||
|
|
2ef337d4ca | ||
|
|
aacd247c54 | ||
|
|
1aa419bce7 | ||
|
|
56f948e898 | ||
|
|
d92472c0a4 | ||
|
|
7de03c1459 | ||
|
|
9109e11791 | ||
|
|
a0381e113c | ||
|
|
2d6128eca9 | ||
|
|
985608791b | ||
|
|
dd65bfa58d | ||
|
|
a61cce53c1 | ||
|
|
e7cc186e9c | ||
|
|
7fb3df354d | ||
|
|
971c643203 | ||
|
|
b2381c33fe | ||
|
|
0642ff1421 | ||
|
|
7dc5caec57 | ||
|
|
b006ebab53 | ||
|
|
3bd774265d | ||
|
|
0ff6d68a5b | ||
|
|
a27ebb1b5c | ||
|
|
afafd86eaf | ||
|
|
49a2713017 | ||
|
|
a4263e8397 | ||
|
|
17f3aa8862 | ||
|
|
c94024ea19 | ||
|
|
1daa52e1f4 | ||
|
|
a06808f802 | ||
|
|
91cf08f0ac | ||
|
|
9a7ff1760c | ||
|
|
f2c3f569b7 | ||
|
|
508cb3e216 | ||
|
|
5f998f4bad | ||
|
|
e4b468b0da | ||
|
|
675d2b8508 | ||
|
|
edddd67f58 | ||
|
|
ed676e50c7 | ||
|
|
b36551a179 | ||
|
|
053f22258a | ||
|
|
a3a0783ea2 | ||
|
|
c7f25f17cd | ||
|
|
a489aaa53a | ||
|
|
9e9a68fc45 | ||
|
|
53b24b9dbb | ||
|
|
4977dc1012 | ||
|
|
0bb4aa6d51 | ||
|
|
5b1eda604d | ||
|
|
10e9edc011 | ||
|
|
ec11e9c475 | ||
|
|
eebe7427bc | ||
|
|
d2fa50a08c | ||
|
|
9fb80c594a | ||
|
|
915778d63f | ||
|
|
44911d5f97 | ||
|
|
11a79a5352 | ||
|
|
9473deda7c | ||
|
|
44676515b2 | ||
|
|
4e7317e69a | ||
|
|
8ca8018ab2 | ||
|
|
78e033990b | ||
|
|
033ac785d6 | ||
|
|
6ddf34f7f6 | ||
|
|
fb889b2936 | ||
|
|
dcf89687e3 | ||
|
|
2835eeaa5d | ||
|
|
1647a5dfaf | ||
|
|
3d260e82ae | ||
|
|
1fdbd064a9 | ||
|
|
94d1802b51 | ||
|
|
8604bf7b46 | ||
|
|
c21eecae11 | ||
|
|
80950aecf3 | ||
|
|
6ad33e98fc | ||
|
|
c60c64c6b3 | ||
|
|
9eb67d5204 | ||
|
|
77f08961b8 | ||
|
|
be4c70e0c5 | ||
|
|
614831687f | ||
|
|
3ea5d8f4d3 | ||
|
|
2e472abc98 | ||
|
|
927c1fbcae | ||
|
|
7e6b5c4b80 |
@@ -21,7 +21,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://discord.gg/ZcwpSsE/)
|
[](https://discord.gg/ZcwpSsE/)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
*Click here to read [the entire license](https://github.com/Auxilor/EcoPets/blob/master/LICENSE.md).*
|
*Click here to read [the entire license](https://github.com/Auxilor/EcoPets/blob/master/LICENSE.md).*
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ allprojects {
|
|||||||
maven { url 'https://repo.codemc.io/repository/maven-public/' }
|
maven { url 'https://repo.codemc.io/repository/maven-public/' }
|
||||||
maven { url 'https://repo.dmulloy2.net/repository/public/' }
|
maven { url 'https://repo.dmulloy2.net/repository/public/' }
|
||||||
maven { url 'https://repo.essentialsx.net/releases/' }
|
maven { url 'https://repo.essentialsx.net/releases/' }
|
||||||
|
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@@ -47,12 +48,12 @@ allprojects {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'com.willfp:eco:6.37.1'
|
compileOnly 'com.willfp:eco:6.37.1'
|
||||||
implementation 'com.willfp:libreforge:3.64.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'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
|
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ dependencies {
|
|||||||
compileOnly 'net.kyori:adventure-api:4.10.1'
|
compileOnly 'net.kyori:adventure-api:4.10.1'
|
||||||
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
||||||
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
||||||
|
compileOnly 'com.ticxo.modelengine:api:R2.5.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn publishToMavenLocal
|
build.dependsOn publishToMavenLocal
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
package com.willfp.ecopets
|
package com.willfp.ecopets
|
||||||
|
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand
|
import com.willfp.eco.core.command.impl.PluginCommand
|
||||||
|
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||||
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
||||||
import com.willfp.eco.util.toSingletonList
|
import com.willfp.eco.util.toSingletonList
|
||||||
import com.willfp.ecopets.commands.CommandEcopets
|
import com.willfp.ecopets.commands.CommandEcopets
|
||||||
import com.willfp.ecopets.commands.CommandPets
|
import com.willfp.ecopets.commands.CommandPets
|
||||||
import com.willfp.ecopets.config.PetsYml
|
import com.willfp.ecopets.config.PetsYml
|
||||||
|
import com.willfp.ecopets.pets.DiscoverRecipeListener
|
||||||
import com.willfp.ecopets.pets.PetDisplay
|
import com.willfp.ecopets.pets.PetDisplay
|
||||||
import com.willfp.ecopets.pets.PetLevelListener
|
import com.willfp.ecopets.pets.PetLevelListener
|
||||||
import com.willfp.ecopets.pets.PetTriggerXPGainListener
|
import com.willfp.ecopets.pets.PetTriggerXPGainListener
|
||||||
import com.willfp.ecopets.pets.SpawnEggHandler
|
import com.willfp.ecopets.pets.SpawnEggHandler
|
||||||
import com.willfp.ecopets.pets.activePet
|
import com.willfp.ecopets.pets.activePet
|
||||||
import com.willfp.ecopets.pets.activePetLevel
|
import com.willfp.ecopets.pets.activePetLevel
|
||||||
|
import com.willfp.ecopets.pets.entity.ModelEnginePetEntity
|
||||||
|
import com.willfp.ecopets.pets.entity.PetEntity
|
||||||
import com.willfp.libreforge.LibReforgePlugin
|
import com.willfp.libreforge.LibReforgePlugin
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
@@ -48,6 +52,16 @@ class EcoPetsPlugin : LibReforgePlugin() {
|
|||||||
petDisplay.shutdown()
|
petDisplay.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun loadAdditionalIntegrations(): List<IntegrationLoader> {
|
||||||
|
return listOf(
|
||||||
|
IntegrationLoader("ModelEngine") {
|
||||||
|
PetEntity.registerPetEntity("modelengine") { pet, id ->
|
||||||
|
ModelEnginePetEntity(pet, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override fun loadPluginCommands(): List<PluginCommand> {
|
override fun loadPluginCommands(): List<PluginCommand> {
|
||||||
return listOf(
|
return listOf(
|
||||||
CommandEcopets(this),
|
CommandEcopets(this),
|
||||||
@@ -60,7 +74,8 @@ class EcoPetsPlugin : LibReforgePlugin() {
|
|||||||
PetLevelListener(this),
|
PetLevelListener(this),
|
||||||
PetTriggerXPGainListener,
|
PetTriggerXPGainListener,
|
||||||
SpawnEggHandler(this),
|
SpawnEggHandler(this),
|
||||||
petDisplay
|
petDisplay,
|
||||||
|
DiscoverRecipeListener(this)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.willfp.ecopets.pets
|
||||||
|
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import org.bukkit.Bukkit
|
||||||
|
import org.bukkit.Keyed
|
||||||
|
import org.bukkit.event.EventHandler
|
||||||
|
import org.bukkit.event.Listener
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent
|
||||||
|
import org.bukkit.inventory.Recipe
|
||||||
|
|
||||||
|
class DiscoverRecipeListener(private val plugin: EcoPlugin) : Listener {
|
||||||
|
@EventHandler
|
||||||
|
fun onJoin(event: PlayerJoinEvent) {
|
||||||
|
if (!plugin.configYml.getBool("discover-recipes")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mutableListOf<Recipe>()
|
||||||
|
.apply { Bukkit.getServer().recipeIterator().forEachRemaining(this::add) }
|
||||||
|
.filterIsInstance<Keyed>().map { it.key }
|
||||||
|
.filter { it.namespace == plugin.name.lowercase() }
|
||||||
|
.filter { !it.key.contains("displayed") }
|
||||||
|
.forEach { event.player.discoverRecipe(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,6 @@ import com.willfp.eco.core.fast.fast
|
|||||||
import com.willfp.eco.core.items.CustomItem
|
import com.willfp.eco.core.items.CustomItem
|
||||||
import com.willfp.eco.core.items.Items
|
import com.willfp.eco.core.items.Items
|
||||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||||
import com.willfp.eco.core.items.builder.SkullBuilder
|
|
||||||
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
||||||
import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
|
||||||
import com.willfp.eco.core.placeholder.PlayerlessPlaceholder
|
import com.willfp.eco.core.placeholder.PlayerlessPlaceholder
|
||||||
@@ -21,6 +20,7 @@ import com.willfp.eco.util.toNiceString
|
|||||||
import com.willfp.ecopets.EcoPetsPlugin
|
import com.willfp.ecopets.EcoPetsPlugin
|
||||||
import com.willfp.ecopets.api.event.PlayerPetExpGainEvent
|
import com.willfp.ecopets.api.event.PlayerPetExpGainEvent
|
||||||
import com.willfp.ecopets.api.event.PlayerPetLevelUpEvent
|
import com.willfp.ecopets.api.event.PlayerPetLevelUpEvent
|
||||||
|
import com.willfp.ecopets.pets.entity.PetEntity
|
||||||
import com.willfp.libreforge.conditions.Conditions
|
import com.willfp.libreforge.conditions.Conditions
|
||||||
import com.willfp.libreforge.conditions.ConfiguredCondition
|
import com.willfp.libreforge.conditions.ConfiguredCondition
|
||||||
import com.willfp.libreforge.effects.ConfiguredEffect
|
import com.willfp.libreforge.effects.ConfiguredEffect
|
||||||
@@ -107,14 +107,12 @@ class Pet(
|
|||||||
"${this.id}_spawn_egg",
|
"${this.id}_spawn_egg",
|
||||||
egg,
|
egg,
|
||||||
config.getStrings("spawn-egg.recipe"),
|
config.getStrings("spawn-egg.recipe"),
|
||||||
config.getString("spawn-egg.recipe-permission")
|
config.getStringOrNull("spawn-egg.recipe-permission")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val petEntityItem: ItemStack = SkullBuilder()
|
val entityTexture = config.getString("entity-texture")
|
||||||
.setSkullTexture(config.getString("entity-texture"))
|
|
||||||
.build()
|
|
||||||
|
|
||||||
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")
|
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")
|
||||||
|
|
||||||
@@ -153,12 +151,16 @@ class Pet(
|
|||||||
private val petXpGains = config.getSubsections("xp-gain-methods").mapNotNull {
|
private val petXpGains = config.getSubsections("xp-gain-methods").mapNotNull {
|
||||||
val trigger = Triggers.getById(it.getString("id")) ?: return@mapNotNull null
|
val trigger = Triggers.getById(it.getString("id")) ?: return@mapNotNull null
|
||||||
val multiplier = it.getDouble("multiplier")
|
val multiplier = it.getDouble("multiplier")
|
||||||
|
val conditions = it.getSubsections("conditions")
|
||||||
|
.mapNotNull { cfg -> Conditions.compile(cfg, "Pet $id XP Gain methods") }
|
||||||
|
|
||||||
PetXPGain(
|
trigger to PetXPGain(
|
||||||
trigger,
|
trigger,
|
||||||
multiplier
|
multiplier,
|
||||||
|
conditions,
|
||||||
|
it.getSubsection("filters")
|
||||||
)
|
)
|
||||||
}
|
}.toMap()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
config.injectPlaceholders(
|
config.injectPlaceholders(
|
||||||
@@ -239,6 +241,10 @@ class Pet(
|
|||||||
}.register()
|
}.register()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun makePetEntity(): PetEntity {
|
||||||
|
return PetEntity.create(this)
|
||||||
|
}
|
||||||
|
|
||||||
fun getLevel(level: Int): PetLevel = levels.get(level) {
|
fun getLevel(level: Int): PetLevel = levels.get(level) {
|
||||||
PetLevel(this, it, effects, conditions)
|
PetLevel(this, it, effects, conditions)
|
||||||
}
|
}
|
||||||
@@ -396,12 +402,8 @@ class Pet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun canGainXPFromTrigger(trigger: Trigger): Boolean {
|
fun getPetXPGain(trigger: Trigger): PetXPGain? {
|
||||||
return petXpGains.any { it.trigger == trigger }
|
return petXpGains[trigger]
|
||||||
}
|
|
||||||
|
|
||||||
fun getTriggerXPMultiplier(trigger: Trigger): Double {
|
|
||||||
return petXpGains.firstOrNull { it.trigger == trigger }?.multiplier ?: 1.0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|||||||
@@ -6,23 +6,20 @@ import com.willfp.eco.util.formatEco
|
|||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.Location
|
import org.bukkit.Location
|
||||||
import org.bukkit.entity.ArmorStand
|
import org.bukkit.entity.ArmorStand
|
||||||
import org.bukkit.entity.EntityType
|
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
import org.bukkit.event.player.PlayerQuitEvent
|
import org.bukkit.event.player.PlayerQuitEvent
|
||||||
import org.bukkit.inventory.EquipmentSlot
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.sin
|
|
||||||
|
|
||||||
class PetDisplay(
|
class PetDisplay(
|
||||||
private val plugin: EcoPlugin
|
private val plugin: EcoPlugin
|
||||||
) : Listener {
|
) : Listener {
|
||||||
private var tick = 0
|
private var tick = 0
|
||||||
|
|
||||||
private val trackedEntities = mutableMapOf<UUID, ArmorStand>()
|
private val trackedEntities = mutableMapOf<UUID, PetArmorStand>()
|
||||||
|
|
||||||
fun tickAll() {
|
fun tickAll() {
|
||||||
for (player in Bukkit.getOnlinePlayers()) {
|
for (player in Bukkit.getOnlinePlayers()) {
|
||||||
@@ -37,7 +34,6 @@ class PetDisplay(
|
|||||||
val pet = player.activePet
|
val pet = player.activePet
|
||||||
|
|
||||||
if (pet != null) {
|
if (pet != null) {
|
||||||
stand.equipment?.helmet = pet.petEntityItem
|
|
||||||
stand.customName = plugin.configYml.getString("pet-entity.name")
|
stand.customName = plugin.configYml.getString("pet-entity.name")
|
||||||
.replace("%player%", player.displayName)
|
.replace("%player%", player.displayName)
|
||||||
.replace("%pet%", pet.name)
|
.replace("%pet%", pet.name)
|
||||||
@@ -48,23 +44,45 @@ class PetDisplay(
|
|||||||
|
|
||||||
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
||||||
|
|
||||||
|
try {
|
||||||
stand.teleport(location)
|
stand.teleport(location)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pet.entityTexture.contains(":")) {
|
||||||
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getLocation(player: Player): Location {
|
private fun getLocation(player: Player): Location {
|
||||||
val offset = player.eyeLocation.direction.clone().normalize()
|
val offset = player.eyeLocation.direction.clone().normalize()
|
||||||
.multiply(-1)
|
.multiply(-1)
|
||||||
.apply { y = abs(y) }
|
.apply {
|
||||||
|
y = abs(y)
|
||||||
|
|
||||||
|
if (abs(x) < 0.5) {
|
||||||
|
x = 0.5
|
||||||
|
}
|
||||||
|
|
||||||
|
if (abs(z) < 0.5) {
|
||||||
|
z = 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
.rotateAroundY(PI / 6)
|
.rotateAroundY(PI / 6)
|
||||||
|
|
||||||
return player.eyeLocation.clone().add(offset)
|
return player.eyeLocation.clone().add(offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getOrNew(player: Player): ArmorStand? {
|
private fun getOrNew(player: Player): ArmorStand? {
|
||||||
val existing = trackedEntities[player.uniqueId]
|
val tracked = trackedEntities[player.uniqueId]
|
||||||
|
val existing = tracked?.stand
|
||||||
|
|
||||||
val pet = player.activePet
|
val pet = player.activePet
|
||||||
|
if (pet != tracked?.pet) {
|
||||||
|
tracked?.stand?.remove()
|
||||||
|
}
|
||||||
|
|
||||||
if (existing == null || existing.isDead || pet == null) {
|
if (existing == null || existing.isDead || pet == null) {
|
||||||
existing?.remove()
|
existing?.remove()
|
||||||
@@ -75,32 +93,17 @@ class PetDisplay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val location = getLocation(player)
|
val location = getLocation(player)
|
||||||
val newStand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
val stand = pet.makePetEntity().spawn(location)
|
||||||
newStand.isVisible = false
|
|
||||||
newStand.isInvulnerable = true
|
|
||||||
newStand.isPersistent = true
|
|
||||||
newStand.removeWhenFarAway = false
|
|
||||||
newStand.isSmall = true
|
|
||||||
newStand.setGravity(false)
|
|
||||||
newStand.isCollidable = false
|
|
||||||
|
|
||||||
for (slot in EquipmentSlot.values()) {
|
trackedEntities[player.uniqueId] = PetArmorStand(stand, pet)
|
||||||
newStand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newStand.equipment?.helmet = pet.petEntityItem
|
return trackedEntities[player.uniqueId]?.stand
|
||||||
newStand.isCustomNameVisible = true
|
|
||||||
newStand.customName = pet.name
|
|
||||||
|
|
||||||
trackedEntities[player.uniqueId] = newStand
|
|
||||||
}
|
|
||||||
|
|
||||||
return trackedEntities[player.uniqueId]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shutdown() {
|
fun shutdown() {
|
||||||
for (stand in trackedEntities.values) {
|
for (stand in trackedEntities.values) {
|
||||||
stand.remove()
|
stand.stand.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
trackedEntities.clear()
|
trackedEntities.clear()
|
||||||
@@ -108,7 +111,12 @@ class PetDisplay(
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
fun onLeave(event: PlayerQuitEvent) {
|
fun onLeave(event: PlayerQuitEvent) {
|
||||||
trackedEntities[event.player.uniqueId]?.remove()
|
trackedEntities[event.player.uniqueId]?.stand?.remove()
|
||||||
trackedEntities.remove(event.player.uniqueId)
|
trackedEntities.remove(event.player.uniqueId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class PetArmorStand(
|
||||||
|
val stand: ArmorStand,
|
||||||
|
val pet: Pet
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
package com.willfp.ecopets.pets
|
package com.willfp.ecopets.pets
|
||||||
|
|
||||||
|
import com.willfp.eco.core.config.interfaces.Config
|
||||||
|
import com.willfp.libreforge.conditions.ConfiguredCondition
|
||||||
import com.willfp.libreforge.events.TriggerPreProcessEvent
|
import com.willfp.libreforge.events.TriggerPreProcessEvent
|
||||||
|
import com.willfp.libreforge.filters.ConfiguredFilter
|
||||||
import com.willfp.libreforge.triggers.Trigger
|
import com.willfp.libreforge.triggers.Trigger
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
data class PetXPGain(
|
data class PetXPGain(
|
||||||
val trigger: Trigger,
|
val trigger: Trigger,
|
||||||
val multiplier: Double
|
val multiplier: Double,
|
||||||
|
val conditions: Iterable<ConfiguredCondition>,
|
||||||
|
val filters: Config
|
||||||
)
|
)
|
||||||
|
|
||||||
object PetTriggerXPGainListener : Listener {
|
object PetTriggerXPGainListener : Listener {
|
||||||
@@ -16,14 +21,23 @@ object PetTriggerXPGainListener: Listener {
|
|||||||
val player = event.player
|
val player = event.player
|
||||||
val trigger = event.trigger
|
val trigger = event.trigger
|
||||||
val value = event.value
|
val value = event.value
|
||||||
|
val data = event.data
|
||||||
|
|
||||||
val pet = event.player.activePet ?: return
|
val pet = event.player.activePet ?: return
|
||||||
|
|
||||||
if (pet.canGainXPFromTrigger(trigger)) {
|
val xpGain = pet.getPetXPGain(trigger) ?: return
|
||||||
|
|
||||||
|
if (xpGain.conditions.any { !it.isMet(player) }) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ConfiguredFilter(xpGain.filters).matches(data)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
player.givePetExperience(
|
player.givePetExperience(
|
||||||
pet,
|
pet,
|
||||||
value * pet.getTriggerXPMultiplier(trigger)
|
value * xpGain.multiplier
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.bukkit.Material
|
|||||||
import org.bukkit.Sound
|
import org.bukkit.Sound
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import org.checkerframework.checker.units.qual.m
|
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
@@ -42,8 +41,8 @@ object PetsGUI {
|
|||||||
val bottomRightColumn = plugin.configYml.getInt("gui.pet-area.bottom-right.column")
|
val bottomRightColumn = plugin.configYml.getInt("gui.pet-area.bottom-right.column")
|
||||||
|
|
||||||
petAreaSlots.clear()
|
petAreaSlots.clear()
|
||||||
for (column in topLeftColumn..bottomRightColumn) {
|
|
||||||
for (row in topLeftRow..bottomRightRow) {
|
for (row in topLeftRow..bottomRightRow) {
|
||||||
|
for (column in topLeftColumn..bottomRightColumn) {
|
||||||
petAreaSlots.add(Pair(row, column))
|
petAreaSlots.add(Pair(row, column))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.ticxo.modelengine.api.ModelEngineAPI
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
|
||||||
|
class ModelEnginePetEntity(
|
||||||
|
pet: Pet,
|
||||||
|
private val modelID: String
|
||||||
|
) : PetEntity(pet) {
|
||||||
|
override fun spawn(location: Location): ArmorStand {
|
||||||
|
val stand = emptyArmorStandAt(location, pet)
|
||||||
|
|
||||||
|
val model = ModelEngineAPI.createActiveModel(modelID)
|
||||||
|
val modelled = ModelEngineAPI.createModeledEntity(stand)
|
||||||
|
modelled.addActiveModel(model)
|
||||||
|
|
||||||
|
// ModelEngine removed addActiveModel in new API release... for no reason.
|
||||||
|
//modelled.addModel(model,true)
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
import org.bukkit.entity.EntityType
|
||||||
|
import org.bukkit.inventory.EquipmentSlot
|
||||||
|
|
||||||
|
abstract class PetEntity(
|
||||||
|
val pet: Pet
|
||||||
|
) {
|
||||||
|
abstract fun spawn(location: Location): ArmorStand
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val registrations = mutableMapOf<String, (Pet, String) -> PetEntity>()
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun registerPetEntity(id: String, parse: (Pet, String) -> PetEntity) {
|
||||||
|
registrations[id] = parse
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun create(pet: Pet): PetEntity {
|
||||||
|
val texture = pet.entityTexture
|
||||||
|
|
||||||
|
if (!texture.contains(":")) {
|
||||||
|
return SkullPetEntity(pet)
|
||||||
|
}
|
||||||
|
|
||||||
|
val id = texture.split(":")[0]
|
||||||
|
val parse = registrations[id] ?: return SkullPetEntity(pet)
|
||||||
|
return parse(pet, texture.removePrefix("$id:"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun emptyArmorStandAt(location: Location, pet: Pet): ArmorStand {
|
||||||
|
val stand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
||||||
|
|
||||||
|
stand.isVisible = false
|
||||||
|
stand.isInvulnerable = true
|
||||||
|
stand.isSmall = true
|
||||||
|
stand.setGravity(false)
|
||||||
|
stand.isCollidable = false
|
||||||
|
stand.isPersistent = false
|
||||||
|
|
||||||
|
for (slot in EquipmentSlot.values()) {
|
||||||
|
stand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
||||||
|
}
|
||||||
|
|
||||||
|
stand.isCustomNameVisible = true
|
||||||
|
stand.customName = pet.name
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.willfp.ecopets.pets.entity
|
||||||
|
|
||||||
|
import com.willfp.eco.core.items.builder.SkullBuilder
|
||||||
|
import com.willfp.ecopets.pets.Pet
|
||||||
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.entity.ArmorStand
|
||||||
|
import org.bukkit.inventory.ItemStack
|
||||||
|
|
||||||
|
class SkullPetEntity(pet: Pet) : PetEntity(pet) {
|
||||||
|
override fun spawn(location: Location): ArmorStand {
|
||||||
|
val stand = emptyArmorStandAt(location, pet)
|
||||||
|
|
||||||
|
val skull: ItemStack = SkullBuilder()
|
||||||
|
.setSkullTexture(pet.entityTexture)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
stand.equipment?.helmet = skull
|
||||||
|
|
||||||
|
return stand
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
# by Auxilor
|
# by Auxilor
|
||||||
#
|
#
|
||||||
|
|
||||||
|
discover-recipes: true
|
||||||
|
|
||||||
gui:
|
gui:
|
||||||
rows: 6
|
rows: 6
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ pets:
|
|||||||
xp-gain-methods:
|
xp-gain-methods:
|
||||||
- id: melee_attack
|
- id: melee_attack
|
||||||
multiplier: 0.5
|
multiplier: 0.5
|
||||||
|
conditions: [ ] # You can add a list of conditions that must be met on xp gain
|
||||||
|
|
||||||
# Custom placeholders to be used in descriptions,
|
# Custom placeholders to be used in descriptions,
|
||||||
# Don't add % to the IDs, this is done automatically
|
# Don't add % to the IDs, this is done automatically
|
||||||
@@ -110,6 +111,7 @@ pets:
|
|||||||
conditions: [ ]
|
conditions: [ ]
|
||||||
|
|
||||||
# The texture of the pet entity in game
|
# The texture of the pet entity in game
|
||||||
|
# If you're using modelengine, use modelengine:id as the texture
|
||||||
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
# The icon in GUIs
|
# The icon in GUIs
|
||||||
@@ -230,3 +232,575 @@ pets:
|
|||||||
- "&8&ounlock the &r<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&8&o pet!"
|
- "&8&ounlock the &r<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&8&o pet!"
|
||||||
craftable: false
|
craftable: false
|
||||||
recipe: [ ]
|
recipe: [ ]
|
||||||
|
|
||||||
|
- id: ravager
|
||||||
|
name: "<gradient:#1e3c72>Ravager</gradient:#2a5298>"
|
||||||
|
description: "&8&oLevel up by successfully defending against village raids"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 150
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1300
|
||||||
|
- 1650
|
||||||
|
- 2050
|
||||||
|
- 2500
|
||||||
|
- 3000
|
||||||
|
- 3550
|
||||||
|
- 4150
|
||||||
|
- 4800
|
||||||
|
- 5500
|
||||||
|
- 6250
|
||||||
|
- 7050
|
||||||
|
- 7900
|
||||||
|
- 8800
|
||||||
|
- 9750
|
||||||
|
- 10750
|
||||||
|
- 11800
|
||||||
|
- 12900
|
||||||
|
- 14050
|
||||||
|
- 15250
|
||||||
|
- 16500
|
||||||
|
- 17800
|
||||||
|
- 19150
|
||||||
|
- 20550
|
||||||
|
- 22000
|
||||||
|
- 23500
|
||||||
|
- 25050
|
||||||
|
- 26650
|
||||||
|
- 28300
|
||||||
|
- 30000
|
||||||
|
- 31750
|
||||||
|
- 33550
|
||||||
|
- 35400
|
||||||
|
- 37300
|
||||||
|
- 39250
|
||||||
|
- 41250
|
||||||
|
- 43300
|
||||||
|
- 45400
|
||||||
|
- 47550
|
||||||
|
- 49700
|
||||||
|
- 51950
|
||||||
|
- 53250
|
||||||
|
- 55600
|
||||||
|
- 57000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: win_raid
|
||||||
|
multiplier: 50
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "health_boost"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%health_boost%%&8 bonus"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: bonus_health
|
||||||
|
args:
|
||||||
|
health: "%level%"
|
||||||
|
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2QyMGJmNTJlYzM5MGEwNzk5Mjk5MTg0ZmM2NzhiZjg0Y2Y3MzJiYjFiZDc4ZmQxYzRiNDQxODU4ZjAyMzVhOCJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2QyMGJmNTJlYzM5MGEwNzk5Mjk5MTg0ZmM2NzhiZjg0Y2Y3MzJiYjFiZDc4ZmQxYzRiNDQxODU4ZjAyMzVhOCJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true
|
||||||
|
item: ravager_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "<gradient:#1e3c72>Ravager</gradient:#2a5298>&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r<gradient:#1e3c72>Ravager</gradient:#2a5298>&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
|
||||||
|
- id: mancubus
|
||||||
|
name: "&6Mancubus"
|
||||||
|
description: "&8&oLevel up by taking damage while on fire"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: take_damage
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions:
|
||||||
|
- id: on_fire
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "ignite_chance"
|
||||||
|
value: "1 - (%level% / 100)"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%ignite_chance%%&8 chance to set enemy on fire"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: ignite
|
||||||
|
args:
|
||||||
|
damage_per_tick: 8
|
||||||
|
ticks: 300
|
||||||
|
chance: "%level%"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
conditions: [ ]
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: magma_cube_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&6Mancubus&f Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&6Mancubus&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
# recipe-permission: ecopets.craft.mancubus
|
||||||
|
|
||||||
|
- id: blaze
|
||||||
|
name: "&#FF6600Blaze"
|
||||||
|
description: "&7Earn more XP from killing mobs"
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: kill
|
||||||
|
multiplier: 1
|
||||||
|
level-placeholders:
|
||||||
|
- id: "xp_multiplier"
|
||||||
|
value: "%level% * 2"
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&6» &7Increased XP gain by %xp_multiplier%%!"
|
||||||
|
rewards-description: []
|
||||||
|
level-up-messages: []
|
||||||
|
level-commands: []
|
||||||
|
effects:
|
||||||
|
- id: xp_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.02 + 1"
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjIwNjU3ZTI0YjU2ZTFiMmY4ZmMyMTlkYTFkZTc4OGMwYzI0ZjM2Mzg4YjFhNDA5ZDBjZDJkOGRiYTQ0YWEzYiJ9fX0="
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjIwNjU3ZTI0YjU2ZTFiMmY4ZmMyMTlkYTFkZTc4OGMwYzI0ZjM2Mzg4YjFhNDA5ZDBjZDJkOGRiYTQ0YWEzYiJ9fX0=
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&#FF6600Blaze &fSpawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &#FF6600Blaze pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: []
|
||||||
|
recipe-permission: ecopets.craft.blaze
|
||||||
|
|
||||||
|
- id: sea_serpent
|
||||||
|
name: "&9Sea Serpent"
|
||||||
|
description: "&8&oIncrease swimming speed and damage in water. Level up by swimming"
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 125
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1500
|
||||||
|
- 2000
|
||||||
|
- 3500
|
||||||
|
- 5000
|
||||||
|
- 7500
|
||||||
|
- 10000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 30000
|
||||||
|
- 50000
|
||||||
|
- 75000
|
||||||
|
- 100000
|
||||||
|
- 200000
|
||||||
|
- 300000
|
||||||
|
- 400000
|
||||||
|
- 500000
|
||||||
|
- 600000
|
||||||
|
- 700000
|
||||||
|
- 800000
|
||||||
|
- 900000
|
||||||
|
- 1000000
|
||||||
|
- 1100000
|
||||||
|
- 1200000
|
||||||
|
- 1300000
|
||||||
|
- 1400000
|
||||||
|
- 1500000
|
||||||
|
- 1600000
|
||||||
|
- 1700000
|
||||||
|
- 1800000
|
||||||
|
- 1900000
|
||||||
|
- 2000000
|
||||||
|
- 2100000
|
||||||
|
- 2200000
|
||||||
|
- 2300000
|
||||||
|
- 2400000
|
||||||
|
- 2500000
|
||||||
|
- 2600000
|
||||||
|
- 2750000
|
||||||
|
- 2900000
|
||||||
|
- 3100000
|
||||||
|
- 3400000
|
||||||
|
- 3700000
|
||||||
|
- 4000000
|
||||||
|
- 4500000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: move
|
||||||
|
multiplier: 0.5
|
||||||
|
conditions:
|
||||||
|
- id: is_sprinting
|
||||||
|
- id: in_water
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "multiplier"
|
||||||
|
value: "%level%"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &8Gives a &a+%multiplier%%&8 bonus to"
|
||||||
|
- " &8melee damage when in water"
|
||||||
|
2:
|
||||||
|
- "&8» &8Gives a &a+%multiply_velocity%%&8 bonus to"
|
||||||
|
- " &8movement speed when in water"
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: damage_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 0.01 + 1"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
- id: movement_speed_multiplier
|
||||||
|
args:
|
||||||
|
multiplier: "%level% * 1.3 + 1"
|
||||||
|
|
||||||
|
conditions:
|
||||||
|
- id: in_water
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true # If the pet should have a spawn egg
|
||||||
|
item: drowned_spawn_egg unbreaking:1 hide_enchants
|
||||||
|
name: "&9Sea Serpent&f Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r&9Sea Serpent&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
|
||||||
|
- id: vampire
|
||||||
|
name: "<gradient:#A50000>Vampire</gradient:#FD2424>"
|
||||||
|
description: "&8&oLevel up by taking damage at night."
|
||||||
|
|
||||||
|
level-xp-requirements:
|
||||||
|
- 50
|
||||||
|
- 75
|
||||||
|
- 100
|
||||||
|
- 150
|
||||||
|
- 200
|
||||||
|
- 300
|
||||||
|
- 400
|
||||||
|
- 500
|
||||||
|
- 750
|
||||||
|
- 1000
|
||||||
|
- 1300
|
||||||
|
- 1500
|
||||||
|
- 1750
|
||||||
|
- 2000
|
||||||
|
- 2300
|
||||||
|
- 2500
|
||||||
|
- 3000
|
||||||
|
- 3500
|
||||||
|
- 4000
|
||||||
|
- 4500
|
||||||
|
- 5000
|
||||||
|
- 6000
|
||||||
|
- 8000
|
||||||
|
- 10000
|
||||||
|
- 12000
|
||||||
|
- 15000
|
||||||
|
- 20000
|
||||||
|
- 25000
|
||||||
|
- 30000
|
||||||
|
- 35000
|
||||||
|
- 40000
|
||||||
|
- 44500
|
||||||
|
- 50000
|
||||||
|
- 57000
|
||||||
|
- 64000
|
||||||
|
- 71000
|
||||||
|
- 78000
|
||||||
|
- 80000
|
||||||
|
- 85000
|
||||||
|
- 90000
|
||||||
|
- 95000
|
||||||
|
- 100000
|
||||||
|
- 110000
|
||||||
|
- 115000
|
||||||
|
- 120000
|
||||||
|
- 125000
|
||||||
|
- 150000
|
||||||
|
- 175000
|
||||||
|
- 200000
|
||||||
|
|
||||||
|
xp-gain-methods:
|
||||||
|
- id: take_damage
|
||||||
|
multiplier: 10.0
|
||||||
|
conditions:
|
||||||
|
- id: is_night
|
||||||
|
|
||||||
|
|
||||||
|
level-placeholders:
|
||||||
|
- id: "lifesteal_chance"
|
||||||
|
value: "%level%"
|
||||||
|
- id: "lifesteal_cooldown"
|
||||||
|
value: "1-(%level%/200)"
|
||||||
|
- id: "lifesteal_heal"
|
||||||
|
value: "%level%/20"
|
||||||
|
- id: "bleed_damage"
|
||||||
|
value: "(%level%-15)/10"
|
||||||
|
- id: "bleed_chance"
|
||||||
|
value: "%level%-10"
|
||||||
|
|
||||||
|
effects-description:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
rewards-description:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain &ff0000%lifesteal_heal%"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
level-up-messages:
|
||||||
|
1:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
25:
|
||||||
|
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||||
|
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||||
|
- ""
|
||||||
|
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||||
|
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||||
|
|
||||||
|
level-commands: [ ]
|
||||||
|
|
||||||
|
effects:
|
||||||
|
- id: give_health
|
||||||
|
args:
|
||||||
|
chance: "%level%"
|
||||||
|
cooldown: "1-(%level%/200)"
|
||||||
|
send_cooldown_message: false
|
||||||
|
amount: "%level%/20"
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
- id: bleed
|
||||||
|
args:
|
||||||
|
chance: "%level%-10"
|
||||||
|
damage: "(%level%-15)/10"
|
||||||
|
interval: 15
|
||||||
|
amount: 2
|
||||||
|
conditions:
|
||||||
|
- id: has_pet_level
|
||||||
|
args:
|
||||||
|
pet: vampire
|
||||||
|
level: 25
|
||||||
|
triggers:
|
||||||
|
- melee_attack
|
||||||
|
|
||||||
|
conditions: []
|
||||||
|
|
||||||
|
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgyMGExMGRiMjIyZjY5YWMyMjE1ZDdkMTBkY2E0N2VlYWZhMjE1NTUzNzY0YTJiODFiYWZkNDc5ZTc5MzNkMSJ9fX0="
|
||||||
|
|
||||||
|
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgyMGExMGRiMjIyZjY5YWMyMjE1ZDdkMTBkY2E0N2VlYWZhMjE1NTUzNzY0YTJiODFiYWZkNDc5ZTc5MzNkMSJ9fX0=
|
||||||
|
|
||||||
|
spawn-egg:
|
||||||
|
enabled: true
|
||||||
|
item: bat_spawn_egg unbreaking:2 hide_enchants
|
||||||
|
name: "<gradient:#A50000>Vampire</gradient:#FD2424>&f Pet Spawn Egg"
|
||||||
|
lore:
|
||||||
|
- ""
|
||||||
|
- "&8&oPlace on the ground to"
|
||||||
|
- "&8&ounlock the &r<gradient:#A50000>Vampire</gradient:#FD2424>&8&o pet!"
|
||||||
|
craftable: false
|
||||||
|
recipe: [ ]
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ softdepend:
|
|||||||
- Boosters
|
- Boosters
|
||||||
- EcoSkills
|
- EcoSkills
|
||||||
- Reforges
|
- Reforges
|
||||||
|
- ModelEngine
|
||||||
commands:
|
commands:
|
||||||
ecopets:
|
ecopets:
|
||||||
description: Base Command
|
description: Base Command
|
||||||
@@ -31,7 +32,8 @@ commands:
|
|||||||
aliases:
|
aliases:
|
||||||
- pet
|
- pet
|
||||||
description: Open the pets menu
|
description: Open the pets menu
|
||||||
permission: ecopets.command.skills
|
permission: ecopets.command.pets
|
||||||
|
default: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
ecopets.*:
|
ecopets.*:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#libreforge-updater
|
#libreforge-updater
|
||||||
#Sat Jun 18 12:20:08 BST 2022
|
#Tue Aug 16 18:46:26 CEST 2022
|
||||||
version=1.1.0
|
version=1.20.0
|
||||||
plugin-name=EcoPets
|
plugin-name=EcoPets
|
||||||
|
|||||||
Reference in New Issue
Block a user