Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public enum MenusLocale implements IDataAccessor {
ARENA_TITLE("ARENA.TITLE", DataType.STRING, "Select an arena"),
ARENA_FILTER("ARENA.FILTER-TYPE", DataType.STRING, "FILL"),
ARENA_SIZE("ARENA.SIZE", DataType.INT, "27"),
ARENA_LIST_STARTING_SLOT("ARENA.LIST.STARTING-SLOT", DataType.INT, "1"),
ARENA_ITEM_NAME("ARENA.ITEM.NAME", DataType.STRING, "&b<arena>"),
ARENA_ITEM_LORE("ARENA.ITEM.LORE", DataType.STRING_LIST, "", "&fSelect <arena> as the battle arena"),
ARENA_RANDOM_ITEM_NAME("ARENA.RANDOM_ITEM.NAME", DataType.STRING, "&bRandom Arena"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ArenaSelectMenu(Kit kit, UUID receiver, int round) {
@Override
public List<Button> getButtons(Player player) {
List<Button> buttons = new ArrayList<>();
int i = 1;
int i = MenusLocale.ARENA_LIST_STARTING_SLOT.getInt();

buttons.add(new Button(MenusLocale.ARENA_RANDOM_ITEM_SLOT.getInt()) {
@Override
Expand All @@ -64,8 +64,13 @@ public void onClick(ClickType type, Player p) {
});
}
});

int rows = MenusLocale.ARENA_SIZE.getInt() / 9;
boolean isBorder = MenusLocale.ARENA_FILTER.getString().equals("BORDER");
for (Arena arena : kit.getArenas()) {
int row = i / 9;
int col = i % 9;
if (col == 8 && isBorder) i += 2;
if (row == rows - 1 && isBorder) i += 9;
buttons.add(new Button(i++) {
@Override
public ItemStack getItemStack(Player p) {
Expand Down