Skip to content

Commit

Permalink
Anim support
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcat101 committed Jan 26, 2023
1 parent a617d58 commit e1c92d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Binary file modified example/turiipipip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions example/turiipipip.png.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public void loadPacks(Consumer<ResourcePackInfo> consumer, IFactory factory) {
File discmodel = new File(models.toFile(), disc.ID);
FileWriter modelwriter = new FileWriter(discmodel+".json");
if (disc.TEXTURE.exists()) {
FileUtils.copyFile(disc.TEXTURE, textures.resolve(disc.NAME+".png").toFile());
File mcmeta = disc.TEXTURE.toPath().getParent().resolve(disc.NAME+".png.mcmeta").toFile();
FileUtils.copyFile(disc.TEXTURE, textures.resolve(disc.NAME+".png").toFile()); // Copy texture
if (mcmeta.exists()) FileUtils.copyFile(mcmeta, textures.resolve(disc.NAME+".png.mcmeta").toFile()); // Copy mcmeta file (if exists)

modelwriter.write(String.format("{\"parent\": \"minecraft:item/generated\", \"textures\": {\"layer0\": \"%s:item/custom/%s\"}}", moderncustomdiscs.MOD_ID, disc.NAME));
}
else modelwriter.write(String.format("{\"parent\": \"%s:item/disc\"}", moderncustomdiscs.MOD_ID));
Expand Down

0 comments on commit e1c92d6

Please sign in to comment.