From 984563cb766839d012371f8f56aabaf61bcb8c6f Mon Sep 17 00:00:00 2001 From: YanisBft Date: Tue, 10 Jan 2023 19:18:08 +0100 Subject: [PATCH] Update to 1.19.3 - 1.4.2 --- gradle.properties | 6 +++--- src/main/java/fr/peaceandcube/pacprofile/gui/ClaimsGui.java | 6 +++--- src/main/java/fr/peaceandcube/pacprofile/gui/HomesGui.java | 6 +++--- .../fr/peaceandcube/pacprofile/gui/OnlinePlayersGui.java | 6 +++--- .../java/fr/peaceandcube/pacprofile/gui/ProfileGui.java | 2 +- src/main/resources/plugin.yml | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8a6e282..1d0a978 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ pacprofile_group = fr.peaceandcube pacprofile_name = pacprofile -pacprofile_version = 1.4.1 +pacprofile_version = 1.4.2 -paper_version = 1.19.2-R0.1-SNAPSHOT +paper_version = 1.19.3-R0.1-SNAPSHOT -anvilgui_version = 1.5.3-20220809.170244-11 +anvilgui_version = 1.6.3-20221221.160308-1 luckperms_version = 5.4 essentials_version = 2.19.7 griefprevention_version = 16.18 diff --git a/src/main/java/fr/peaceandcube/pacprofile/gui/ClaimsGui.java b/src/main/java/fr/peaceandcube/pacprofile/gui/ClaimsGui.java index 4f83701..cc39179 100644 --- a/src/main/java/fr/peaceandcube/pacprofile/gui/ClaimsGui.java +++ b/src/main/java/fr/peaceandcube/pacprofile/gui/ClaimsGui.java @@ -197,10 +197,10 @@ else if (CLAIM_SLOTS.containsKey(slot - 2)) { .title(Messages.CLAIM_NAME_TITLE) .text(PACProfile.getInstance().playerData.getClaimName(this.player.getUniqueId(), CLAIM_SLOTS.get(slot - 2))) .itemLeft(new ItemStack(Material.PAPER)) - .onComplete(((p, s) -> { - PACProfile.getInstance().playerData.setClaimName(p.getUniqueId(), CLAIM_SLOTS.get(slot - 2), s); + .onComplete((completion -> { + PACProfile.getInstance().playerData.setClaimName(completion.getPlayer().getUniqueId(), CLAIM_SLOTS.get(slot - 2), completion.getText()); new ClaimsGui(this.viewer, this.player, this.page, this.maxPages).open(); - return AnvilGUI.Response.close(); + return List.of(AnvilGUI.ResponseAction.close()); })) .open(this.viewer); } diff --git a/src/main/java/fr/peaceandcube/pacprofile/gui/HomesGui.java b/src/main/java/fr/peaceandcube/pacprofile/gui/HomesGui.java index cc29e3a..944f5f2 100644 --- a/src/main/java/fr/peaceandcube/pacprofile/gui/HomesGui.java +++ b/src/main/java/fr/peaceandcube/pacprofile/gui/HomesGui.java @@ -166,10 +166,10 @@ else if (HOME_SLOTS.containsKey(slot - 1)) { .title(Messages.HOME_NOTES_TITLE) .text(PACProfile.getInstance().playerData.getHomeNotes(this.player.getUniqueId(), HOME_SLOTS.get(slot - 1))) .itemLeft(new ItemStack(Material.PAPER)) - .onComplete(((p, s) -> { - PACProfile.getInstance().playerData.setHomeNotes(p.getUniqueId(), HOME_SLOTS.get(slot - 1), s); + .onComplete((completion -> { + PACProfile.getInstance().playerData.setHomeNotes(completion.getPlayer().getUniqueId(), HOME_SLOTS.get(slot - 1), completion.getText()); new HomesGui(this.viewer, this.player, this.page, this.maxPages).open(); - return AnvilGUI.Response.close(); + return List.of(AnvilGUI.ResponseAction.close()); })) .open(this.viewer); } diff --git a/src/main/java/fr/peaceandcube/pacprofile/gui/OnlinePlayersGui.java b/src/main/java/fr/peaceandcube/pacprofile/gui/OnlinePlayersGui.java index 8ec3ed7..ba4069a 100644 --- a/src/main/java/fr/peaceandcube/pacprofile/gui/OnlinePlayersGui.java +++ b/src/main/java/fr/peaceandcube/pacprofile/gui/OnlinePlayersGui.java @@ -147,10 +147,10 @@ else if (PLAYERS_SLOTS.containsKey(slot - 1)) { .title(Messages.ONLINE_PLAYER_NOTES_TITLE) .text(PACProfile.getInstance().playerData.getPlayerNotes(this.player.getUniqueId(), PLAYERS_SLOTS.get(slot - 1).getUniqueId().toString())) .itemLeft(new ItemStack(Material.PAPER)) - .onComplete(((p, s) -> { - PACProfile.getInstance().playerData.setPlayerNotes(p.getUniqueId(), PLAYERS_SLOTS.get(slot - 1).getUniqueId().toString(), s); + .onComplete((completion -> { + PACProfile.getInstance().playerData.setPlayerNotes(completion.getPlayer().getUniqueId(), PLAYERS_SLOTS.get(slot - 1).getUniqueId().toString(), completion.getText()); new OnlinePlayersGui(this.viewer, this.player, this.page, this.maxPages).open(); - return AnvilGUI.Response.close(); + return List.of(AnvilGUI.ResponseAction.close()); })) .open(this.viewer); } diff --git a/src/main/java/fr/peaceandcube/pacprofile/gui/ProfileGui.java b/src/main/java/fr/peaceandcube/pacprofile/gui/ProfileGui.java index f4aa6ca..b0c712c 100644 --- a/src/main/java/fr/peaceandcube/pacprofile/gui/ProfileGui.java +++ b/src/main/java/fr/peaceandcube/pacprofile/gui/ProfileGui.java @@ -196,7 +196,7 @@ private String getRank() { User user = PACProfile.getLuckPerms().getUserManager().getUser(this.player.getUniqueId()); if (user != null) { Group group = PACProfile.getLuckPerms().getGroupManager().getGroup(user.getPrimaryGroup()); - if (group != null) { + if (group != null && group.getDisplayName() != null) { return group.getDisplayName(); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 800a7a3..52deb51 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -3,7 +3,7 @@ main: fr.peaceandcube.pacprofile.PACProfile version: ${version} author: YanisBft website: https://github.com/PeaceAndCubeMC/PACProfile -api-version: 1.18 +api-version: 1.19 depend: - LuckPerms