|
38 | 38 |
|
39 | 39 | TimeTableManager.INSTANCE.load(); |
40 | 40 | par1.loadFinished = true; |
41 | | -@@ -143,29 +146,43 @@ |
| 41 | +@@ -143,29 +146,32 @@ |
42 | 42 | public ResourceType getType(String name) { |
43 | 43 | return this.typeMap.get(name); |
44 | 44 | } |
45 | 45 |
|
46 | 46 | public String registerResourceSet(ResourceType type, File file) throws IOException { |
47 | | -+ List<String> json = null; |
48 | | - for(String s : ENCODING) { |
49 | | - try { |
| 47 | +- for(String s : ENCODING) { |
| 48 | +- try { |
50 | 49 | - String s1 = NGTText.readText(file, false, s); |
51 | 50 | - ResourceConfig resourceconfig = (ResourceConfig)NGTJson.getObjectFromJson(s1, type.cfgClass); |
52 | 51 | - return this.registerResourceSet(type, resourceconfig, s1); |
53 | | -+ json = NGTText.readText(file, s); |
54 | | -+ break; |
55 | | - } catch (IOException ioexception) { |
56 | | - ioexception.printStackTrace(); |
57 | | - } |
58 | | - } |
59 | | -+ if (json == null) |
60 | | -+ throw new ModelPackException("Can't load json. please check encoding of json " + |
61 | | -+ "file and file is exists.", file.getAbsolutePath()); |
| 52 | +- } catch (IOException ioexception) { |
| 53 | +- ioexception.printStackTrace(); |
| 54 | +- } |
| 55 | +- } |
| 56 | ++ List<String> json = NGTText.readText(file, null);; |
62 | 57 |
|
63 | 58 | - throw new ModelPackException("Can't load model", file.getAbsolutePath()); |
64 | 59 | + ResourceConfig resourceconfig = (ResourceConfig)NGTJson.getObjectFromJson(com.anatawa12.fixRtm.UtilsKt.joinLinesForJsonReading(json), type.cfgClass); |
|
87 | 82 | return cfg.getName(); |
88 | 83 | } else { |
89 | 84 | throw new ModelPackException("Failed to create ResourceSet", cfg.getName()); |
90 | | -@@ -177,15 +194,16 @@ |
| 85 | +@@ -177,15 +183,16 @@ |
91 | 86 |
|
92 | 87 | for(Entry<ResourceType, Map<String, ResourceSet>> entry : this.allModelSetMap.entrySet()) { |
93 | 88 | for(ResourceSet resourceset : entry.getValue().values()) { |
|
105 | 100 | public void addModelSetName(int count, String typeName, String name) { |
106 | 101 | assert NGTUtil.isSMP() && !NGTUtil.isServer(); |
107 | 102 |
|
108 | | -@@ -227,16 +245,13 @@ |
| 103 | +@@ -227,16 +234,13 @@ |
109 | 104 | resourcetype = type.parent; |
110 | 105 | } |
111 | 106 |
|
|
0 commit comments