Map submission updated / WIP content patcher experiments

This commit is contained in:
Anuken
2025-10-20 22:47:35 -04:00
parent 34d994f384
commit 8898cbe6e4
11 changed files with 363 additions and 8 deletions

View File

@@ -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;