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 ...
// WorldBorder
addButton(10, createMenuButton(Material.GRASS_BLOCK, "Expand The world border", new ArrayList<>(), event -> {
World islandWorld = CometSkyBlockPlugin.instance().worldGenerator().loadIslandWorld(island.worldName());
if (islandWorld == null) {
player.sendRichMessage("<red>Could not load islandWorld. Contact an administrator");
return;
}
WorldBorder worldBorder = islandWorld.getWorldBorder();
worldBorder.setSize(worldBorder.getSize() + 250);
// World islandWorld = CometSkyBlockPlugin.instance().worldGenerator().loadIslandWorld(island.worldName());
// if (islandWorld == null) {
// player.sendRichMessage("<red>Could not load islandWorld. Contact an administrator");
// return;
// }
// WorldBorder worldBorder = islandWorld.getWorldBorder();
// worldBorder.setSize(worldBorder.getSize() + 250);
}));
// Cobble Gen
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>"));
return;
}
Experience.changeExp(player, player.getTotalExperience() - xp);
Experience.changeExp(player, - xp);
player.sendRichMessage(islandMessages.level().upgraded());
}));
// Difficulty
super.decorate(player);