Map submission updated / WIP content patcher experiments
This commit is contained in:
@@ -861,9 +861,7 @@ public class ContentParser{
|
||||
* @return the content that was parsed
|
||||
*/
|
||||
public Content parse(LoadedMod mod, String name, String json, Fi file, ContentType type) throws Exception{
|
||||
if(contentTypes.isEmpty()){
|
||||
init();
|
||||
}
|
||||
checkInit();
|
||||
|
||||
//remove extra # characters to make it valid json... apparently some people have *unquoted* # characters in their json
|
||||
if(file.extension().equals("json")){
|
||||
@@ -889,6 +887,12 @@ public class ContentParser{
|
||||
return c;
|
||||
}
|
||||
|
||||
public void checkInit(){
|
||||
if(contentTypes.isEmpty()){
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
public void markError(Content content, LoadedMod mod, Fi file, Throwable error){
|
||||
Log.err("Error for @ / @:\n@\n", content, file, Strings.getStackTrace(error));
|
||||
|
||||
@@ -1279,6 +1283,11 @@ public class ContentParser{
|
||||
T parse(String mod, String name, JsonValue value) throws Exception;
|
||||
}
|
||||
|
||||
public Json getJson(){
|
||||
checkInit();
|
||||
return parser;
|
||||
}
|
||||
|
||||
//intermediate class for parsing
|
||||
static class UnitReq{
|
||||
public Block block;
|
||||
|
||||
Reference in New Issue
Block a user