Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
178e27e
Take pets out of the pets menu
AverageGithub Sep 15, 2022
b41da5d
Merge branch 'master' of https://github.com/AverageGithub/EcoPets
AverageGithub Sep 15, 2022
9dda3f3
Big commit
AverageGithub Sep 15, 2022
73f8511
Possibly fix not being able to give pets to players after first join
AverageGithub Sep 15, 2022
f6e8b55
I hope this works
AverageGithub Sep 15, 2022
9ece343
Maybe?
AverageGithub Sep 15, 2022
8411209
Fixed
AverageGithub Sep 15, 2022
5652382
Fixed
AverageGithub Sep 15, 2022
a32c817
Fixed the give command bug
AverageGithub Sep 15, 2022
e76c97b
Fixed the give command bug
AverageGithub Sep 16, 2022
4c25722
Clean up
AverageGithub Sep 16, 2022
b839d52
Use DropQueue
AverageGithub Sep 17, 2022
387f16a
Merge remote-tracking branch 'origin/master'
AverageGithub Oct 9, 2022
fffdca4
libreforge-updater
WillFP Oct 10, 2022
a8e4f88
Updated to 1.50.2
WillFP Oct 11, 2022
3cd800a
libreforge-updater
WillFP Oct 13, 2022
42ed601
libreforge-updater
WillFP Oct 16, 2022
d36551a
libreforge-updater
WillFP Oct 18, 2022
08f3340
libreforge-updater
WillFP Oct 19, 2022
6f7b800
Fix
WillFP Oct 19, 2022
35650ef
libreforge-updater
WillFP Oct 21, 2022
ee3c934
libreforge-updater
WillFP Oct 24, 2022
9eea563
Fix
WillFP Oct 24, 2022
84862f7
libreforge-updater
WillFP Oct 26, 2022
ddbd647
libreforge-updater
WillFP Oct 28, 2022
c51b29e
libreforge-updater
WillFP Nov 1, 2022
6fb565f
Added setActivePet to API
WillFP Nov 4, 2022
e369e99
Updated to 1.57.0
WillFP Nov 4, 2022
1a7a92e
Reworked level GUI to use ecomponent
WillFP Nov 6, 2022
1f274b5
libreforge-updater
WillFP Nov 6, 2022
ddaa9d3
libreforge-updater
WillFP Nov 12, 2022
35e9ac1
Merge remote-tracking branch 'origin/master'
AverageGithub Nov 14, 2022
6fdc228
Fixes
AverageGithub Nov 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ allprojects {

shadowJar {
relocate('com.willfp.libreforge', 'com.willfp.ecopets.libreforge')
relocate('com.willfp.ecomponent', 'com.willfp.ecopets.ecomponent')
relocate('org.joml', 'com.willfp.ecopets.libreforge.joml')
}

dependencies {
compileOnly 'com.willfp:eco:6.42.0'
implementation 'com.willfp:libreforge:3.111.0'
compileOnly 'com.willfp:eco:6.44.0'
implementation 'com.willfp:libreforge:3.119.0'
implementation 'com.willfp:ecomponent:1.0.0'
implementation 'org.joml:joml:1.10.4'

compileOnly 'org.jetbrains:annotations:23.0.0'
Expand Down
184 changes: 0 additions & 184 deletions config/checkstyle/checkstyle.xml

This file was deleted.

12 changes: 0 additions & 12 deletions config/checkstyle/suppression.xml

This file was deleted.

2 changes: 1 addition & 1 deletion eco-core/core-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +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:R3.0.0'
compileOnly 'com.ticxo.modelengine:api:R3.0.1'
}

build.dependsOn publishToMavenLocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ internal object EcoPetsAPIImpl : EcoPetsAPI {

override fun getActivePet(player: OfflinePlayer): Pet? = player.activePet

override fun setActivePet(player: OfflinePlayer, pet: Pet?) {
player.activePet = pet
}

override fun getPetLevel(player: OfflinePlayer, pet: Pet) = player.getPetLevel(pet)

override fun givePetExperience(player: Player, pet: Pet, amount: Double) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ class EcoPetsPlugin : LibReforgePlugin() {
)
}

override fun getMinimumEcoVersion(): String {
return "6.37.0"
}

companion object {
@JvmStatic
lateinit var instance: EcoPetsPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface EcoPetsAPI {
* Get if a player has a pet.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @return If the player has the pet unlocked
*/
fun hasPet(
Expand All @@ -28,11 +28,22 @@ interface EcoPetsAPI {
player: OfflinePlayer
): Pet?

/**
* Set a player's active pet.
*
* @param player The player.
* @param pet The pet.
*/
fun setActivePet(
player: OfflinePlayer,
pet: Pet?
)

/**
* Get a player's level of a certain pet.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @return The level.
*/
fun getPetLevel(
Expand All @@ -44,7 +55,7 @@ interface EcoPetsAPI {
* Give pet experience to a player.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @param amount The amount of experience to give.
*/
fun givePetExperience(
Expand All @@ -56,9 +67,9 @@ interface EcoPetsAPI {
/**
* Give pet experience to a player.
*
* @param player The player.
* @param pet The pet.
* @param amount The amount of experience to give.
* @param player The player.
* @param pet The pet.
* @param amount The amount of experience to give.
* @param applyMultipliers If multipliers should be applied.
*/
fun givePetExperience(
Expand All @@ -69,10 +80,11 @@ interface EcoPetsAPI {
)

/**
* Get progress to next level between 0 and 1, where 0 is none and 1 is complete.
* Get progress to next level between 0 and 1, where 0 is none and 1 is
* complete.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @return The progress.
*/
fun getPetProgress(
Expand All @@ -84,7 +96,7 @@ interface EcoPetsAPI {
* Get the experience required to advance to the next level.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @return The experience required.
*/
fun getPetXPRequired(
Expand All @@ -96,7 +108,7 @@ interface EcoPetsAPI {
* Get experience to the next level.
*
* @param player The player.
* @param pet The pet.
* @param pet The pet.
* @return The experience.
*/
fun getPetXP(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CommandActivate(plugin: EcoPlugin) : Subcommand(plugin, "activate", "ecope

if (args.size == 1) {
StringUtil.copyPartialMatches(
args[1],
args[0],
Pets.values().filter { sender.hasPet(it) }.map { it.id },
completions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class CommandEcopets(plugin: EcoPlugin) : PluginCommand(plugin, "ecopets", "ecop
.addSubcommand(CommandGiveEgg(plugin))
.addSubcommand(CommandGiveXP(plugin))
.addSubcommand(CommandReset(plugin))
.addSubcommand(CommandTake(plugin))
}

override fun onExecute(sender: CommandSender, args: List<String>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecopets.comma
@Suppress("DEPRECATION")
val player = Bukkit.getOfflinePlayer(playerName)

if (!player.hasPlayedBefore()) {
if (!player.hasPlayedBefore() && !Bukkit.getOnlinePlayers().contains(player)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ class CommandReset(plugin: EcoPlugin) : Subcommand(plugin, "reset", "ecopets.com
return
}

if (player.activePet == pet) {
player.activePet = null
}
player.setPetXP(pet, 0.0)
player.setPetLevel(pet, 0)
player.setPetLevel(pet, 1)

sender.sendMessage(
plugin.langYml.getMessage("reset-xp", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
plugin.langYml.getMessage("reset", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
.replace("%player%", player.savedDisplayName)
.replace("%pet%", pet.name)
)
Expand Down
Loading