mirror of
https://github.com/GeyserMC/PackConverter.git
synced 2025-12-20 15:29:15 +00:00
Null check our assets, remove duplicate writing of entity.json
This commit is contained in:
@@ -132,8 +132,17 @@ public final class VanillaPackProvider {
|
|||||||
Files.createDirectories(builtinModelsDirectory);
|
Files.createDirectories(builtinModelsDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtinEntity != null) {
|
||||||
Files.write(builtinModelsDirectory.resolve("entity.json"), IOUtils.toByteArray(builtinEntity));
|
Files.write(builtinModelsDirectory.resolve("entity.json"), IOUtils.toByteArray(builtinEntity));
|
||||||
|
} else {
|
||||||
|
log.error("`entity.json` was not found. Continuing without, issues may occur!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (builtinGenerated != null) {
|
||||||
Files.write(builtinModelsDirectory.resolve("generated.json"), IOUtils.toByteArray(builtinGenerated));
|
Files.write(builtinModelsDirectory.resolve("generated.json"), IOUtils.toByteArray(builtinGenerated));
|
||||||
|
} else {
|
||||||
|
log.error("`generated.json` was not found. Continuing without, issues may occur!");
|
||||||
|
}
|
||||||
|
|
||||||
try (Stream<Path> paths = Files.walk(rootPath)) {
|
try (Stream<Path> paths = Files.walk(rootPath)) {
|
||||||
paths.forEach(path -> {
|
paths.forEach(path -> {
|
||||||
@@ -190,11 +199,6 @@ public final class VanillaPackProvider {
|
|||||||
.formatted(bytes2, asset.getValue().hash)),
|
.formatted(bytes2, asset.getValue().hash)),
|
||||||
rootPath.resolve("assets/" + asset.getKey())
|
rootPath.resolve("assets/" + asset.getKey())
|
||||||
);
|
);
|
||||||
|
|
||||||
Files.write(
|
|
||||||
rootPath.resolve("assets/" + asset.getKey()),
|
|
||||||
IOUtils.toByteArray(builtinEntity)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user