From 0972326141297e948aa6a78d9e30aa5f942a317e Mon Sep 17 00:00:00 2001 From: Wanbin Cao <93872019+Lagggpixel@users.noreply.github.com> Date: Thu, 20 Jun 2024 21:13:45 +0100 Subject: [PATCH 1/3] #patch API changes and new version support (#50) * Major API Revamp for exposing methods that were not exposed previously to external plugins * Fixed move false not working * Added support for 1.20.5, 1.20.6, 1.21 * Fixed holograms display --- .../classic/handlers/hologram/LeaderboardHologram.java | 10 +++++++++- gradle.properties | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java index 77471477..cb9a3493 100644 --- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java +++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java @@ -20,6 +20,7 @@ package plugily.projects.minigamesbox.classic.handlers.hologram; import org.apache.commons.lang.StringUtils; +import org.bukkit.Bukkit; import org.bukkit.Location; import plugily.projects.minigamesbox.api.stats.IStatisticType; import plugily.projects.minigamesbox.classic.PluginMain; @@ -90,7 +91,14 @@ public void delete() { private String getPlayerNameSafely(UUID uuid) { String name = plugin.getUserManager().getDatabase().getPlayerName(uuid); - return name != null ? name : new MessageBuilder("LEADERBOARD_UNKNOWN_PLAYER").asKey().build(); + // Attempts to get the bukkit name instead if the name is null from database or an empty string + if (name == null || name.isBlank()) { + name = Bukkit.getOfflinePlayer(uuid).getName(); + } + if (name == null || name.isBlank()) { + return new MessageBuilder("LEADERBOARD_UNKNOWN_PLAYER").asKey().build(); + } + return name; } private Message statisticToMessage() { diff --git a/gradle.properties b/gradle.properties index ae49ecc7..492c9bb3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ # along with this program. If not, see . # group=plugily.projects -version=1.3.8-SNAPSHOT4 +version=1.3.8-SNAPSHOT5 From 7e6f04d1a5ac35dfe909615a78bf59edb23fad22 Mon Sep 17 00:00:00 2001 From: "version-bump[github-action]" <41898282+version-bump[github-action]@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:15:22 +0000 Subject: [PATCH 2/3] Bump version from 1.3.8-SNAPSHOT5 to 1.3.9 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 492c9bb3..94e26907 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ # along with this program. If not, see . # group=plugily.projects -version=1.3.8-SNAPSHOT5 +version=1.3.9 From c364621a8101a3b74b10f26a7f45cce839266fa7 Mon Sep 17 00:00:00 2001 From: "version-bump[github-action]" <41898282+version-bump[github-action]@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:59:59 +0000 Subject: [PATCH 3/3] Bump version from 1.3.9 to 1.3.9-SNAPSHOT0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 94e26907..27ab3c41 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ # along with this program. If not, see . # group=plugily.projects -version=1.3.9 +version=1.3.9-SNAPSHOT0