Send message when Island levels up.

This commit is contained in:
Len 2024-02-11 15:14:22 +01:00
parent db4ab33bde
commit da2f50032d

View File

@ -36,13 +36,13 @@ public class UpgradesGUI extends GUIInventory {
// Todo - move to handlers, add costs, validation ... // Todo - move to handlers, add costs, validation ...
// WorldBorder // WorldBorder
addButton(10, createMenuButton(Material.GRASS_BLOCK, "Expand The world border", new ArrayList<>(), event -> { addButton(10, createMenuButton(Material.GRASS_BLOCK, "Expand The world border", new ArrayList<>(), event -> {
World islandWorld = CometSkyBlockPlugin.instance().worldGenerator().loadIslandWorld(island.worldName()); // World islandWorld = CometSkyBlockPlugin.instance().worldGenerator().loadIslandWorld(island.worldName());
if (islandWorld == null) { // if (islandWorld == null) {
player.sendRichMessage("<red>Could not load islandWorld. Contact an administrator"); // player.sendRichMessage("<red>Could not load islandWorld. Contact an administrator");
return; // return;
} // }
WorldBorder worldBorder = islandWorld.getWorldBorder(); // WorldBorder worldBorder = islandWorld.getWorldBorder();
worldBorder.setSize(worldBorder.getSize() + 250); // worldBorder.setSize(worldBorder.getSize() + 250);
})); }));
// Cobble Gen // Cobble Gen
addButton(11, createMenuButton(Material.COBBLESTONE, "Upgrade your cobble stone generator", new ArrayList<>(), event -> { addButton(11, createMenuButton(Material.COBBLESTONE, "Upgrade your cobble stone generator", new ArrayList<>(), event -> {
@ -65,7 +65,8 @@ public class UpgradesGUI extends GUIInventory {
player.sendRichMessage(islandMessages.level().requiredXp(), Placeholder.parsed("requiredxp", "<gold>" + xp + "</gold>")); player.sendRichMessage(islandMessages.level().requiredXp(), Placeholder.parsed("requiredxp", "<gold>" + xp + "</gold>"));
return; return;
} }
Experience.changeExp(player, player.getTotalExperience() - xp); Experience.changeExp(player, - xp);
player.sendRichMessage(islandMessages.level().upgraded());
})); }));
// Difficulty // Difficulty
super.decorate(player); super.decorate(player);