forked from SteamWar/SteamWar
Make SchematicType static init type safe
This commit is contained in:
@@ -23,12 +23,14 @@ import de.steamwar.ImplementationProvider;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface SQLWrapper {
|
||||
SQLWrapper impl = ImplementationProvider.getImpl("de.steamwar.sql.SQLWrapperImpl");
|
||||
public interface SQLWrapper<M> {
|
||||
SQLWrapper<?> impl = ImplementationProvider.getImpl("de.steamwar.sql.SQLWrapperImpl");
|
||||
|
||||
File getSchemTypesFolder();
|
||||
|
||||
default void processSchematicType(GameModeConfig<String, String> gameModeConfig) {
|
||||
GameModeConfig<M, String> loadGameModeConfig(File file);
|
||||
|
||||
default void processSchematicType(GameModeConfig<?, String> gameModeConfig) {
|
||||
}
|
||||
|
||||
void additionalExceptionMetadata(StringBuilder builder);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SchematicType {
|
||||
File folder = SQLWrapper.impl.getSchemTypesFolder();
|
||||
if (folder.exists()) {
|
||||
for (File configFile : Arrays.stream(folder.listFiles((file, name) -> name.endsWith(".yml") && !name.endsWith(".kits.yml"))).sorted().collect(Collectors.toList())) {
|
||||
GameModeConfig<String, String> gameModeConfig = new GameModeConfig<>(configFile, GameModeConfig.ToString, GameModeConfig.ToString, GameModeConfig.ToStaticWarGear);
|
||||
GameModeConfig<?, String> gameModeConfig = SQLWrapper.impl.loadGameModeConfig(configFile);
|
||||
if (gameModeConfig.Schematic.Type == null) continue;
|
||||
if (tmpFromDB.containsKey(gameModeConfig.Schematic.Type.toDB())) continue;
|
||||
SchematicType current = gameModeConfig.Schematic.Type;
|
||||
|
||||
Reference in New Issue
Block a user