Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2835eeaa5d | ||
|
|
1647a5dfaf | ||
|
|
3d260e82ae | ||
|
|
1fdbd064a9 | ||
|
|
94d1802b51 | ||
|
|
8604bf7b46 | ||
|
|
c21eecae11 | ||
|
|
80950aecf3 | ||
|
|
6ad33e98fc | ||
|
|
c60c64c6b3 | ||
|
|
9eb67d5204 | ||
|
|
77f08961b8 | ||
|
|
be4c70e0c5 | ||
|
|
614831687f | ||
|
|
3ea5d8f4d3 | ||
|
|
2e472abc98 | ||
|
|
927c1fbcae | ||
|
|
7e6b5c4b80 | ||
|
|
616e0c012b | ||
|
|
226aaac8c1 | ||
|
|
34026be77b | ||
|
|
8b585af4e2 | ||
|
|
4cd7398d76 | ||
|
|
c84a2a10f6 | ||
|
|
6dcfd4ccaa | ||
|
|
428df89ed1 | ||
|
|
ebe542ef2b | ||
|
|
d3d005845a | ||
|
|
5d4eedfef6 | ||
|
|
c362ad0d18 | ||
|
|
2d56e8a9d7 | ||
|
|
56c7268bb9 | ||
|
|
447c2c877a | ||
|
|
1c0c9ba259 | ||
|
|
6f5a8b9df2 | ||
|
|
cbbe5b590e | ||
|
|
fa3c5b8020 | ||
|
|
7a34a2d38c | ||
|
|
0f14f36b2f |
@@ -21,7 +21,7 @@
|
||||
</a>
|
||||
</p>
|
||||
|
||||
[](https://discord.gg/ZcwpSsE/)
|
||||
[](https://discord.gg/ZcwpSsE/)
|
||||
|
||||
## License
|
||||
*Click here to read [the entire license](https://github.com/Auxilor/EcoPets/blob/master/LICENSE.md).*
|
||||
|
||||
@@ -34,6 +34,7 @@ allprojects {
|
||||
maven { url 'https://repo.codemc.io/repository/maven-public/' }
|
||||
maven { url 'https://repo.dmulloy2.net/repository/public/' }
|
||||
maven { url 'https://repo.essentialsx.net/releases/' }
|
||||
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -47,7 +48,7 @@ allprojects {
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.37.1'
|
||||
implementation 'com.willfp:libreforge:3.63.0'
|
||||
implementation 'com.willfp:libreforge:3.67.0'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
@@ -7,6 +7,7 @@ dependencies {
|
||||
compileOnly 'net.kyori:adventure-api:4.10.1'
|
||||
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
||||
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
||||
compileOnly 'com.ticxo.modelengine:api:R2.5.0'
|
||||
}
|
||||
|
||||
build.dependsOn publishToMavenLocal
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.willfp.ecopets
|
||||
|
||||
import com.willfp.ecopets.api.EcoPetsAPI
|
||||
import com.willfp.ecopets.pets.Pet
|
||||
import com.willfp.ecopets.pets.activePet
|
||||
import com.willfp.ecopets.pets.getPetLevel
|
||||
import com.willfp.ecopets.pets.getPetProgress
|
||||
import com.willfp.ecopets.pets.getPetXP
|
||||
@@ -14,6 +15,8 @@ import org.bukkit.entity.Player
|
||||
internal object EcoPetsAPIImpl : EcoPetsAPI {
|
||||
override fun hasPet(player: OfflinePlayer, pet: Pet) = player.hasPet(pet)
|
||||
|
||||
override fun getActivePet(player: OfflinePlayer): Pet? = player.activePet
|
||||
|
||||
override fun getPetLevel(player: OfflinePlayer, pet: Pet) = player.getPetLevel(pet)
|
||||
|
||||
override fun givePetExperience(player: Player, pet: Pet, amount: Double) =
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.willfp.ecopets
|
||||
|
||||
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.util.toSingletonList
|
||||
import com.willfp.ecopets.commands.CommandEcopets
|
||||
@@ -12,6 +13,8 @@ import com.willfp.ecopets.pets.PetTriggerXPGainListener
|
||||
import com.willfp.ecopets.pets.SpawnEggHandler
|
||||
import com.willfp.ecopets.pets.activePet
|
||||
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 org.bukkit.event.Listener
|
||||
|
||||
@@ -48,6 +51,16 @@ class EcoPetsPlugin : LibReforgePlugin() {
|
||||
petDisplay.shutdown()
|
||||
}
|
||||
|
||||
override fun loadAdditionalIntegrations(): List<IntegrationLoader> {
|
||||
return listOf(
|
||||
IntegrationLoader("ModelEngine") {
|
||||
PetEntity.registerPetEntity("modelengine") { pet, id ->
|
||||
ModelEnginePetEntity(pet, id)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun loadPluginCommands(): List<PluginCommand> {
|
||||
return listOf(
|
||||
CommandEcopets(this),
|
||||
|
||||
@@ -18,6 +18,16 @@ interface EcoPetsAPI {
|
||||
pet: Pet
|
||||
): Boolean
|
||||
|
||||
/**
|
||||
* Get a player's active pet.
|
||||
*
|
||||
* @param player The player.
|
||||
* @return The active pet.
|
||||
*/
|
||||
fun getActivePet(
|
||||
player: OfflinePlayer
|
||||
): Pet?
|
||||
|
||||
/**
|
||||
* Get a player's level of a certain pet.
|
||||
*
|
||||
|
||||
@@ -9,6 +9,8 @@ class CommandEcopets(plugin: EcoPlugin) : PluginCommand(plugin, "ecopets", "ecop
|
||||
this.addSubcommand(CommandReload(plugin))
|
||||
.addSubcommand(CommandGive(plugin))
|
||||
.addSubcommand(CommandGiveEgg(plugin))
|
||||
.addSubcommand(CommandGiveXP(plugin))
|
||||
.addSubcommand(CommandReset(plugin))
|
||||
}
|
||||
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.willfp.ecopets.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.eco.util.StringUtils
|
||||
import com.willfp.eco.util.savedDisplayName
|
||||
import com.willfp.eco.util.toNiceString
|
||||
import com.willfp.ecopets.pets.Pets
|
||||
import com.willfp.ecopets.pets.givePetExperience
|
||||
import com.willfp.ecopets.pets.hasPet
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandGiveXP(plugin: EcoPlugin) : Subcommand(plugin, "givexp", "ecopets.command.givexp", false) {
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||
return
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
if (args.size == 2) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-amount"))
|
||||
return
|
||||
}
|
||||
|
||||
val playerName = args[0]
|
||||
|
||||
val player = Bukkit.getPlayer(playerName)
|
||||
|
||||
if (player == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||
return
|
||||
}
|
||||
|
||||
val pet = Pets.getByID(args[1])
|
||||
|
||||
if (pet == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
if (!player.hasPet(pet)) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("doesnt-have-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
val amount = args[2].toDoubleOrNull()
|
||||
|
||||
if (amount == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-amount"))
|
||||
return
|
||||
}
|
||||
|
||||
player.givePetExperience(
|
||||
pet,
|
||||
amount
|
||||
)
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("gave-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
.replace("%player%", player.savedDisplayName)
|
||||
.replace("%xp%", amount.toNiceString())
|
||||
.replace("%pet%", pet.name)
|
||||
)
|
||||
}
|
||||
|
||||
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||
if (args.size == 1) {
|
||||
return Bukkit.getOnlinePlayers().map { it.name }
|
||||
}
|
||||
|
||||
if (args.size == 2) {
|
||||
return Pets.values().map { it.id }
|
||||
}
|
||||
|
||||
if (args.size == 3) {
|
||||
return listOf("10", "100", "1000", "10000")
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.willfp.ecopets.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.eco.util.StringUtils
|
||||
import com.willfp.eco.util.savedDisplayName
|
||||
import com.willfp.eco.util.toNiceString
|
||||
import com.willfp.ecopets.pets.Pets
|
||||
import com.willfp.ecopets.pets.activePet
|
||||
import com.willfp.ecopets.pets.givePetExperience
|
||||
import com.willfp.ecopets.pets.hasPet
|
||||
import com.willfp.ecopets.pets.setPetLevel
|
||||
import com.willfp.ecopets.pets.setPetXP
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandReset(plugin: EcoPlugin) : Subcommand(plugin, "reset", "ecopets.command.reset", false) {
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||
return
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
val playerName = args[0]
|
||||
|
||||
val player = Bukkit.getPlayer(playerName)
|
||||
|
||||
if (player == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||
return
|
||||
}
|
||||
|
||||
val pet = Pets.getByID(args[1])
|
||||
|
||||
if (pet == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
if (!player.hasPet(pet)) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("doesnt-have-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
if (player.activePet == pet) {
|
||||
player.activePet = null
|
||||
}
|
||||
player.setPetXP(pet, 0.0)
|
||||
player.setPetLevel(pet, 0)
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("reset-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
.replace("%player%", player.savedDisplayName)
|
||||
.replace("%pet%", pet.name)
|
||||
)
|
||||
}
|
||||
|
||||
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||
if (args.size == 1) {
|
||||
return Bukkit.getOnlinePlayers().map { it.name }
|
||||
}
|
||||
|
||||
if (args.size == 2) {
|
||||
return Pets.values().map { it.id }
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import com.willfp.eco.core.fast.fast
|
||||
import com.willfp.eco.core.items.CustomItem
|
||||
import com.willfp.eco.core.items.Items
|
||||
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.PlayerStaticPlaceholder
|
||||
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.api.event.PlayerPetExpGainEvent
|
||||
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.ConfiguredCondition
|
||||
import com.willfp.libreforge.effects.ConfiguredEffect
|
||||
@@ -112,16 +112,14 @@ class Pet(
|
||||
}
|
||||
}
|
||||
|
||||
val petEntityItem: ItemStack = SkullBuilder()
|
||||
.setSkullTexture(config.getString("entity-texture"))
|
||||
.build()
|
||||
|
||||
val levelGUI = PetLevelGUI(plugin, this)
|
||||
val entityTexture = config.getString("entity-texture")
|
||||
|
||||
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")
|
||||
|
||||
val maxLevel = levelXpRequirements.size
|
||||
|
||||
val levelGUI = PetLevelGUI(plugin, this)
|
||||
|
||||
private val baseItem: ItemStack = Items.lookup(config.getString("icon")).item
|
||||
|
||||
private val effects: Set<ConfiguredEffect>
|
||||
@@ -153,12 +151,15 @@ class Pet(
|
||||
private val petXpGains = config.getSubsections("xp-gain-methods").mapNotNull {
|
||||
val trigger = Triggers.getById(it.getString("id")) ?: return@mapNotNull null
|
||||
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,
|
||||
multiplier
|
||||
multiplier,
|
||||
conditions
|
||||
)
|
||||
}
|
||||
}.toMap()
|
||||
|
||||
init {
|
||||
config.injectPlaceholders(
|
||||
@@ -203,6 +204,13 @@ class Pet(
|
||||
(it.getPetProgress(this) * 100).toNiceString()
|
||||
}.register()
|
||||
|
||||
PlayerPlaceholder(
|
||||
plugin,
|
||||
id
|
||||
) {
|
||||
it.getPetLevel(this).toString()
|
||||
}.register()
|
||||
|
||||
PlayerPlaceholder(
|
||||
plugin,
|
||||
"${id}_current_xp"
|
||||
@@ -232,6 +240,10 @@ class Pet(
|
||||
}.register()
|
||||
}
|
||||
|
||||
fun makePetEntity(): PetEntity {
|
||||
return PetEntity.create(this)
|
||||
}
|
||||
|
||||
fun getLevel(level: Int): PetLevel = levels.get(level) {
|
||||
PetLevel(this, it, effects, conditions)
|
||||
}
|
||||
@@ -304,7 +316,14 @@ class Pet(
|
||||
.map {
|
||||
it.replace("%percentage_progress%", (player.getPetProgress(this) * 100).toNiceString())
|
||||
.replace("%current_xp%", player.getPetXP(this).toNiceString())
|
||||
.replace("%required_xp%", this.getExpForLevel(player.getPetLevel(this) + 1).toNiceString())
|
||||
.replace("%required_xp%", this.getExpForLevel(player.getPetLevel(this) + 1).let { req ->
|
||||
if (req == Int.MAX_VALUE) {
|
||||
plugin.langYml.getFormattedString("infinity")
|
||||
} else {
|
||||
req.toNiceString()
|
||||
}
|
||||
}
|
||||
)
|
||||
.replace("%description%", this.description)
|
||||
.replace("%pet%", this.name)
|
||||
.replace("%level%", (forceLevel ?: player.getPetLevel(this)).toString())
|
||||
@@ -382,12 +401,8 @@ class Pet(
|
||||
}
|
||||
}
|
||||
|
||||
fun canGainXPFromTrigger(trigger: Trigger): Boolean {
|
||||
return petXpGains.any { it.trigger == trigger }
|
||||
}
|
||||
|
||||
fun getTriggerXPMultiplier(trigger: Trigger): Double {
|
||||
return petXpGains.firstOrNull { it.trigger == trigger }?.multiplier ?: 1.0
|
||||
fun getPetXPGain(trigger: Trigger): PetXPGain? {
|
||||
return petXpGains[trigger]
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -6,16 +6,13 @@ import com.willfp.eco.util.formatEco
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.ArmorStand
|
||||
import org.bukkit.entity.EntityType
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.player.PlayerQuitEvent
|
||||
import org.bukkit.inventory.EquipmentSlot
|
||||
import java.util.*
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.sin
|
||||
|
||||
class PetDisplay(
|
||||
private val plugin: EcoPlugin
|
||||
@@ -37,7 +34,6 @@ class PetDisplay(
|
||||
val pet = player.activePet
|
||||
|
||||
if (pet != null) {
|
||||
stand.equipment?.helmet = pet.petEntityItem
|
||||
stand.customName = plugin.configYml.getString("pet-entity.name")
|
||||
.replace("%player%", player.displayName)
|
||||
.replace("%pet%", pet.name)
|
||||
@@ -49,7 +45,10 @@ class PetDisplay(
|
||||
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
||||
|
||||
stand.teleport(location)
|
||||
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
||||
|
||||
if (!pet.entityTexture.contains(":")) {
|
||||
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,24 +74,9 @@ class PetDisplay(
|
||||
}
|
||||
|
||||
val location = getLocation(player)
|
||||
val newStand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
||||
newStand.isVisible = false
|
||||
newStand.isInvulnerable = true
|
||||
newStand.isPersistent = true
|
||||
newStand.removeWhenFarAway = false
|
||||
newStand.isSmall = true
|
||||
newStand.setGravity(false)
|
||||
newStand.isCollidable = false
|
||||
val stand = pet.makePetEntity().spawn(location)
|
||||
|
||||
for (slot in EquipmentSlot.values()) {
|
||||
newStand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
||||
}
|
||||
|
||||
newStand.equipment?.helmet = pet.petEntityItem
|
||||
newStand.isCustomNameVisible = true
|
||||
newStand.customName = pet.name
|
||||
|
||||
trackedEntities[player.uniqueId] = newStand
|
||||
trackedEntities[player.uniqueId] = stand
|
||||
}
|
||||
|
||||
return trackedEntities[player.uniqueId]
|
||||
|
||||
@@ -9,18 +9,28 @@ import com.willfp.eco.core.gui.slot.MaskItems
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||
import com.willfp.eco.util.NumberUtils
|
||||
import com.willfp.eco.util.toNiceString
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class PetLevelGUI(
|
||||
plugin: EcoPlugin,
|
||||
pet: Pet
|
||||
private val pet: Pet
|
||||
) {
|
||||
private val menu: Menu
|
||||
private val pageKey = "page"
|
||||
private var levelsPerPage by Delegates.notNull<Int>()
|
||||
private var pages by Delegates.notNull<Int>()
|
||||
|
||||
private fun getPage(menu: Menu, player: Player): Int {
|
||||
val page = menu.getState(player, pageKey) ?: 1
|
||||
|
||||
return min(pages, max(page, 1))
|
||||
}
|
||||
|
||||
init {
|
||||
val maskPattern = plugin.configYml.getStrings("level-gui.mask.pattern").toTypedArray()
|
||||
@@ -51,10 +61,8 @@ class PetLevelGUI(
|
||||
}
|
||||
}
|
||||
|
||||
val pages = ceil(pet.maxLevel.toDouble() / progressionSlots.size).toInt()
|
||||
val levelsPerPage = progressionSlots.size
|
||||
|
||||
val pageKey = "page"
|
||||
levelsPerPage = progressionSlots.size
|
||||
pages = ceil(pet.maxLevel.toDouble() / levelsPerPage).toInt()
|
||||
|
||||
menu = menu(plugin.configYml.getInt("level-gui.rows")) {
|
||||
setTitle(pet.name)
|
||||
@@ -71,7 +79,7 @@ class PetLevelGUI(
|
||||
value.second,
|
||||
slot(ItemStack(Material.BLACK_STAINED_GLASS_PANE)) {
|
||||
setUpdater { player, menu, _ ->
|
||||
val page = menu.getState<Int>(player, pageKey) ?: 1
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val slotLevel = ((page - 1) * levelsPerPage) + level
|
||||
|
||||
@@ -126,11 +134,14 @@ class PetLevelGUI(
|
||||
) {
|
||||
onLeftClick { event, _, menu ->
|
||||
val player = event.whoClicked as Player
|
||||
var page = menu.getState(player, pageKey) ?: 1
|
||||
page--
|
||||
menu.addState(player, pageKey, page)
|
||||
if (page == 0) {
|
||||
PetsGUI.open(event.whoClicked as Player)
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val newPage = max(0, page - 1)
|
||||
|
||||
if (newPage == 0) {
|
||||
PetsGUI.open(player)
|
||||
} else {
|
||||
menu.addState(player, pageKey, newPage)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +156,11 @@ class PetLevelGUI(
|
||||
) {
|
||||
onLeftClick { event, _, menu ->
|
||||
val player = event.whoClicked as Player
|
||||
val newPage = max(pages, (menu.getState(player, pageKey) ?: 1) + 1)
|
||||
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val newPage = min(pages, page + 1)
|
||||
|
||||
menu.addState(player, pageKey, newPage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.willfp.ecopets.pets
|
||||
|
||||
import com.willfp.libreforge.conditions.ConfiguredCondition
|
||||
import com.willfp.libreforge.events.TriggerPreProcessEvent
|
||||
import com.willfp.libreforge.triggers.Trigger
|
||||
import org.bukkit.event.EventHandler
|
||||
@@ -7,10 +8,11 @@ import org.bukkit.event.Listener
|
||||
|
||||
data class PetXPGain(
|
||||
val trigger: Trigger,
|
||||
val multiplier: Double
|
||||
val multiplier: Double,
|
||||
val conditions: Iterable<ConfiguredCondition>
|
||||
)
|
||||
|
||||
object PetTriggerXPGainListener: Listener {
|
||||
object PetTriggerXPGainListener : Listener {
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
fun handle(event: TriggerPreProcessEvent) {
|
||||
val player = event.player
|
||||
@@ -19,11 +21,15 @@ object PetTriggerXPGainListener: Listener {
|
||||
|
||||
val pet = event.player.activePet ?: return
|
||||
|
||||
if (pet.canGainXPFromTrigger(trigger)) {
|
||||
player.givePetExperience(
|
||||
pet,
|
||||
value * pet.getTriggerXPMultiplier(trigger)
|
||||
)
|
||||
val xpGain = pet.getPetXPGain(trigger) ?: return
|
||||
|
||||
if (xpGain.conditions.any { !it.isMet(player) }) {
|
||||
return
|
||||
}
|
||||
|
||||
player.givePetExperience(
|
||||
pet,
|
||||
value * xpGain.multiplier
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,24 @@ import org.bukkit.Material
|
||||
import org.bukkit.Sound
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
object PetsGUI {
|
||||
private lateinit var menu: Menu
|
||||
private val petAreaSlots = mutableListOf<Pair<Int, Int>>()
|
||||
private const val pageKey = "page"
|
||||
|
||||
private fun getPage(menu: Menu, player: Player): Int {
|
||||
val pages = ceil(Pets.values()
|
||||
.filter { player.getPetLevel(it) > 0 }
|
||||
.size.toDouble() / petAreaSlots.size).toInt()
|
||||
|
||||
val page = menu.getState(player, pageKey) ?: 1
|
||||
|
||||
return max(min(pages, page + 1), 1)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ConfigUpdater
|
||||
@@ -27,8 +41,8 @@ object PetsGUI {
|
||||
val bottomRightColumn = plugin.configYml.getInt("gui.pet-area.bottom-right.column")
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
@@ -50,6 +64,19 @@ object PetsGUI {
|
||||
}
|
||||
}
|
||||
|
||||
val petIconBuilder = { player: Player, menu: Menu, index: Int ->
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val unlockedPets = Pets.values()
|
||||
.sortedByDescending { player.getPetLevel(it) }
|
||||
.filter { player.getPetLevel(it) > 0 }
|
||||
|
||||
val pagedIndex = ((page - 1) * petAreaSlots.size) + index
|
||||
|
||||
val pet = unlockedPets.getOrNull(pagedIndex)
|
||||
pet?.getIcon(player) ?: ItemStack(Material.AIR)
|
||||
}
|
||||
|
||||
return menu(plugin.configYml.getInt("gui.rows")) {
|
||||
setTitle(plugin.langYml.getString("menu.title"))
|
||||
|
||||
@@ -74,20 +101,23 @@ object PetsGUI {
|
||||
for ((index, pair) in petAreaSlots.withIndex()) {
|
||||
val (row, column) = pair
|
||||
|
||||
setSlot(row, column, slot(ItemStack(Material.AIR)) {
|
||||
setUpdater { player, _, _ ->
|
||||
val unlockedPets = Pets.values().filter { player.getPetLevel(it) > 0 }
|
||||
val pet = unlockedPets.getOrNull(index)
|
||||
pet?.getIcon(player) ?: ItemStack(Material.AIR)
|
||||
setSlot(row, column, slot({ p, m -> petIconBuilder(p, m, index) }) {
|
||||
setUpdater { p, m, _ ->
|
||||
petIconBuilder(p, m, index)
|
||||
}
|
||||
|
||||
onLeftClick { event, _, _ ->
|
||||
val player = event.whoClicked as Player
|
||||
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val unlockedPets = Pets.values()
|
||||
.sortedByDescending { player.getPetLevel(it) }
|
||||
.filter { player.getPetLevel(it) > 0 }
|
||||
|
||||
val pet = unlockedPets.getOrNull(index) ?: return@onLeftClick
|
||||
val pagedIndex = ((page - 1) * petAreaSlots.size) + index
|
||||
|
||||
val pet = unlockedPets.getOrNull(pagedIndex) ?: return@onLeftClick
|
||||
|
||||
if (player.activePet != pet) {
|
||||
player.activePet = pet
|
||||
@@ -103,6 +133,49 @@ object PetsGUI {
|
||||
})
|
||||
}
|
||||
|
||||
setSlot(
|
||||
plugin.configYml.getInt("gui.prev-page.location.row"),
|
||||
plugin.configYml.getInt("gui.prev-page.location.column"),
|
||||
slot(
|
||||
ItemStackBuilder(Items.lookup(plugin.configYml.getString("gui.prev-page.item")))
|
||||
.setDisplayName(plugin.configYml.getString("gui.prev-page.name"))
|
||||
.build()
|
||||
) {
|
||||
onLeftClick { event, _, menu ->
|
||||
val player = event.whoClicked as Player
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val newPage = max(1, page - 1)
|
||||
|
||||
menu.addState(player, pageKey, newPage)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
setSlot(
|
||||
plugin.configYml.getInt("gui.next-page.location.row"),
|
||||
plugin.configYml.getInt("gui.next-page.location.column"),
|
||||
slot(
|
||||
ItemStackBuilder(Items.lookup(plugin.configYml.getString("gui.next-page.item")))
|
||||
.setDisplayName(plugin.configYml.getString("gui.next-page.name"))
|
||||
.build()
|
||||
) {
|
||||
onLeftClick { event, _, menu ->
|
||||
val player = event.whoClicked as Player
|
||||
|
||||
val pages = ceil(Pets.values()
|
||||
.filter { player.getPetLevel(it) > 0 }
|
||||
.size.toDouble() / petAreaSlots.size).toInt()
|
||||
|
||||
val page = getPage(menu, player)
|
||||
|
||||
val newPage = min(pages, page + 1)
|
||||
|
||||
menu.addState(player, pageKey, newPage)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
setSlot(plugin.configYml.getInt("gui.close.location.row"),
|
||||
plugin.configYml.getInt("gui.close.location.column"),
|
||||
slot(
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
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
|
||||
import org.bukkit.entity.EntityType
|
||||
import org.bukkit.inventory.EquipmentSlot
|
||||
|
||||
class ModelEnginePetEntity(
|
||||
pet: Pet,
|
||||
private val modelID: String
|
||||
) : PetEntity(pet) {
|
||||
override fun spawn(location: Location): ArmorStand {
|
||||
val stand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
||||
stand.isVisible = false
|
||||
stand.isInvulnerable = true
|
||||
stand.isPersistent = true
|
||||
stand.removeWhenFarAway = false
|
||||
stand.isSmall = true
|
||||
stand.setGravity(false)
|
||||
stand.isCollidable = false
|
||||
|
||||
for (slot in EquipmentSlot.values()) {
|
||||
stand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
||||
}
|
||||
|
||||
val model = ModelEngineAPI.createActiveModel(modelID)
|
||||
val modelled = ModelEngineAPI.createModeledEntity(stand)
|
||||
modelled.addActiveModel(model)
|
||||
|
||||
stand.isCustomNameVisible = true
|
||||
stand.customName = pet.name
|
||||
|
||||
return stand
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.willfp.ecopets.pets.entity
|
||||
|
||||
import com.willfp.ecopets.pets.Pet
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.ArmorStand
|
||||
|
||||
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:"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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.entity.Entity
|
||||
import org.bukkit.entity.EntityType
|
||||
import org.bukkit.inventory.EquipmentSlot
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class SkullPetEntity(pet: Pet) : PetEntity(pet) {
|
||||
override fun spawn(location: Location): ArmorStand {
|
||||
val newStand = location.world!!.spawnEntity(location, EntityType.ARMOR_STAND) as ArmorStand
|
||||
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()) {
|
||||
newStand.addEquipmentLock(slot, ArmorStand.LockType.ADDING_OR_CHANGING)
|
||||
}
|
||||
|
||||
|
||||
val skull: ItemStack = SkullBuilder()
|
||||
.setSkullTexture(pet.entityTexture)
|
||||
.build()
|
||||
|
||||
newStand.equipment?.helmet = skull
|
||||
newStand.isCustomNameVisible = true
|
||||
newStand.customName = pet.name
|
||||
|
||||
return newStand
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ gui:
|
||||
- "100000001"
|
||||
- "100000001"
|
||||
- "100000001"
|
||||
- "101101111"
|
||||
- "101000111"
|
||||
|
||||
pet-area:
|
||||
top-left:
|
||||
@@ -86,6 +86,20 @@ gui:
|
||||
sound: ui_button_click
|
||||
pitch: 1
|
||||
|
||||
prev-page:
|
||||
item: arrow
|
||||
name: "&fPrevious Page"
|
||||
location:
|
||||
row: 6
|
||||
column: 4
|
||||
|
||||
next-page:
|
||||
item: arrow
|
||||
name: "&fNext Page"
|
||||
location:
|
||||
row: 6
|
||||
column: 6
|
||||
|
||||
close:
|
||||
item: barrier
|
||||
name: "&cClose"
|
||||
@@ -202,7 +216,7 @@ level-up:
|
||||
enabled: true
|
||||
message:
|
||||
- "&f"
|
||||
- " &#d977c2You levelled up your %pet%&#d977c2 petW to &eLevel %level%&#d977c2!"
|
||||
- " &#d977c2You levelled up your %pet%&#d977c2 pet to &eLevel %level%&#d977c2!"
|
||||
- "&f"
|
||||
- " &#d977c2&lREWARDS:"
|
||||
- " %level_up_messages%"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
resource-id: 0
|
||||
resource-id: 2534
|
||||
bstats-id: 15502
|
||||
color: "&#d977c2"
|
||||
@@ -9,13 +9,20 @@ messages:
|
||||
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
|
||||
cannot-transmit: "&cYou can't transmit here!"
|
||||
needs-player: "&cYou must specify a player!"
|
||||
gave-xp: "&fYou have given &a%xp% &fXP to %player%&f's %pet%&f!"
|
||||
reset-xp: "&fYou have reset %player%&f's %pet%&f XP!"
|
||||
needs-pet: "&cYou must specify a pet!"
|
||||
need-amount: "&cYou must specify a amount!"
|
||||
invalid-player: "&cInvalid player!"
|
||||
invalid-pet: "&cInvalid pet!"
|
||||
already-has-pet: "&cPlayer already has this pet!"
|
||||
doesnt-have-pet: "&cPlayer doesn't have this pet!"
|
||||
gave-pet: "&fSuccessfully gave %player%&f the %pet%&f pet!"
|
||||
gave-pet-egg: "&fSuccessfully gave %player%&f the %pet%&f pet egg!"
|
||||
cannot-spawn-pet: "&cYou already have this pet unlocked!"
|
||||
invalid-amount: "&cInvalid amount!"
|
||||
|
||||
menu:
|
||||
title: "Pets"
|
||||
|
||||
infinity: "∞"
|
||||
|
||||
@@ -65,6 +65,7 @@ pets:
|
||||
xp-gain-methods:
|
||||
- id: melee_attack
|
||||
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,
|
||||
# Don't add % to the IDs, this is done automatically
|
||||
@@ -110,6 +111,7 @@ pets:
|
||||
conditions: [ ]
|
||||
|
||||
# The texture of the pet entity in game
|
||||
# If you're using modelengine, use modelengine:id as the texture
|
||||
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
|
||||
|
||||
# The icon in GUIs
|
||||
@@ -119,7 +121,7 @@ pets:
|
||||
spawn-egg:
|
||||
enabled: true # If the pet should have a spawn egg
|
||||
item: blaze_spawn_egg unbreaking:1 hide_enchants
|
||||
name: "&6Tiger&f Spawn Egg"
|
||||
name: "&6Tiger&f Pet Spawn Egg"
|
||||
lore:
|
||||
- ""
|
||||
- "&8&oPlace on the ground to"
|
||||
@@ -127,3 +129,210 @@ pets:
|
||||
craftable: false
|
||||
recipe: [ ]
|
||||
# recipe-permission: ecopets.craft.tiger
|
||||
|
||||
- id: skeleton
|
||||
name: "<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>"
|
||||
description: "&8&oLevel up by dealing bow damage"
|
||||
|
||||
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: bow_attack
|
||||
multiplier: 0.5
|
||||
|
||||
level-placeholders:
|
||||
- id: "damage_multiplier"
|
||||
value: "%level%"
|
||||
|
||||
effects-description:
|
||||
1:
|
||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||
- " &8bow damage"
|
||||
|
||||
rewards-description:
|
||||
1:
|
||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||
- " &8bow damage"
|
||||
|
||||
level-up-messages:
|
||||
1:
|
||||
- "&8» &8Gives a &a+%damage_multiplier%%&8 bonus to"
|
||||
- " &8bow damage"
|
||||
|
||||
level-commands: [ ]
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: "%level% * 0.01 + 1"
|
||||
triggers:
|
||||
- bow_attack
|
||||
conditions: [ ]
|
||||
|
||||
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWQ0NmViNjQyZGMzYTRkZmJiNWFkNTI5N2VkYWUyOTk2ZWE0Y2ZmZjkyYWMyZWI1NmRmYWU5ZWUxZDU4ZTQwOCJ9fX0="
|
||||
|
||||
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWQ0NmViNjQyZGMzYTRkZmJiNWFkNTI5N2VkYWUyOTk2ZWE0Y2ZmZjkyYWMyZWI1NmRmYWU5ZWUxZDU4ZTQwOCJ9fX0=
|
||||
|
||||
spawn-egg:
|
||||
enabled: true # If the pet should have a spawn egg
|
||||
item: skeleton_spawn_egg unbreaking:1 hide_enchants
|
||||
name: "<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&f Pet Spawn Egg"
|
||||
lore:
|
||||
- ""
|
||||
- "&8&oPlace on the ground to"
|
||||
- "&8&ounlock the &r<gradient:#F2F2F2>Skeleton</gradient:#DBDBDB>&8&o pet!"
|
||||
craftable: false
|
||||
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: potion_effect
|
||||
conditions:
|
||||
- id: has_potion_effect
|
||||
args:
|
||||
effect: hero_of_the_village
|
||||
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: potion_effect
|
||||
args:
|
||||
effect: health_boost
|
||||
level: "%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: [ ]
|
||||
@@ -23,6 +23,7 @@ softdepend:
|
||||
- Boosters
|
||||
- EcoSkills
|
||||
- Reforges
|
||||
- ModelEngine
|
||||
commands:
|
||||
ecopets:
|
||||
description: Base Command
|
||||
@@ -31,7 +32,8 @@ commands:
|
||||
aliases:
|
||||
- pet
|
||||
description: Open the pets menu
|
||||
permission: ecopets.command.skills
|
||||
permission: ecopets.command.pets
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
ecopets.*:
|
||||
@@ -48,6 +50,8 @@ permissions:
|
||||
ecopets.command.pets: true
|
||||
ecopets.command.give: true
|
||||
ecopets.command.giveegg: true
|
||||
ecopets.command.givexp: true
|
||||
ecopets.command.reset: true
|
||||
|
||||
ecopets.command.reload:
|
||||
description: Allows reloading the config
|
||||
@@ -64,6 +68,12 @@ permissions:
|
||||
ecopets.command.giveegg:
|
||||
description: Allows the use of /ecopets giveegg.
|
||||
default: op
|
||||
ecopets.command.givexp:
|
||||
description: Allows the use of /ecopets givexp.
|
||||
default: op
|
||||
ecopets.command.reset:
|
||||
description: Allows the use of /ecopets reset.
|
||||
default: op
|
||||
|
||||
ecopets.xpmultiplier.50percent:
|
||||
description: Gives the player 50% more skill experience
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
version=1.0.0
|
||||
#libreforge-updater
|
||||
#Mon Jun 20 21:38:10 BST 2022
|
||||
version=1.5.0
|
||||
plugin-name=EcoPets
|
||||
|
||||
Reference in New Issue
Block a user