forked from SteamWar/SteamWar
Hotfix static initialisation of GameModeConfig
This commit is contained in:
@@ -62,7 +62,16 @@ public final class GameModeConfig<M, W> {
|
|||||||
return (GameModeConfig<M, String>) DEFAULTS;
|
return (GameModeConfig<M, String>) DEFAULTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Field Schematic_TypeField;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
try {
|
||||||
|
Schematic_TypeField = SchematicConfig.class.getDeclaredField("Type");
|
||||||
|
Schematic_TypeField.setAccessible(true);
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
throw new SecurityException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
byFileName = new HashMap<>();
|
byFileName = new HashMap<>();
|
||||||
byGameName = new HashMap<>();
|
byGameName = new HashMap<>();
|
||||||
bySchematicType = new HashMap<>();
|
bySchematicType = new HashMap<>();
|
||||||
@@ -164,17 +173,6 @@ public final class GameModeConfig<M, W> {
|
|||||||
*/
|
*/
|
||||||
public final TechhiderConfig<M> Techhider;
|
public final TechhiderConfig<M> Techhider;
|
||||||
|
|
||||||
private static final Field Schematic_TypeField;
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
Schematic_TypeField = SchematicConfig.class.getDeclaredField("Type");
|
|
||||||
Schematic_TypeField.setAccessible(true);
|
|
||||||
} catch (NoSuchFieldException e) {
|
|
||||||
throw new SecurityException(e.getMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public GameModeConfig(File file, Function<String, M> materialMapper, Function<String, W> winconditionMapper, Function<File, String> defaultGameName, boolean cacheInstance) {
|
public GameModeConfig(File file, Function<String, M> materialMapper, Function<String, W> winconditionMapper, Function<File, String> defaultGameName, boolean cacheInstance) {
|
||||||
YMLWrapper<M, W> loader = new YMLWrapper<>(file, materialMapper, winconditionMapper);
|
YMLWrapper<M, W> loader = new YMLWrapper<>(file, materialMapper, winconditionMapper);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user