From 211bda39dc98e8db47fa745818bc1f2f9ba40cf1 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 2 Dec 2021 14:34:29 +0100 Subject: [PATCH] Sort SchematicTypes --- SpigotCore_Main/src/de/steamwar/sql/SchematicType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java index 6914f4c..5fe5715 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java @@ -24,6 +24,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; import java.util.*; +import java.util.stream.Collectors; public class SchematicType { public static final SchematicType Normal = new SchematicType("Normal", "", Type.NORMAL, null); //Has to stay publicly availible @@ -41,7 +42,7 @@ public class SchematicType { tmpFromDB.put(Normal.name().toLowerCase(), Normal); if(folder.exists()) { - for(File configFile : folder.listFiles((file, name) -> name.endsWith(".yml") && !name.endsWith(".kits.yml"))) { + for(File configFile : Arrays.stream(folder.listFiles((file, name) -> name.endsWith(".yml") && !name.endsWith(".kits.yml"))).sorted().collect(Collectors.toList())) { YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); if(!config.isConfigurationSection("Schematic")) continue;