diff --git a/Changelog.txt b/Changelog.txt index 3a2271fc7..b7afe197b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -87,6 +87,9 @@ Version 2.2.000 Parties got unnecessarily complex in my absence, I have removed many party features in order to simplify parties and bring them closer to my vision. I have also added new features which should improve parties where it matters. About the removed party features, all the features I removed I consider poor quality features and I don't think they belong in mcMMO. Feel free to yell at me in discord if you disagree. I don't know what genius decided to make parties public by default, when I found out that parties had been changed to such a system I could barely contain my disgust. Parties are back to being private, you get invited by a party leader or party officer. That is the only way to join a party. +Version 2.1.157 + Fixed a NPE that prevented mctop (Leaderboards) from working + Version 2.1.156 Added Woodcutting skill 'Knock on Wood' - This ability gives you goodies (saplings, xp orbs, apples, etc) when using Tree Feller Tree Feller no longer gives non-wood items by default, it now requires Knock on Wood for additional loot diff --git a/src/main/java/com/gmail/nossr50/database/DatabaseManager.java b/src/main/java/com/gmail/nossr50/database/DatabaseManager.java index 8fa51122e..2c5e6235a 100644 --- a/src/main/java/com/gmail/nossr50/database/DatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/DatabaseManager.java @@ -9,12 +9,10 @@ import com.gmail.nossr50.datatypes.player.MMODataSnapshot; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import org.apache.commons.lang.NullArgumentException; -import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; import java.util.List; import java.util.Map; import java.util.UUID; @@ -60,13 +58,14 @@ public interface DatabaseManager { /** * Retrieve leaderboard info. + * Will never be null but it may be empty * * @param skill The skill to retrieve info on * @param pageNumber Which page in the leaderboards to retrieve * @param statsPerPage The number of stats per page * @return the requested leaderboard information */ - @NotNull List readLeaderboard(@NotNull PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException; + @NotNull List readLeaderboard(@Nullable PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException; /** * Retrieve rank info into a HashMap from PrimarySkillType to the rank. diff --git a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java index a3a48a49e..82d4b36e5 100644 --- a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java @@ -405,11 +405,11 @@ public final class SQLDatabaseManager extends AbstractDatabaseManager { return success; } - public @NotNull List readLeaderboard(@NotNull PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException { + public @NotNull List readLeaderboard(@Nullable PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException { List stats = new ArrayList<>(); //Fix for a plugin that people are using that is throwing SQL errors - if(skill.isChildSkill()) { + if(skill != null && skill.isChildSkill()) { mcMMO.p.getLogger().severe("A plugin hooking into mcMMO is being naughty with our database commands, update all plugins that hook into mcMMO and contact their devs!"); throw new InvalidSkillException("A plugin hooking into mcMMO that you are using is attempting to read leaderboard skills for child skills, child skills do not have leaderboards! This is NOT an mcMMO error!"); }