diff --git a/build.gradle b/build.gradle index 25d1fe7..425c0b2 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'sh.okx' -version '3.11.2' +version '3.11.3' repositories { mavenCentral() diff --git a/src/main/java/sh/okx/rankup/commands/PrestigeCommand.java b/src/main/java/sh/okx/rankup/commands/PrestigeCommand.java index 36327d9..375ca03 100644 --- a/src/main/java/sh/okx/rankup/commands/PrestigeCommand.java +++ b/src/main/java/sh/okx/rankup/commands/PrestigeCommand.java @@ -66,7 +66,7 @@ public class PrestigeCommand implements CommandExecutor { case "gui": Gui gui = Gui.of(player, prestige, rankElement.getNext().getRank(), plugin, false); if (gui == null) { - player.sendMessage(ChatColor.RED + "GUI is not available. Check console for more informatiopn."); + player.sendMessage(ChatColor.RED + "GUI is not available. Check console for more information."); return true; } gui.open(player); diff --git a/src/main/java/sh/okx/rankup/ranksgui/RanksGui.java b/src/main/java/sh/okx/rankup/ranksgui/RanksGui.java index bd31872..1a94fe4 100644 --- a/src/main/java/sh/okx/rankup/ranksgui/RanksGui.java +++ b/src/main/java/sh/okx/rankup/ranksgui/RanksGui.java @@ -65,13 +65,13 @@ public class RanksGui { ItemStack item = get((section, path0) -> Gui.getItem(plugin, section.getConfigurationSection(path0), player, rankElement0), path, rankPath, basePath, null); inventory.setItem(index++, item); + if (index > rows * 9) { + throw new IllegalArgumentException("Ranks GUI is too small for the number of ranks. Increase the number of rows on the ranks GUI."); + } if (index == rowIndex) { rowIndex += 9; index += 9 - width; } - if (index > rows * 9) { - throw new IllegalArgumentException("Ranks GUI is too small for the number of ranks. Increase the number of rows on the ranks GUI."); - } rankElement = rankElement.getNext(); }