mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-19 15:09:18 +00:00
dont always regenerate uuid
This commit is contained in:
@@ -103,7 +103,6 @@ public class GeneratorMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
File animationsFolder = new File(output, "animations");
|
File animationsFolder = new File(output, "animations");
|
||||||
File entityFolder = new File(output, "entity");
|
|
||||||
File modelsFolder = new File(output, "models/entity");
|
File modelsFolder = new File(output, "models/entity");
|
||||||
File texturesFolder = new File(output, "textures/entity");
|
File texturesFolder = new File(output, "textures/entity");
|
||||||
File animationControllersFolder = new File(output, "animation_controllers");
|
File animationControllersFolder = new File(output, "animation_controllers");
|
||||||
@@ -111,33 +110,15 @@ public class GeneratorMain {
|
|||||||
|
|
||||||
|
|
||||||
File manifestFile = new File(output, "manifest.json");
|
File manifestFile = new File(output, "manifest.json");
|
||||||
boolean generateManifest = false;
|
|
||||||
if (!entityFolder.exists()) {
|
|
||||||
generateManifest = true;
|
|
||||||
}
|
|
||||||
File[] files = entityFolder.listFiles();
|
|
||||||
if (!manifestFile.exists() || files == null || files.length != entityMap.size()) {
|
|
||||||
generateManifest = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (generateManifest) {
|
output.mkdirs();
|
||||||
output.mkdirs();
|
Path path = manifestFile.toPath();
|
||||||
Path path = manifestFile.toPath();
|
if (!path.toFile().exists()) {
|
||||||
if (path.toFile().exists()) {
|
try {
|
||||||
try {
|
Files.writeString(path,
|
||||||
JsonObject manifest = new JsonParser().parse(Files.readString(path)).getAsJsonObject();
|
PackManifest.generate(), StandardCharsets.UTF_8);
|
||||||
manifest.get("header").getAsJsonObject().addProperty("uuid", UUID.randomUUID().toString());
|
} catch (IOException e) {
|
||||||
Files.writeString(path, GSON.toJson(manifest));
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
Files.writeString(path,
|
|
||||||
PackManifest.generate(), StandardCharsets.UTF_8);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user