From 11668b3767d01b5623ae71c03436bda90502d95b Mon Sep 17 00:00:00 2001 From: Sam Ryan Date: Wed, 1 Sep 2021 00:23:36 -0400 Subject: [PATCH 01/10] Added /skill rank --- .../willfp/ecoskills/commands/CommandRank.kt | 115 ++++++++++++++++++ .../ecoskills/commands/CommandSkills.kt | 1 + .../ecoskills/data/LeaderboardHandler.kt | 58 +++++++-- .../core-plugin/src/main/resources/plugin.yml | 4 + 4 files changed, 170 insertions(+), 8 deletions(-) create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt new file mode 100644 index 0000000..ec650c4 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt @@ -0,0 +1,115 @@ +package com.willfp.ecoskills.commands + +import com.willfp.eco.core.EcoPlugin +import com.willfp.eco.core.command.CommandHandler +import com.willfp.eco.core.command.TabCompleteHandler +import com.willfp.eco.core.command.impl.Subcommand +import com.willfp.eco.util.StringUtils +import com.willfp.ecoskills.data.LeaderboardHandler +import com.willfp.ecoskills.getSkillLevel +import com.willfp.ecoskills.getStatLevel +import com.willfp.ecoskills.getTotalSkillLevel +import com.willfp.ecoskills.skills.Skills +import com.willfp.ecoskills.stats.Stats +import com.willfp.ecoskills.util.TabCompleteHelper +import org.bukkit.Bukkit +import org.bukkit.command.CommandSender +import org.bukkit.entity.Player +import org.bukkit.util.StringUtil + + +class CommandRank(plugin: EcoPlugin) : + Subcommand( + plugin, + "rank", + "ecoskills.command.rank", + false + ) { + override fun getHandler(): CommandHandler { + return CommandHandler { sender: CommandSender, args: List -> + if (args.isEmpty()) { + sender.sendMessage(plugin.langYml.getMessage("requires-skill-stat")) + return@CommandHandler + } + + val page = args[0].toIntOrNull() ?: 1 + + if (page < 1 || page > LeaderboardHandler.totalPages()) { + sender.sendMessage( + plugin.langYml.getMessage("invalid-page-number") + .replace("%min_page_number%", "1") + .replace("%max_page_number%", LeaderboardHandler.totalPages().toString()) + ) + return@CommandHandler + } + + val currentSkill = Skills.getByID(args[0].lowercase()) + + + if (currentSkill == null) { + sender.sendMessage(plugin.langYml.getMessage("invalid-skill-stat")) + return@CommandHandler + } + + val top = LeaderboardHandler.getPage(page, skill = currentSkill) + + +// if (currentSkill != null) { +// val top = LeaderboardHandler.getPage(page, currentSkill) +// } +// if (currentStat != null) { +// val top = LeaderboardHandler.getPage(page, currentSkill) +// } + + + val messages = plugin.langYml.getStrings("top", false).toMutableList() + val lines = mutableListOf() + + val useDisplayName = plugin.configYml.getBool("commands.rank.use-display-name") + + for ((rank, player) in top) { + var line = plugin.langYml.getString("top-line-format", false) + .replace("%rank%", rank.toString()) + .replace("%level%", player.getSkillLevel(currentSkill).toString()) + + + var name = player.name!! + + if (useDisplayName && player is Player) { + name = player.displayName + } + + line = line.replace("%playername%", name) + + lines.add(line) + } + + val linesIndex = messages.indexOf("%lines%") + if (linesIndex != -1) { + messages.removeAt(linesIndex) + messages.addAll(linesIndex, lines) + } + + for (message in messages) { + sender.sendMessage(StringUtils.format(message)) + } + } + } + + override fun getTabCompleter(): TabCompleteHandler { + return TabCompleteHandler { _, args -> + val completions = mutableListOf() + + if (args.size == 1) { + StringUtil.copyPartialMatches( + args[0], + TabCompleteHelper.SKILL_NAMES, + completions + ) + return@TabCompleteHandler completions + } + return@TabCompleteHandler emptyList() + } + } + +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt index 66ae512..3d4ef9b 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt @@ -17,6 +17,7 @@ class CommandSkills(plugin: EcoPlugin) : init { this.addSubcommand(CommandTop(plugin)) + this.addSubcommand(CommandRank(plugin)) } override fun getHandler(): CommandHandler { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt index 8fbe956..c93eb40 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt @@ -1,6 +1,11 @@ package com.willfp.ecoskills.data +import com.willfp.ecoskills.getSkillLevel +import com.willfp.ecoskills.getStatLevel import com.willfp.ecoskills.getTotalSkillLevel +import com.willfp.ecoskills.skills.Skill +import com.willfp.ecoskills.skills.Skills +import com.willfp.ecoskills.stats.Stats import org.bukkit.Bukkit import org.bukkit.OfflinePlayer import kotlin.math.ceil @@ -10,15 +15,22 @@ import kotlin.math.min class LeaderboardHandler { companion object { val sortedLeaderboard = mutableListOf() + val sortedLeaderboardPerSkillStat = mutableMapOf>() - fun getPage(page: Int): MutableMap { - val maxPage = ceil(sortedLeaderboard.size / 10.0).toInt() + fun getPage(page: Int, skill: Skill? = null): MutableMap { + var selectedLeaderboard = sortedLeaderboard + + if (skill is Skill) { + selectedLeaderboard = sortedLeaderboardPerSkillStat.getOrDefault(skill.toString(), mutableListOf()) + } + + val maxPage = ceil(selectedLeaderboard.size / 10.0).toInt() val finalPage = max(1, min(page, maxPage)) val startIndex = (finalPage - 1) * 10 - val endIndex = min(startIndex + 10, sortedLeaderboard.size - 1) + val endIndex = min(startIndex + 10, selectedLeaderboard.size - 1) - val players = sortedLeaderboard.subList(startIndex, endIndex) + val players = selectedLeaderboard.subList(startIndex, endIndex) val withRank = mutableMapOf() var rank = startIndex + 1 @@ -29,24 +41,54 @@ class LeaderboardHandler { return withRank } + + fun totalPages(): Int { + return ceil(sortedLeaderboard.size / 10.0).toInt() + } } class Runnable : java.lang.Runnable { override fun run() { - val temp = mutableMapOf() + val playerScoresTop = mutableMapOf() val top = mutableListOf() + val playerScoresSkillsTop = mutableMapOf>() + val playerScoresSkills = mutableMapOf>() for (player in Bukkit.getOfflinePlayers()) { - temp[player] = 10000 - player.getTotalSkillLevel() + playerScoresTop[player] = 10000 - player.getTotalSkillLevel() + for (skill in Skills.values()) { + val skillMap = playerScoresSkills.getOrDefault(skill.toString(), mutableMapOf()) + skillMap[player] = 10000 - player.getSkillLevel(skill) + + playerScoresSkills.put(skill.toString(), skillMap) + } } - val temp2 = temp.toList().sortedBy { (_, value) -> value }.toMap() - for (key in temp2.keys) { + val playerRankedTop = playerScoresTop.toList().sortedBy { (_, value) -> value }.toMap() + val playerScoresSkillsRanked = mutableMapOf>() + + for (s in playerScoresSkills.keys) { + playerScoresSkillsRanked.put(s, playerScoresSkills.get(s)!!.toList().sortedBy { (_, value) -> value }.toMap()) + } + +// val playerRankedTop = playerScoresTop.toList().sortedBy { (_, value) -> value }.toMap() + for (key in playerRankedTop.keys) { top.add(key) } + for (key in playerScoresSkillsRanked.keys) { + val currentList = mutableListOf() + for (qey in playerScoresSkillsRanked.get(key)!!) { + currentList.add(qey.key) + } + playerScoresSkillsTop.put(key, currentList) + } + sortedLeaderboard.clear() sortedLeaderboard.addAll(top) + + sortedLeaderboardPerSkillStat.clear() + sortedLeaderboardPerSkillStat.putAll(playerScoresSkillsTop) } } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/plugin.yml b/eco-core/core-plugin/src/main/resources/plugin.yml index d9c3f3c..4f29d36 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -40,6 +40,7 @@ permissions: ecoskills.command.skills: true ecoskills.command.give: true ecoskills.command.top: true + ecoskills.command.rank: true ecoskills.command.reload: description: Allows reloading the config @@ -56,6 +57,9 @@ permissions: ecoskills.command.top: description: Allows the use of /ecoskills top. default: true + ecoskills.command.rank: + description: Allows the use of /ecoskills rank. + default: true ecoskills.command.give: description: Allows the use of /ecoskills give. default: op From e6c236c5554092749eb56d0204a7694d20ca268d Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 4 Sep 2021 11:52:11 +0100 Subject: [PATCH 02/10] Cleaned up /skills rank pull request --- .../com/willfp/ecoskills/EcoSkillsPlayer.kt | 8 +++ .../willfp/ecoskills/commands/CommandRank.kt | 70 +++++++------------ .../ecoskills/commands/CommandSkills.kt | 2 +- .../willfp/ecoskills/commands/CommandTop.kt | 8 +-- .../ecoskills/data/LeaderboardHandler.kt | 67 +++++++----------- .../core-plugin/src/main/resources/lang.yml | 4 +- 6 files changed, 63 insertions(+), 96 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt index c4438f4..7639700 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt @@ -55,6 +55,14 @@ private fun Player.cacheSkillExperienceMultiplier(): Double { return 1.0 } +fun OfflinePlayer.getSavedDisplayName(): String { + if (this is Player) { + plugin.dataYml.set("player.${this.uniqueId}.name", this.displayName) + } + + return plugin.dataYml.getStringOrNull("player.${this.uniqueId}.name") ?: this.name ?: "Unknown Player" +} + fun OfflinePlayer.getTotalSkillLevel(): Int { var total = 0 for (skill in Skills.values()) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt index ec650c4..a9832e3 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt @@ -6,77 +6,54 @@ import com.willfp.eco.core.command.TabCompleteHandler import com.willfp.eco.core.command.impl.Subcommand import com.willfp.eco.util.StringUtils import com.willfp.ecoskills.data.LeaderboardHandler +import com.willfp.ecoskills.getSavedDisplayName import com.willfp.ecoskills.getSkillLevel -import com.willfp.ecoskills.getStatLevel -import com.willfp.ecoskills.getTotalSkillLevel import com.willfp.ecoskills.skills.Skills -import com.willfp.ecoskills.stats.Stats import com.willfp.ecoskills.util.TabCompleteHelper -import org.bukkit.Bukkit import org.bukkit.command.CommandSender -import org.bukkit.entity.Player import org.bukkit.util.StringUtil class CommandRank(plugin: EcoPlugin) : - Subcommand( - plugin, - "rank", - "ecoskills.command.rank", - false - ) { + Subcommand( + plugin, + "rank", + "ecoskills.command.rank", + false + ) { + override fun getHandler(): CommandHandler { return CommandHandler { sender: CommandSender, args: List -> if (args.isEmpty()) { - sender.sendMessage(plugin.langYml.getMessage("requires-skill-stat")) + sender.sendMessage(plugin.langYml.getMessage("requires-skill")) return@CommandHandler } - val page = args[0].toIntOrNull() ?: 1 + val skill = Skills.getByID(args[0].lowercase()) - if (page < 1 || page > LeaderboardHandler.totalPages()) { - sender.sendMessage( - plugin.langYml.getMessage("invalid-page-number") - .replace("%min_page_number%", "1") - .replace("%max_page_number%", LeaderboardHandler.totalPages().toString()) - ) + if (skill == null) { + sender.sendMessage(plugin.langYml.getMessage("invalid-skill")) return@CommandHandler } - val currentSkill = Skills.getByID(args[0].lowercase()) + val page = if (args.size < 2) 1 else args[1].toIntOrNull() ?: 1 + val top = LeaderboardHandler.getPage(page, skill) - if (currentSkill == null) { - sender.sendMessage(plugin.langYml.getMessage("invalid-skill-stat")) - return@CommandHandler - } - - val top = LeaderboardHandler.getPage(page, skill = currentSkill) - - -// if (currentSkill != null) { -// val top = LeaderboardHandler.getPage(page, currentSkill) -// } -// if (currentStat != null) { -// val top = LeaderboardHandler.getPage(page, currentSkill) -// } - - - val messages = plugin.langYml.getStrings("top", false).toMutableList() + val messages = plugin.langYml.getStrings("top", false) val lines = mutableListOf() val useDisplayName = plugin.configYml.getBool("commands.rank.use-display-name") for ((rank, player) in top) { var line = plugin.langYml.getString("top-line-format", false) - .replace("%rank%", rank.toString()) - .replace("%level%", player.getSkillLevel(currentSkill).toString()) - + .replace("%rank%", rank.toString()) + .replace("%level%", player.getSkillLevel(skill).toString()) var name = player.name!! - if (useDisplayName && player is Player) { - name = player.displayName + if (useDisplayName) { + name = player.getSavedDisplayName() } line = line.replace("%playername%", name) @@ -102,13 +79,14 @@ class CommandRank(plugin: EcoPlugin) : if (args.size == 1) { StringUtil.copyPartialMatches( - args[0], - TabCompleteHelper.SKILL_NAMES, - completions + args[0], + TabCompleteHelper.SKILL_NAMES, + completions ) return@TabCompleteHandler completions } - return@TabCompleteHandler emptyList() + + return@TabCompleteHandler emptyList() } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt index 3d4ef9b..3fc9af0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandSkills.kt @@ -17,7 +17,7 @@ class CommandSkills(plugin: EcoPlugin) : init { this.addSubcommand(CommandTop(plugin)) - this.addSubcommand(CommandRank(plugin)) + .addSubcommand(CommandRank(plugin)) } override fun getHandler(): CommandHandler { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index e7fcc83..e49c194 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -5,9 +5,9 @@ import com.willfp.eco.core.command.CommandHandler import com.willfp.eco.core.command.impl.Subcommand import com.willfp.eco.util.StringUtils import com.willfp.ecoskills.data.LeaderboardHandler +import com.willfp.ecoskills.getSavedDisplayName import com.willfp.ecoskills.getTotalSkillLevel import org.bukkit.command.CommandSender -import org.bukkit.entity.Player class CommandTop(plugin: EcoPlugin) : @@ -22,7 +22,7 @@ class CommandTop(plugin: EcoPlugin) : val page = args.firstOrNull()?.toIntOrNull() ?: 1 val top = LeaderboardHandler.getPage(page) - val messages = plugin.langYml.getStrings("top", false).toMutableList() + val messages = plugin.langYml.getStrings("top", false) val lines = mutableListOf() val useDisplayName = plugin.configYml.getBool("commands.top.use-display-name") @@ -34,8 +34,8 @@ class CommandTop(plugin: EcoPlugin) : var name = player.name!! - if (useDisplayName && player is Player) { - name = player.displayName + if (useDisplayName) { + name = player.getSavedDisplayName() } line = line.replace("%playername%", name) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt index c93eb40..969de5d 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/LeaderboardHandler.kt @@ -1,11 +1,9 @@ package com.willfp.ecoskills.data import com.willfp.ecoskills.getSkillLevel -import com.willfp.ecoskills.getStatLevel import com.willfp.ecoskills.getTotalSkillLevel import com.willfp.ecoskills.skills.Skill import com.willfp.ecoskills.skills.Skills -import com.willfp.ecoskills.stats.Stats import org.bukkit.Bukkit import org.bukkit.OfflinePlayer import kotlin.math.ceil @@ -14,15 +12,11 @@ import kotlin.math.min class LeaderboardHandler { companion object { - val sortedLeaderboard = mutableListOf() - val sortedLeaderboardPerSkillStat = mutableMapOf>() + private val sortedLeaderboard = mutableListOf() + private val skillLeaderboards = mutableMapOf>() fun getPage(page: Int, skill: Skill? = null): MutableMap { - var selectedLeaderboard = sortedLeaderboard - - if (skill is Skill) { - selectedLeaderboard = sortedLeaderboardPerSkillStat.getOrDefault(skill.toString(), mutableListOf()) - } + val selectedLeaderboard = if (skill == null) sortedLeaderboard else skillLeaderboards[skill]!! val maxPage = ceil(selectedLeaderboard.size / 10.0).toInt() val finalPage = max(1, min(page, maxPage)) @@ -41,54 +35,41 @@ class LeaderboardHandler { return withRank } - - fun totalPages(): Int { - return ceil(sortedLeaderboard.size / 10.0).toInt() - } } class Runnable : java.lang.Runnable { override fun run() { - val playerScoresTop = mutableMapOf() + for (skill in Skills.values()) { + val temp = mutableMapOf() + val top = mutableListOf() + + for (player in Bukkit.getOfflinePlayers()) { + temp[player] = 10000 - player.getSkillLevel(skill) + } + + val temp2 = temp.toList().sortedBy { (_, value) -> value }.toMap() + for (key in temp2.keys) { + top.add(key) + } + + skillLeaderboards[skill]?.clear() + skillLeaderboards[skill] = top + } + + val temp = mutableMapOf() val top = mutableListOf() - val playerScoresSkillsTop = mutableMapOf>() - val playerScoresSkills = mutableMapOf>() for (player in Bukkit.getOfflinePlayers()) { - playerScoresTop[player] = 10000 - player.getTotalSkillLevel() - for (skill in Skills.values()) { - val skillMap = playerScoresSkills.getOrDefault(skill.toString(), mutableMapOf()) - skillMap[player] = 10000 - player.getSkillLevel(skill) - - playerScoresSkills.put(skill.toString(), skillMap) - } + temp[player] = 10000 - player.getTotalSkillLevel() } - val playerRankedTop = playerScoresTop.toList().sortedBy { (_, value) -> value }.toMap() - val playerScoresSkillsRanked = mutableMapOf>() - - for (s in playerScoresSkills.keys) { - playerScoresSkillsRanked.put(s, playerScoresSkills.get(s)!!.toList().sortedBy { (_, value) -> value }.toMap()) - } - -// val playerRankedTop = playerScoresTop.toList().sortedBy { (_, value) -> value }.toMap() - for (key in playerRankedTop.keys) { + val temp2 = temp.toList().sortedBy { (_, value) -> value }.toMap() + for (key in temp2.keys) { top.add(key) } - for (key in playerScoresSkillsRanked.keys) { - val currentList = mutableListOf() - for (qey in playerScoresSkillsRanked.get(key)!!) { - currentList.add(qey.key) - } - playerScoresSkillsTop.put(key, currentList) - } - sortedLeaderboard.clear() sortedLeaderboard.addAll(top) - - sortedLeaderboardPerSkillStat.clear() - sortedLeaderboardPerSkillStat.putAll(playerScoresSkillsTop) } } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index 7efa32d..3b6e90e 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -7,8 +7,8 @@ messages: requires-player: "&cYou must specify a player!" invalid-player: "&cInvalid player!" reset-player: "&fReset player!" - requires-skill-stat: "&cYou must specify a skill or stat!" - invalid-skill-stat: "&cInvalid a skill or stat!" + requires-skill: "&cYou must specify a skill!" + invalid-skill: "&cInvalid skill!" requires-amount: "&cYou must specify the amount!" invalid-amount: "&cInvalid amount!" gave-skill-xp: "Gave %player% %amount% %skill% experience!" From 9aa93169f2e62b309ffe48e6c5d30a9d93b24969 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 4 Sep 2021 11:53:53 +0100 Subject: [PATCH 03/10] Updated to 1.1.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 61d191c..4ada219 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 1.0.6 +version = 1.1.0 plugin-name = EcoSkills \ No newline at end of file From 9ec363d7c1a9d8c0e8a68a51da57e7fb97ec4f87 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 4 Sep 2021 11:54:18 +0100 Subject: [PATCH 04/10] Fixed getMinimumEcoVersion --- .../src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java index 15a4118..636ede9 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java @@ -137,4 +137,9 @@ public class EcoSkillsPlugin extends EcoPlugin { new IntegrationLoader("EcoEnchants", () -> this.getEventManager().registerListener(new EcoEnchantsEnchantingLeveller(this))) ); } + + @Override + public String getMinimumEcoVersion() { + return "6.6.0"; + } } From 3ff8e7f919f63deda6651e49ed69c5c65d59d0d9 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 5 Sep 2021 11:36:09 +0100 Subject: [PATCH 05/10] Improved data storage --- .../willfp/ecoskills/api/EcoSkillsAPI.java | 6 +-- .../com/willfp/ecoskills/EcoSkillsPlayer.kt | 39 ++++--------------- .../willfp/ecoskills/api/EcoSkillsAPIImpl.kt | 6 +-- .../willfp/ecoskills/commands/CommandRank.kt | 4 +- .../willfp/ecoskills/commands/CommandTop.kt | 4 +- .../com/willfp/ecoskills/data/DataListener.kt | 25 ++++++++++-- .../ecoskills/data/SavedPlayerNameListener.kt | 36 +++++++++++++++++ 7 files changed, 75 insertions(+), 45 deletions(-) create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/SavedPlayerNameListener.kt diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/api/EcoSkillsAPI.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/api/EcoSkillsAPI.java index 4b8acaf..b70014f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/api/EcoSkillsAPI.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/api/EcoSkillsAPI.java @@ -43,7 +43,7 @@ public interface EcoSkillsAPI { * @param skill The skill. * @return The progress. */ - double getSkillProgressToNextLevel(@NotNull Player player, + double getSkillProgressToNextLevel(@NotNull OfflinePlayer player, @NotNull Skill skill); /** @@ -53,7 +53,7 @@ public interface EcoSkillsAPI { * @param skill The skill. * @return The experience required. */ - int getSkillProgressRequired(@NotNull Player player, + int getSkillProgressRequired(@NotNull OfflinePlayer player, @NotNull Skill skill); /** @@ -63,7 +63,7 @@ public interface EcoSkillsAPI { * @param skill The skill. * @return The experience. */ - double getSkillProgress(@NotNull Player player, + double getSkillProgress(@NotNull OfflinePlayer player, @NotNull Skill skill); /** diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt index 7639700..d28de89 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt @@ -3,17 +3,14 @@ package com.willfp.ecoskills import com.willfp.ecoskills.api.PlayerSkillExpGainEvent import com.willfp.ecoskills.api.PlayerSkillLevelUpEvent import com.willfp.ecoskills.effects.Effect -import com.willfp.ecoskills.effects.Effects import com.willfp.ecoskills.skills.Skill import com.willfp.ecoskills.skills.Skills import com.willfp.ecoskills.stats.Stat -import com.willfp.ecoskills.stats.Stats import org.bukkit.Bukkit import org.bukkit.OfflinePlayer import org.bukkit.entity.Entity import org.bukkit.entity.Player import org.bukkit.entity.Projectile -import org.bukkit.persistence.PersistentDataType import java.util.* val expMultiplierCache = mutableMapOf() @@ -55,14 +52,6 @@ private fun Player.cacheSkillExperienceMultiplier(): Double { return 1.0 } -fun OfflinePlayer.getSavedDisplayName(): String { - if (this is Player) { - plugin.dataYml.set("player.${this.uniqueId}.name", this.displayName) - } - - return plugin.dataYml.getStringOrNull("player.${this.uniqueId}.name") ?: this.name ?: "Unknown Player" -} - fun OfflinePlayer.getTotalSkillLevel(): Int { var total = 0 for (skill in Skills.values()) { @@ -107,31 +96,31 @@ fun OfflinePlayer.getSkillLevel(skill: Skill): Int { return plugin.dataYml.getInt("player.${this.uniqueId}.${skill.id}", 0) } -fun Player.setSkillLevel(skill: Skill, level: Int) { +fun OfflinePlayer.setSkillLevel(skill: Skill, level: Int) { plugin.dataYml.set("player.${this.uniqueId}.${skill.id}", level) } -fun Player.getSkillProgressToNextLevel(skill: Skill): Double { +fun OfflinePlayer.getSkillProgressToNextLevel(skill: Skill): Double { return this.getSkillProgress(skill) / this.getSkillProgressRequired(skill) } -fun Player.getSkillProgressRequired(skill: Skill): Int { +fun OfflinePlayer.getSkillProgressRequired(skill: Skill): Int { return skill.getExpForLevel(this.getSkillLevel(skill) + 1) } -fun Player.getSkillProgress(skill: Skill): Double { - return this.persistentDataContainer.getOrDefault(skill.xpKey, PersistentDataType.DOUBLE, 0.0) +fun OfflinePlayer.getSkillProgress(skill: Skill): Double { + return plugin.dataYml.getDoubleOrNull("player.${this.uniqueId}.${skill.xpKey.key}") ?: 0.0 } -fun Player.setSkillProgress(skill: Skill, level: Double) { - this.persistentDataContainer.set(skill.xpKey, PersistentDataType.DOUBLE, level) +fun OfflinePlayer.setSkillProgress(skill: Skill, level: Double) { + plugin.dataYml.set("player.${this.uniqueId}.${skill.xpKey.key}", level) } fun OfflinePlayer.getEffectLevel(effect: Effect): Int { return plugin.dataYml.getInt("player.${this.uniqueId}.${effect.id}", 0) } -fun Player.setEffectLevel(effect: Effect, level: Int) { +fun OfflinePlayer.setEffectLevel(effect: Effect, level: Int) { plugin.dataYml.set("player.${this.uniqueId}.${effect.id}", level) } @@ -144,18 +133,6 @@ fun Player.setStatLevel(stat: Stat, level: Int) { stat.updateStatLevel(this) } -fun Player.convertPersistentToYml() { - for (effect in Effects.values()) { - plugin.dataYml.set("player.${this.uniqueId}.${effect.id}", this.getEffectLevel(effect)) - } - for (stat in Stats.values()) { - plugin.dataYml.set("player.${this.uniqueId}.${stat.id}", this.getStatLevel(stat)) - } - for (skill in Skills.values()) { - plugin.dataYml.set("player.${this.uniqueId}.${skill.id}", this.getSkillLevel(skill)) - } -} - fun Entity.tryAsPlayer(): Player? { return when(this) { is Projectile -> { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/api/EcoSkillsAPIImpl.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/api/EcoSkillsAPIImpl.kt index 23468dd..91809a6 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/api/EcoSkillsAPIImpl.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/api/EcoSkillsAPIImpl.kt @@ -20,15 +20,15 @@ object EcoSkillsAPIImpl: EcoSkillsAPI { player.giveSkillExperience(skill, amount) } - override fun getSkillProgressToNextLevel(player: Player, skill: Skill): Double { + override fun getSkillProgressToNextLevel(player: OfflinePlayer, skill: Skill): Double { return player.getSkillProgressToNextLevel(skill) } - override fun getSkillProgressRequired(player: Player, skill: Skill): Int { + override fun getSkillProgressRequired(player: OfflinePlayer, skill: Skill): Int { return player.getSkillProgressRequired(skill) } - override fun getSkillProgress(player: Player, skill: Skill): Double { + override fun getSkillProgress(player: OfflinePlayer, skill: Skill): Double { return player.getSkillProgress(skill) } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt index a9832e3..af1f747 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandRank.kt @@ -6,7 +6,7 @@ import com.willfp.eco.core.command.TabCompleteHandler import com.willfp.eco.core.command.impl.Subcommand import com.willfp.eco.util.StringUtils import com.willfp.ecoskills.data.LeaderboardHandler -import com.willfp.ecoskills.getSavedDisplayName +import com.willfp.ecoskills.data.savedDisplayName import com.willfp.ecoskills.getSkillLevel import com.willfp.ecoskills.skills.Skills import com.willfp.ecoskills.util.TabCompleteHelper @@ -53,7 +53,7 @@ class CommandRank(plugin: EcoPlugin) : var name = player.name!! if (useDisplayName) { - name = player.getSavedDisplayName() + name = player.savedDisplayName } line = line.replace("%playername%", name) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index e49c194..4b6dfd7 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -5,7 +5,7 @@ import com.willfp.eco.core.command.CommandHandler import com.willfp.eco.core.command.impl.Subcommand import com.willfp.eco.util.StringUtils import com.willfp.ecoskills.data.LeaderboardHandler -import com.willfp.ecoskills.getSavedDisplayName +import com.willfp.ecoskills.data.savedDisplayName import com.willfp.ecoskills.getTotalSkillLevel import org.bukkit.command.CommandSender @@ -35,7 +35,7 @@ class CommandTop(plugin: EcoPlugin) : var name = player.name!! if (useDisplayName) { - name = player.getSavedDisplayName() + name = player.savedDisplayName } line = line.replace("%playername%", name) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt index 846b6f0..9bc9609 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt @@ -1,20 +1,21 @@ package com.willfp.ecoskills.data -import com.willfp.ecoskills.convertPersistentToYml +import com.willfp.ecoskills.* import com.willfp.ecoskills.effects.Effect -import com.willfp.ecoskills.getSkillLevel -import com.willfp.ecoskills.setEffectLevel +import com.willfp.ecoskills.effects.Effects import com.willfp.ecoskills.skills.Skills import com.willfp.ecoskills.stats.Stats import org.bukkit.attribute.Attribute +import org.bukkit.entity.Player import org.bukkit.event.EventHandler import org.bukkit.event.Listener import org.bukkit.event.player.PlayerJoinEvent +import org.bukkit.persistence.PersistentDataType class DataListener : Listener { @EventHandler fun onJoin(event: PlayerJoinEvent) { - event.player.convertPersistentToYml() + event.player.convertFromLegacyData() for (skill in Skills.values()) { for (levelUpReward in skill.getLevelUpRewards()) { @@ -51,4 +52,20 @@ class DataListener : Listener { stat.updateStatLevel(event.player) } } +} + +private fun Player.convertFromLegacyData() { + for (effect in Effects.values()) { + plugin.dataYml.set("player.${this.uniqueId}.${effect.id}", this.getEffectLevel(effect)) + } + for (stat in Stats.values()) { + plugin.dataYml.set("player.${this.uniqueId}.${stat.id}", this.getStatLevel(stat)) + } + for (skill in Skills.values()) { + plugin.dataYml.set("player.${this.uniqueId}.${skill.id}", this.getSkillLevel(skill)) + plugin.dataYml.set( + "player.${this.uniqueId}.${skill.xpKey.key}", + this.persistentDataContainer.getOrDefault(skill.xpKey, PersistentDataType.DOUBLE, 0.0) + ) + } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/SavedPlayerNameListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/SavedPlayerNameListener.kt new file mode 100644 index 0000000..33c0c77 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/SavedPlayerNameListener.kt @@ -0,0 +1,36 @@ +package com.willfp.ecoskills.data + +import com.willfp.eco.core.EcoPlugin +import com.willfp.ecoskills.plugin +import org.bukkit.OfflinePlayer +import org.bukkit.entity.Player +import org.bukkit.event.EventHandler +import org.bukkit.event.Listener +import org.bukkit.event.player.PlayerJoinEvent +import org.bukkit.event.player.PlayerQuitEvent + +class SavedPlayerNameListener( + private val plugin: EcoPlugin +) : Listener { + @EventHandler + fun onJoin(event: PlayerJoinEvent) { + event.player.savedDisplayName = event.player.displayName + } + + @EventHandler + fun onJoin(event: PlayerQuitEvent) { + event.player.savedDisplayName = event.player.displayName + } +} + +var OfflinePlayer.savedDisplayName: String + get() { + if (this is Player) { + plugin.dataYml.set("player.${this.uniqueId}.name", this.displayName) + } + + return plugin.dataYml.getStringOrNull("player.${this.uniqueId}.name") ?: this.name ?: "Unknown Player" + } + set(value) { + plugin.dataYml.set("player.${this.uniqueId}.name", value) + } From 21a7baa316c27e47bb17a74a8e13047452073e53 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 5 Sep 2021 11:46:08 +0100 Subject: [PATCH 06/10] Updated to 1.1.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4ada219..146c583 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 1.1.0 +version = 1.1.1 plugin-name = EcoSkills \ No newline at end of file From 065cd1a4f35ac5b64989e8a74cc03a3733d6d964 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 5 Sep 2021 11:48:36 +0100 Subject: [PATCH 07/10] Urgent fix --- .../kotlin/com/willfp/ecoskills/data/DataListener.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt index 9bc9609..304fb13 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/data/DataListener.kt @@ -63,9 +63,13 @@ private fun Player.convertFromLegacyData() { } for (skill in Skills.values()) { plugin.dataYml.set("player.${this.uniqueId}.${skill.id}", this.getSkillLevel(skill)) - plugin.dataYml.set( - "player.${this.uniqueId}.${skill.xpKey.key}", - this.persistentDataContainer.getOrDefault(skill.xpKey, PersistentDataType.DOUBLE, 0.0) - ) + val prog = this.persistentDataContainer.get(skill.xpKey, PersistentDataType.DOUBLE) + if (prog != null) { + plugin.dataYml.set( + "player.${this.uniqueId}.${skill.xpKey.key}", + prog + ) + this.persistentDataContainer.remove(skill.xpKey) + } } } \ No newline at end of file From 2b2d3271bfad8a5e45512710ef1b6c76e65eee19 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 5 Sep 2021 11:48:47 +0100 Subject: [PATCH 08/10] Updated to 1.1.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 146c583..c8a8733 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 1.1.1 +version = 1.1.2 plugin-name = EcoSkills \ No newline at end of file From 772a66d052598531e1a2d37e265cb18f04dbae2a Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 9 Sep 2021 10:37:11 +0100 Subject: [PATCH 09/10] Added level up commands --- .../com/willfp/ecoskills/skills/Skill.kt | 21 +++++++++++++++++++ .../skills/SkillLevellingListener.kt | 2 ++ .../src/main/resources/skills/alchemy.yml | 2 ++ .../src/main/resources/skills/armory.yml | 2 ++ .../src/main/resources/skills/combat.yml | 2 ++ .../src/main/resources/skills/enchanting.yml | 2 ++ .../src/main/resources/skills/exploration.yml | 2 ++ .../src/main/resources/skills/farming.yml | 2 ++ .../src/main/resources/skills/fishing.yml | 2 ++ .../src/main/resources/skills/mining.yml | 2 ++ .../src/main/resources/skills/woodcutting.yml | 2 ++ 11 files changed, 41 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt index f7eb36a..91839cc 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt @@ -10,6 +10,7 @@ import com.willfp.ecoskills.config.SkillConfig import com.willfp.ecoskills.effects.Effect import com.willfp.ecoskills.effects.Effects import com.willfp.ecoskills.stats.Stats +import org.bukkit.Bukkit import org.bukkit.NamespacedKey import org.bukkit.entity.Player import org.bukkit.event.Listener @@ -27,6 +28,7 @@ abstract class Skill( lateinit var gui: SkillGUI var maxLevel: Int = 50 private val rewards = mutableListOf() + private val levelCommands = mutableMapOf>() // Cached values private val guiLoreCache = mutableMapOf>() @@ -55,6 +57,17 @@ abstract class Skill( } } + levelCommands.clear() + for (string in config.getStrings("rewards.level-commands", false)) { + val split = string.split(":") + val level = split[0].toInt() + val command = split[1] + + val commands = levelCommands[level] ?: mutableListOf() + commands.add(command) + levelCommands[level] = commands + } + PlaceholderEntry( id, { player -> player.getSkillLevel(this).toString() }, @@ -201,6 +214,14 @@ abstract class Skill( return lore } + fun executeLevelCommands(player: Player, level: Int) { + val commands = levelCommands[level] ?: emptyList() + + for (command in commands) { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replace("%player%", player.name)) + } + } + open fun postUpdate() { // Override when needed } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/SkillLevellingListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/SkillLevellingListener.kt index d0e212d..3f53ebd 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/SkillLevellingListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/SkillLevellingListener.kt @@ -31,5 +31,7 @@ class SkillLevellingListener : Listener { } } } + + skill.executeLevelCommands(player, to) } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/skills/alchemy.yml b/eco-core/core-plugin/src/main/resources/skills/alchemy.yml index 29d2897..0aa3407 100644 --- a/eco-core/core-plugin/src/main/resources/skills/alchemy.yml +++ b/eco-core/core-plugin/src/main/resources/skills/alchemy.yml @@ -29,6 +29,8 @@ rewards: - "efficient_brewing::1:10:100" - "mystic_resilience::1" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/armory.yml b/eco-core/core-plugin/src/main/resources/skills/armory.yml index 50ac098..3a73dba 100644 --- a/eco-core/core-plugin/src/main/resources/skills/armory.yml +++ b/eco-core/core-plugin/src/main/resources/skills/armory.yml @@ -29,6 +29,8 @@ rewards: - "infernal_resistance::1" - "bravery::1:10:100" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/combat.yml b/eco-core/core-plugin/src/main/resources/skills/combat.yml index 460b8a8..26dc2cc 100644 --- a/eco-core/core-plugin/src/main/resources/skills/combat.yml +++ b/eco-core/core-plugin/src/main/resources/skills/combat.yml @@ -32,6 +32,8 @@ rewards: - "strong_impact::1:10:100" - "endangering::1:20:100" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/enchanting.yml b/eco-core/core-plugin/src/main/resources/skills/enchanting.yml index bfc6abf..51202b6 100644 --- a/eco-core/core-plugin/src/main/resources/skills/enchanting.yml +++ b/eco-core/core-plugin/src/main/resources/skills/enchanting.yml @@ -29,6 +29,8 @@ rewards: - "reimbursement::1" - "overcompensation::1:10:100" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/exploration.yml b/eco-core/core-plugin/src/main/resources/skills/exploration.yml index 9b2ec8b..25324a9 100644 --- a/eco-core/core-plugin/src/main/resources/skills/exploration.yml +++ b/eco-core/core-plugin/src/main/resources/skills/exploration.yml @@ -29,6 +29,8 @@ rewards: - "dodging::1" - "accelerated_escape::1:10:100" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/farming.yml b/eco-core/core-plugin/src/main/resources/skills/farming.yml index 8d1c9e7..fd1a95b 100644 --- a/eco-core/core-plugin/src/main/resources/skills/farming.yml +++ b/eco-core/core-plugin/src/main/resources/skills/farming.yml @@ -29,6 +29,8 @@ rewards: - "satiation::1" - "golden_yield::1:10:100" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/fishing.yml b/eco-core/core-plugin/src/main/resources/skills/fishing.yml index 2c707fb..f35bc9b 100644 --- a/eco-core/core-plugin/src/main/resources/skills/fishing.yml +++ b/eco-core/core-plugin/src/main/resources/skills/fishing.yml @@ -23,6 +23,8 @@ rewards: - "wisdom::1" - "eye_of_the_depths::1" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/mining.yml b/eco-core/core-plugin/src/main/resources/skills/mining.yml index 308e6cb..43b645f 100644 --- a/eco-core/core-plugin/src/main/resources/skills/mining.yml +++ b/eco-core/core-plugin/src/main/resources/skills/mining.yml @@ -29,6 +29,8 @@ rewards: - "spelunking::1:10:100" - "dynamic_mining::1" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: diff --git a/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml b/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml index 450fcbb..6067cd7 100644 --- a/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml +++ b/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml @@ -26,6 +26,8 @@ rewards: - "craftsmanship::1" - "master_lumberjack::1" + level-commands: [] + # The chat messages to send on level up chat-messages: 1: From 32fbcc39de577127479b561188aba5a6fbb3ac05 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 9 Sep 2021 10:37:21 +0100 Subject: [PATCH 10/10] Updated to 1.2.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c8a8733..8f0283a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 1.1.2 +version = 1.2.0 plugin-name = EcoSkills \ No newline at end of file