crdatalib is focused on providing easy access experience for parsing. Json cosmic reach data files for general use.
The goal of this API is to provide utilities to easily parse cosmic reach assets quickly. This API can be used to write new Cosmic Reach asset files or also just read and act on the current assets like making API generation.
<repository>
<id>miles-repos-snapshots</id>
<name>Miles Repositories</name>
<url>https://maven.miles.sh/snapshots</url>
</repository>
<dependency>
<groupId>sh.miles.crdatalib</groupId>
<artifactId>crdatalib</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
maven {
name = "milesReposSnapshots"
url = uri("https://maven.miles.sh/snapshots")
}
implementation("sh.miles.crdatalib:crdatalib:1.0.0-SNAPSHOT")
Using crdatalib is very easy and everything that is needed can be accessed through the CRDataLib class.
A Short example for parsing blocks and items is below
final CRAssetParser parser = CRDataLib.newParser();
final CompletableFuture<CRData> future = parser.assetRoot(Path.of("assets", "base"))
.threads(4) // threads aren't required but allocating a couple can speed up large parses
.navigate(AssetType.BLOCK, "blocks")
.navigate(AssetType.ITEM, "items")
.parse(); // parseNow() can be used to parse on a single thread
future.whenComplete((data, exception) -> {
for (final DataItem item : data.items()) {
System.out.println(item);
}
for (final DataBlock block : data.blocks()) {
System.out.println(block);
}
});
This API is not currently finished The progress is below
- Animations
- Read
- Write
- Block Events
- Read
- Write
- Blocks
- Read
- Write
- Block State Generators
- Read
- Write
- Fonts
- Read
- Write
- Items
- Read
- Write
- Languages
- Read
- Write
- Loot
- Read
- Write
- Models
- Read
- Write
- Music
- Read
- Write
- Recipes
- Read
- Write
- Shaders
- Read
- Write
- Textures
- Read
- Write