Skip to content

Commit

Permalink
Fixed pack.mcmeta not generating for datapack dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kindlich committed Jun 5, 2020
1 parent 98fbdc1 commit c6bceb2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/blamejared/contenttweaker/VanillaFactory.java
Expand Up @@ -79,7 +79,6 @@ private static void writeResourcePack() {

private static void writeData() {
final File dataPackDir;
final File resourcePackDir;
final ModList modList = ModList.get();
if(modList.isLoaded("theloader")){
dataPackDir = new File("the_loader/datapacks/contenttweaker");
Expand All @@ -89,6 +88,15 @@ private static void writeData() {
CraftTweakerAPI.logInfo("Could not find resource loader mod, no data pack will be generated!");
return;
}


if(!new File(dataPackDir, "pack.mcmeta").exists()) {
try(final PrintWriter writer = new PrintWriter(new FileWriter(new File(dataPackDir, "pack.mcmeta")))) {
writer.write("{\n" + " \"pack\": {\n" + " \"pack_format\": 5,\n" + " \"description\": \"ContentTweaker loottables and data\"\n" + " }\n" + "}");
} catch(IOException e) {
e.printStackTrace();
}
}


registry.getDataResources()
Expand Down

0 comments on commit c6bceb2

Please sign in to comment.