From f6e8b352ce63bbfb5dcf6c70fe08a073f9688947 Mon Sep 17 00:00:00 2001 From: DongShaoNB Date: Tue, 2 Jul 2024 01:23:39 +0800 Subject: [PATCH 1/2] fix: when menu option 'update_interval' set to 1, it will default to 10 --- .../com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java b/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java index 14a5372..3a7619c 100644 --- a/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java +++ b/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java @@ -665,7 +665,7 @@ public void loadMenu(FileConfiguration c, String key, boolean mainConfig) { } final int updateInterval = c.getInt(pre + "update_interval", 10); - builder.updateInterval(updateInterval > 1 ? updateInterval : 10); + builder.updateInterval(updateInterval >= 1 ? updateInterval : 10); Map> items = loadMenuItems(c, key, mainConfig); From 446adf3decef73ab12b4088ff3e17ef4be200e4e Mon Sep 17 00:00:00 2001 From: DongShaoNB Date: Tue, 2 Jul 2024 01:50:02 +0800 Subject: [PATCH 2/2] refactor: better readability and maintainability --- .../com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java b/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java index 3a7619c..316a71a 100644 --- a/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java +++ b/src/main/java/com/extendedclip/deluxemenus/config/DeluxeMenusConfig.java @@ -665,7 +665,7 @@ public void loadMenu(FileConfiguration c, String key, boolean mainConfig) { } final int updateInterval = c.getInt(pre + "update_interval", 10); - builder.updateInterval(updateInterval >= 1 ? updateInterval : 10); + builder.updateInterval(updateInterval > 0 ? updateInterval : 10); Map> items = loadMenuItems(c, key, mainConfig);