Skip to content

Commit

Permalink
JSON Updates all folders in models now
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryBorek committed Aug 21, 2019
1 parent ef76aeb commit 37590e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Binary file not shown.
21 changes: 17 additions & 4 deletions src/main/java/net/hypixel/resourcepack/impl/ModelConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.Map;

Expand All @@ -23,13 +24,25 @@ public ModelConverter(PackConverter packConverter) {

@Override
public void convert(Pack pack) throws IOException {
Path models = pack.getWorkingPath().resolve("assets" + File.separator + "minecraft" + File.separator + "models");

remapModelJson(models.resolve("block"));
remapModelJson(models.resolve("item"));
Path models = pack.getWorkingPath().resolve("assets" + File.separator + "minecraft" +File.separator + "models");
findFiles(models);
//remapModelJson(models.resolve("item"));
//remapModelJson(models.resolve("block"));
}

protected void findFiles(Path path) throws IOException {
File directory = new File(path.toString());
File[] fList = directory.listFiles();
for (File file : fList) {
if (file.isDirectory()) {
remapModelJson(Paths.get(file.getPath()));
findFiles(Paths.get(file.getPath()));

}
}
}
protected void remapModelJson(Path path) throws IOException {

if (!path.toFile().exists()) return;

Files.list(path)
Expand Down

0 comments on commit 37590e1

Please sign in to comment.