Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2928ee59f | ||
|
|
315d8f0954 | ||
|
|
7f616da0ce | ||
|
|
eeada10ef8 | ||
|
|
230eb9b87f | ||
|
|
803324c5c9 | ||
|
|
6aaf494b73 | ||
|
|
d34ad33c7d | ||
|
|
e0c1c27ea5 | ||
|
|
a31b6a2a4c | ||
|
|
82decbb2cb | ||
|
|
f143a90dd7 | ||
|
|
58a16a33ec | ||
|
|
8626869a0f | ||
|
|
88eea3c768 | ||
|
|
0271c16357 | ||
|
|
2dc88624dd | ||
|
|
20d7e3abf7 | ||
|
|
2d1d423f83 | ||
|
|
2064bcc9f2 | ||
|
|
95b7bdc3db | ||
|
|
619d5fdde5 | ||
|
|
4226d544e9 | ||
|
|
cf8de5a182 | ||
|
|
26ef893d2c | ||
|
|
1e5836203a | ||
|
|
dcb06f6e25 | ||
|
|
493d419e2c | ||
|
|
435160f626 | ||
|
|
dfe7af1e1b |
@@ -3,7 +3,7 @@ version = rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
|
||||
compileOnly("com.ticxo.modelengine:api:R3.1.6")
|
||||
compileOnly("com.ticxo.modelengine:api:R3.1.8")
|
||||
compileOnly("com.github.ben-manes.caffeine:caffeine:3.0.2")
|
||||
|
||||
implementation("com.willfp:ecomponent:1.3.0")
|
||||
|
||||
@@ -11,6 +11,7 @@ class CommandEcoPets(plugin: EcoPlugin) : PluginCommand(plugin, "ecopets", "ecop
|
||||
.addSubcommand(CommandGiveEgg(plugin))
|
||||
.addSubcommand(CommandGiveXP(plugin))
|
||||
.addSubcommand(CommandReset(plugin))
|
||||
.addSubcommand(CommandGiveCurrentXP(plugin))
|
||||
}
|
||||
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
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 org.bukkit.Bukkit
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandGiveCurrentXP(plugin: EcoPlugin) : Subcommand(plugin, "givecurrentxp", "ecopets.command.givecurrentxp", 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-amount"))
|
||||
return
|
||||
}
|
||||
|
||||
val playerName = args[0]
|
||||
|
||||
val player = Bukkit.getPlayer(playerName)
|
||||
|
||||
if (player == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||
return
|
||||
}
|
||||
|
||||
val pet = player.activePet
|
||||
|
||||
if (pet == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("no-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
if (!player.hasPet(pet)) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("doesnt-have-pet"))
|
||||
return
|
||||
}
|
||||
|
||||
val amount = args[1].toDoubleOrNull()
|
||||
|
||||
if (amount == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-amount"))
|
||||
return
|
||||
}
|
||||
|
||||
player.givePetExperience(
|
||||
pet,
|
||||
amount
|
||||
)
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("gave-current-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
.replace("%player%", player.savedDisplayName)
|
||||
.replace("%xp%", amount.toNiceString())
|
||||
)
|
||||
}
|
||||
|
||||
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 listOf("10", "100", "1000", "10000")
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
@@ -363,6 +363,8 @@ class Pet(
|
||||
val level = player.getPetLevel(this)
|
||||
val isActive = player.activePet == this
|
||||
|
||||
val baseLoreLocation = if (level == this.maxLevel) "max-level-lore" else "lore"
|
||||
|
||||
return ItemStackBuilder(base)
|
||||
.setDisplayName(
|
||||
plugin.configYml.getFormattedString("gui.pet-icon.name")
|
||||
@@ -370,7 +372,7 @@ class Pet(
|
||||
.replace("%pet%", this.name)
|
||||
)
|
||||
.addLoreLines {
|
||||
injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-icon.lore"), player) +
|
||||
injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-icon.$baseLoreLocation"), player) +
|
||||
if (isActive) plugin.configYml.getStrings("gui.pet-icon.active-lore") else
|
||||
plugin.configYml.getStrings("gui.pet-icon.not-active-lore")
|
||||
}
|
||||
@@ -379,6 +381,9 @@ class Pet(
|
||||
|
||||
fun getPetInfoIcon(player: Player): ItemStack {
|
||||
val base = baseItem.clone()
|
||||
|
||||
val prefix = if (player.getPetLevel(this) == this.maxLevel) "max-level-" else ""
|
||||
|
||||
return ItemStackBuilder(base)
|
||||
.setDisplayName(
|
||||
plugin.configYml.getFormattedString("gui.pet-info.active.name")
|
||||
@@ -386,7 +391,7 @@ class Pet(
|
||||
.replace("%pet%", this.name)
|
||||
)
|
||||
.addLoreLines {
|
||||
injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-info.active.lore"), player)
|
||||
injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-info.active.${prefix}lore"), player)
|
||||
}
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ class PetLevelGUI(
|
||||
override fun getLevelItem(player: Player, menu: Menu, level: Int, levelState: LevelState): ItemStack {
|
||||
val key = levelState.name.lowercase().replace("_", "-")
|
||||
|
||||
val prefix = if (player.getPetLevel(pet) == pet.maxLevel) "max-level-" else ""
|
||||
|
||||
return ItemStackBuilder(Items.lookup(plugin.configYml.getString("level-gui.progression-slots.$key.item")))
|
||||
.setDisplayName(
|
||||
plugin.configYml.getFormattedString("level-gui.progression-slots.$key.name")
|
||||
@@ -44,7 +46,7 @@ class PetLevelGUI(
|
||||
)
|
||||
.addLoreLines(
|
||||
pet.injectPlaceholdersInto(
|
||||
plugin.configYml.getFormattedStrings("level-gui.progression-slots.$key.lore"),
|
||||
plugin.configYml.getFormattedStrings("level-gui.progression-slots.$key.${prefix}lore"),
|
||||
player,
|
||||
forceLevel = level
|
||||
)
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
# by Auxilor
|
||||
#
|
||||
|
||||
# Even if eco is set up to use a database, you can
|
||||
# force EcoPets to save to local storage to disable
|
||||
# cross-server sync.
|
||||
use-local-storage: false
|
||||
|
||||
discover-recipes: true
|
||||
|
||||
gui:
|
||||
@@ -64,6 +69,20 @@ gui:
|
||||
- ""
|
||||
- "&eClick to view Level Progression!"
|
||||
|
||||
# By default, the lore for the max level is the same,
|
||||
# but you can change this if you want.
|
||||
max-level-lore:
|
||||
- "%description%"
|
||||
- "&f"
|
||||
- "&fEffects:"
|
||||
- "%effects%"
|
||||
- ""
|
||||
- "&fProgress:"
|
||||
- "&8» &e%percentage_progress%%"
|
||||
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
|
||||
- ""
|
||||
- "&eClick to view Level Progression!"
|
||||
|
||||
pet-icon:
|
||||
name: "%pet% &fLvl. &a%level%"
|
||||
lore:
|
||||
@@ -76,6 +95,18 @@ gui:
|
||||
- "&8» &e%percentage_progress%%"
|
||||
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
|
||||
|
||||
# By default, the lore for the max level is the same,
|
||||
# but you can change this if you want.
|
||||
max-level-lore:
|
||||
- "%description%"
|
||||
- "&f"
|
||||
- "&fEffects:"
|
||||
- "%effects%"
|
||||
- ""
|
||||
- "&fProgress:"
|
||||
- "&8» &e%percentage_progress%%"
|
||||
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
|
||||
|
||||
active-lore:
|
||||
- ""
|
||||
- "&cThis pet is already active!"
|
||||
@@ -198,6 +229,17 @@ level-gui:
|
||||
- "&fProgress:"
|
||||
- "&8» &e%percentage_progress%%"
|
||||
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
|
||||
|
||||
# By default, the lore for the max level is the same,
|
||||
# but you can change this if you want.
|
||||
max-level-lore:
|
||||
- "&f"
|
||||
- "&fRewards:"
|
||||
- "%rewards%"
|
||||
- "&f"
|
||||
- "&fProgress:"
|
||||
- "&8» &e%percentage_progress%%"
|
||||
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
|
||||
locked:
|
||||
item: red_stained_glass_pane
|
||||
name: "%pet% &fLvl. &a%level%"
|
||||
|
||||
@@ -7,6 +7,8 @@ messages:
|
||||
|
||||
needs-player: "&cYou must specify a player!"
|
||||
gave-xp: "&fYou have given &a%xp% &fXP to %player%&f's %pet%&f!"
|
||||
gave-current-xp: "&fYou have given &a%xp% &fXP to %player%&f's currently active pet!"
|
||||
no-pet: "&cThe player doesn't have a pet active!"
|
||||
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!"
|
||||
|
||||
@@ -33,6 +33,7 @@ permissions:
|
||||
ecopets.command.give: true
|
||||
ecopets.command.giveegg: true
|
||||
ecopets.command.givexp: true
|
||||
ecopets.command.givecurrentxp: true
|
||||
ecopets.command.reset: true
|
||||
ecopets.command.activate: true
|
||||
ecopets.command.deactivate: true
|
||||
@@ -55,6 +56,9 @@ permissions:
|
||||
ecopets.command.givexp:
|
||||
description: Allows the use of /ecopets givexp.
|
||||
default: op
|
||||
ecopets.command.givecurrentxp:
|
||||
description: Allows the use of /ecopets givecurrentxp.
|
||||
default: op
|
||||
ecopets.command.reset:
|
||||
description: Allows the use of /ecopets reset.
|
||||
default: op
|
||||
|
||||
@@ -35,6 +35,7 @@ permissions:
|
||||
ecopets.command.give: true
|
||||
ecopets.command.giveegg: true
|
||||
ecopets.command.givexp: true
|
||||
ecopets.command.givecurrentxp: true
|
||||
ecopets.command.reset: true
|
||||
ecopets.command.activate: true
|
||||
ecopets.command.deactivate: true
|
||||
@@ -57,6 +58,9 @@ permissions:
|
||||
ecopets.command.givexp:
|
||||
description: Allows the use of /ecopets givexp.
|
||||
default: op
|
||||
ecopets.command.givecurrentxp:
|
||||
description: Allows the use of /ecopets givecurrentxp.
|
||||
default: op
|
||||
ecopets.command.reset:
|
||||
description: Allows the use of /ecopets reset.
|
||||
default: op
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#libreforge-updater
|
||||
#Tue Aug 15 18:54:18 BST 2023
|
||||
#Fri Nov 10 13:59:34 GMT 2023
|
||||
kotlin.code.style=official
|
||||
libreforge-version=4.29.0
|
||||
version=2.29.0
|
||||
libreforge-version=4.41.0
|
||||
version=2.41.0
|
||||
|
||||
Reference in New Issue
Block a user