-
Notifications
You must be signed in to change notification settings - Fork 2
LibAssets
LibAssets is the official EasyLibrary asset helper library.
Repository:
https://github.com/ImperaZim/LibAssets
Package id:
libassets
Namespace:
imperazim\assets
- Asset manifests with relative paths, byte size and SHA-256 hashes.
- Manifest-vs-disk validation for missing, changed and extra files.
- Bedrock resource-pack
manifest.jsonparsing and validation. - Resource-pack directory and ZIP validation.
- Resource-pack ZIP building when the PHP runtime supports
ZipArchiveor writablePharData. - Controlled resource-pack workflow with registered pack definitions,
active,prepared,pending,disabledandinvalidstatus checks. - Plugin-owned staging folders for
prepared/,dist/,manifests/andcache/. - Optional downloader adapter contract for
LibHttpor plugin-owned transport code.
LibAssets does not own HTTP transport. Use LibHttp for request/retry/body
handling, then let LibAssets validate checksums, cache paths and Bedrock
resource-pack archives.
LibAssets depends on LibCommons for shared pure helpers:
- SHA-256 hashing;
- JSON encode/decode;
- path normalization;
- small filesystem directory/write helpers.
Standalone installs need both PHARs in plugins/:
LibCommons-1.0.0-dev.phar
LibAssets-1.0.0-dev.phar
EasyLibrary package installs declare this as:
dependencies:
required:
- libcommonsThis dependency does not pull in HTTP, commands, forms, HUD, world editing or other runtime systems.
use imperazim\assets\resource\ResourcePackDefinition;
use imperazim\assets\resource\ResourcePackWorkflow;
use imperazim\assets\resource\ResourcePackWorkflowStatus;
$workflow = new ResourcePackWorkflow($plugin->getDataFolder() . 'resource-packs');
$workflow->register(new ResourcePackDefinition('lobby', $sourceDirectory, 'lobby-pack.zip'));
if ($workflow->inspect('lobby')->getStatus() === ResourcePackWorkflowStatus::PENDING) {
$workflow->prepare('lobby');
}The workflow is intentionally explicit: it prepares and validates files, but the plugin still decides how to expose or register the resulting pack.
For CDN-backed packs, use ResourcePackDefinition::fromCdn() to derive the
remote archive URL from a base URL plus the controlled archive name.
/easylibrary packages install libcommons development confirm
/easylibrary packages install libassets development confirm
Restart and validate:
/easylibrary packages doctor
/elprobe libassets
/elprobe run libassets
Expected package-backed source:
libassets / LibAssets: class=yes plugin=package-backed-plugin source=package-backed-plugin
libassets / LibAssets: functional=yes source=package-backed-plugin test=assets-workflow-resource-pack
- Package Manager
- Package Backed Plugins
- Standalone vs Package
- Package Switch and Migration
- Package Doctor
- Package Safety Gate
- Support Report Bundle
- Timings
- Runtime Notifications
- Package Recovery
- Proxy Troubleshooting
- Migrating from EasyLibrary 2.0 to 3.x
- Embedded Libraries Migration Map
- Removed Features and Replacements
- Deprecated APIs
- Compatibility Policy
- Config Migration
- 3x Dev Scope Checkpoint
- Plugin Developer Migration
- Server Administrator Migration
- Official Libraries
- LibPacket
- LibCommand
- LibSerializer
- LibForm
- LibDB
- LibCommons
- LibHttp
- LibAssets
- LibPlaceholder
- LibWorld
- LibModule
- EasyLibrary Agent Bridge
- LibCustom
- LibEnchantment
- LibHud
- LibTrigger
- LibWindow
- Public API Contract
- Module Boundary
- Module Smoke Matrix
- LibAsync Incubator
- LibReflect Incubator
- Doctor Output
- Repository Notifications
- Smoke Tests
- Common Errors
- Release and Changelog