-
Notifications
You must be signed in to change notification settings - Fork 0
Post Processing
Multipacks have a power feature: Post processing passes. These passes modify files in your pack into something else, such as splitting sprite atlas into multiple PNGs, or applying multiple PNG overlays on top of an sprite.
{
"//": "multipacks.json contents",
"...": "...",
"postProcess": <Post processing object>
}There are 2 JSON types that post processing can accept: an object or an array that contains <Post processing object>:
type WithPostProcess = PackIndex & { postProcess?: PostProcessingObject };
type PostProcessingObject = object | PostProcessingObject[];For most developers that are using Multipacks Engine, there is a way to obtain build results, which is shared across all packs during building process:
BundleResult result = bundler.bundle(pack, outputStream, new BundleInclude[] { BundleInclude.RESOURCES, BundleInclude.DATA });
ModelDataAllocator models = result.getOrCreate(ModelDataAllocator.class, ModelDataAllocator::new);
AllocatedModelData data = models.mappedModels.get(new ResourcePath("namespace:my-custom-item"));
ItemStack is = server.getItemFactory().createItemStack(data.itemId.toString());
ItemMeta meta = is.getItemMeta();
meta.setCustomItemModel(data.modelId);
is.setItemMeta(meta);For pack creators, it's just a way to reuse assets from other packs, but you don't have to copy and paste every time the author updates the pack. Isn't that cool?
- Include: Including other passes from JSON file.
- Files manipulation (does not affect actual files)
- Advanced
- Allocations
If you think that's not enough, consider using Multipacks plugins.
Multipacks Wiki super-duper-useful sidebar
- Pack Post Processing
- Include
- Files manipulation
- Advanced
- Allocations