diff --git a/src/main/java/net/moddedminecraft/betterchunkloader/config/MessagesConfig.java b/src/main/java/net/moddedminecraft/betterchunkloader/config/MessagesConfig.java index fe28c37..7fd2819 100644 --- a/src/main/java/net/moddedminecraft/betterchunkloader/config/MessagesConfig.java +++ b/src/main/java/net/moddedminecraft/betterchunkloader/config/MessagesConfig.java @@ -190,6 +190,13 @@ public MessagesConfig(BetterChunkLoader main) throws IOException { public String chunksReloadSuccess = "&aReload success for: &e{type}&a."; public String chunksReloadFailure = "&cReload failed for: &e{type}&c, check console for more information."; + public String menuChunkTitle1 = "Size: 1x1 Chunks"; + public String menuChunkTitle2 = "Size: 3x3 Chunks"; + public String menuChunkTitle3 = "Size: 5x5 Chunks"; + public String menuChunkTitle4 = "Size: 7x7 Chunks"; + public String menuChunkTitle5 = "Size: 9x9 Chunks"; + public String menuChunkTitle6 = "Size: 11x11 Chunks"; + public String menuChunkTitle7 = "Size: 13x13 Chunks"; private void configCheck() throws IOException, ObjectMappingException { @@ -201,6 +208,15 @@ private void configCheck() throws IOException, ObjectMappingException { serverNameError = check(config.getNode("ChunkLoader", "ServerNameError"), serverNameError).getString(); + //Menu + menuChunkTitle1 = check(config.getNode("Menu", "Chunks", "1"), menuChunkTitle1).getString(); + menuChunkTitle2 = check(config.getNode("Menu", "Chunks", "2"), menuChunkTitle2).getString(); + menuChunkTitle3 = check(config.getNode("Menu", "Chunks", "3"), menuChunkTitle3).getString(); + menuChunkTitle4 = check(config.getNode("Menu", "Chunks", "4"), menuChunkTitle4).getString(); + menuChunkTitle5 = check(config.getNode("Menu", "Chunks", "5"), menuChunkTitle5).getString(); + menuChunkTitle6 = check(config.getNode("Menu", "Chunks", "6"), menuChunkTitle6).getString(); + menuChunkTitle7 = check(config.getNode("Menu", "Chunks", "7"), menuChunkTitle7).getString(); + //ChunkLoader creationHelp = check(config.getNode("ChunkLoader", "CreationHelp"), creationHelp).getString(); noPermissionCreate = check(config.getNode("ChunkLoader", "NoPermissionCreate"), noPermissionCreate).getString(); diff --git a/src/main/java/net/moddedminecraft/betterchunkloader/menu/Menu.java b/src/main/java/net/moddedminecraft/betterchunkloader/menu/Menu.java index 820d90d..439fa0f 100644 --- a/src/main/java/net/moddedminecraft/betterchunkloader/menu/Menu.java +++ b/src/main/java/net/moddedminecraft/betterchunkloader/menu/Menu.java @@ -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: " + getReadableSize(radius + 1) + " [Active]" : "Size: " + getReadableSize(radius + 1)))); + keys.put(Keys.DISPLAY_NAME, Text.of((chunkLoader.getRadius() == radius ? getReadableSize(radius + 1) + " [Active]" : getReadableSize(radius + 1)))); addMenuOption(inventory, slotPos, (chunkLoader.getRadius() == radius ? ACTIVE_TYPE : INACTIVE_TYPE), keys); pos++; radius++; @@ -115,7 +115,7 @@ public void updateMenu(Player player, ChunkLoader chunkLoader, Inventory invento 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: " + getReadableSize(radius + 1) + " [Active]" : "Size: " + getReadableSize(radius + 1)))); + keys.put(Keys.DISPLAY_NAME, Text.of((chunkLoader.getRadius() == radius ? getReadableSize(radius + 1) + " [Active]" : getReadableSize(radius + 1)))); addMenuOption(inventory, slotPos, (chunkLoader.getRadius() == radius ? ACTIVE_TYPE : INACTIVE_TYPE), keys); pos++; radius++; @@ -127,21 +127,21 @@ public void updateMenu(Player player, ChunkLoader chunkLoader, Inventory invento private String getReadableSize(int i) { switch (i) { case 1: - return "1x1"; + return plugin.getConfig().getMessages().menuChunkTitle1; case 2: - return "3x3"; + return plugin.getConfig().getMessages().menuChunkTitle2; case 3: - return "5x5"; + return plugin.getConfig().getMessages().menuChunkTitle3; case 4: - return "7x7"; + return plugin.getConfig().getMessages().menuChunkTitle4; case 5: - return "9x9"; + return plugin.getConfig().getMessages().menuChunkTitle5; case 6: - return "11x11"; + return plugin.getConfig().getMessages().menuChunkTitle6; case 7: - return "13x13"; + return plugin.getConfig().getMessages().menuChunkTitle7; default: - return "" + i; + return "Size: " + i; } }