Improved Player Experience Display (#6)

Updated the Player Experience Display in the UpgradesGUI to show both the current experience of the player and the experience required to level up. This provides a clearer oversight for players on their progress towards the next island level. This changes only affects the user interface.
This commit is contained in:
Stijn 2024-02-18 16:43:39 +01:00 committed by GitHub
parent d1c8d29cde
commit 2b69335b2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ public class UpgradesGUI extends GUIInventory {
addButton(12, createMenuButton(Material.EXPERIENCE_BOTTLE, "Increase your island level", List.of(
"<white>Use your experience to upgrade your island level.",
"",
"<white><gold>" + Experience.getExpToNextIslandLevel(island.level()) + "</gold> experience required to level up!"
"<white>You're at <gold>" + player.getTotalExperience() + "/" + Experience.getExpToNextIslandLevel(island.level()) + "</gold> experience required to level up!"
),event -> {
int xp = Experience.getExpToNextIslandLevel(island.level());
if (player.getLevel() >= 0 && player.getTotalExperience() < xp) {