@@ -22,23 +22,25 @@ import java.io.File
2222 */
2323object Loader {
2424
25- private val folder by lazy {
26- Menu .menus.clear()
25+ private val defaults = arrayOf(
26+ " Example.yml" ,
27+ " Demo-Buttons.yml" ,
28+ " Profile.yml" ,
29+ " Dialog-Example.yml" ,
30+ " Dialog-Confirmation-Example.yml" ,
31+ " Dialog-Layout-Example.yml" ,
32+ " shop-example/Shop-Categories.yml" ,
33+ " shop-example/categories/Shop-Ores.yml" ,
34+ " shop-example/handler/Shop-Handler-Purchase.yml" ,
35+ " shop-example/handler/Shop-Handler-Sell.yml" ,
36+ )
37+
38+ private val folder: File
39+ get() = ensureMenuFolder()
40+
41+ private fun ensureMenuFolder (): File {
2742 val folder = File (getDataFolder(), " menus" )
2843
29- val defaults = arrayOf(
30- " Example.yml" ,
31- " Demo-Buttons.yml" ,
32- " Profile.yml" ,
33- " Dialog-Example.yml" ,
34- " Dialog-Confirmation-Example.yml" ,
35- " Dialog-Layout-Example.yml" ,
36- " shop-example/Shop-Categories.yml" ,
37- " shop-example/categories/Shop-Ores.yml" ,
38- " shop-example/handler/Shop-Handler-Purchase.yml" ,
39- " shop-example/handler/Shop-Handler-Sell.yml" ,
40- )
41-
4244 if (! folder.exists()) {
4345 folder.mkdirs()
4446 }
@@ -49,7 +51,7 @@ object Loader {
4951 }
5052 }
5153
52- folder
54+ return folder
5355 }
5456
5557 var isLoading = false
0 commit comments