Skip to content

Commit

Permalink
Update Menu.java
Browse files Browse the repository at this point in the history
  • Loading branch information
leelawd committed Feb 14, 2019
1 parent a02c53c commit 59d0a88
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void showMenu(Player player, ChunkLoader chunkLoader) {
lores.add(Text.of("Radius: " + radius));
lores.add(Text.of("Chunks: " + chunks));
keys.put(Keys.ITEM_LORE, lores);
keys.put(Keys.DISPLAY_NAME, Text.of((chunkLoader.getRadius() == radius ? "Size: " + (radius + 1) + " [Active]" : "Size: " + (radius + 1))));
keys.put(Keys.DISPLAY_NAME, Text.of((chunkLoader.getRadius() == radius ? "Size: " + getReadableSize(radius + 1) + " [Active]" : "Size: " + getReadableSize(radius + 1))));
addMenuOption(inventory, slotPos, (chunkLoader.getRadius() == radius ? ACTIVE_TYPE : INACTIVE_TYPE), keys);
pos++;
radius++;
Expand Down Expand Up @@ -124,6 +124,27 @@ public void updateMenu(Player player, ChunkLoader chunkLoader, Inventory invento
});
}

private String getReadableSize(int i) {
switch (i) {
case 1:
return "1x1";
case 2:
return "3x3";
case 3:
return "5x5";
case 4:
return "7x7";
case 5:
return "9x9";
case 6:
return "11x11";
case 7:
return "13x13";
default:
return "" + i;
}
}

public Consumer<ClickInventoryEvent> createMenuListener(ChunkLoader chunkLoader) {
return event -> {

Expand Down

0 comments on commit 59d0a88

Please sign in to comment.