https://github.com/ultreon/ubo
NBT inspired data I/O. Made for games.
https://github.com/ultreon/ubo
api binary-data data data-storage file-type game-data io library ubo
Last synced: 8 months ago
JSON representation
NBT inspired data I/O. Made for games.
- Host: GitHub
- URL: https://github.com/ultreon/ubo
- Owner: Ultreon
- License: apache-2.0
- Created: 2022-11-07T19:32:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T21:35:08.000Z (over 1 year ago)
- Last Synced: 2024-06-25T22:50:31.652Z (over 1 year ago)
- Topics: api, binary-data, data, data-storage, file-type, game-data, io, library, ubo
- Language: Java
- Homepage: https://ultreon.dev/ubo/docs/latest
- Size: 661 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ultreon Binary Object
**File Extension:** `.ubo`
**API Language:** `Java 8`
## Usage
Assuming you use Gradle.
1. Then, in `build.gradle`, define the dependency:
```gradle
// --- Needed for 1.6.0 or above ---
repositories {
maven { url = "https://maven.ultreon.dev/releases" }
maven { url = "https://maven.ultreon.dev/snapshots" }
}
// Add the dependency
dependencies {
implementation 'dev.ultreon:ubo:1.5.0'
// Or use the 1.6.0 snapshot
implementation 'dev.ultreon:ubo:1.6.0-SNAPSHOT'
}
```
Or if you use the Kotlin DSL:
```kotlin
// --- Needed for 1.6.0 or above ---
repositories {
maven("https://maven.ultreon.dev/releases")
maven("https://maven.ultreon.dev/snapshots")
}
// Add the dependency
dependencies {
implementation("dev.ultreon:ubo:1.5.0")
// Or use the 1.6.0 snapshot
implementation("dev.ultreon:ubo:1.6.0-SNAPSHOT")
}
2. We can now proceed to the using section. The `DataIo` class is capable of reading and writing UBO data.
Example:
```java
import dev.ultreon.ubo.DataIo;
import dev.ultreon.ubo.types.MapType;
import java.io.File;
public class DataTest {
public static void main(String[] args) {
MapType dataType = new MapType();
dataType.putString("greetings", "Hello World");
DataIo.write(dataType, new File("data.ubo"));
}
}
```
Or if you want to use Kotlin:
```kotlin
import dev.ultreon.ubo.DataIo
import dev.ultreon.ubo.types.MapType
import java.io.File
fun main() {
val dataType = MapType()
dataType.putString("greetings", "Hello World")
DataIo.write(dataType, File("data.ubo"))
}
```
3. You can now build it. You can change the example in step 2 to suit your needs.
~~Here's the [jitpack listing](https://jitpack.io/#dev.ultreon/ubo) for the current versions and builds you can use.~~
Check out the project's 'releases' page for latest releases.
## Naming conventions
The following conventions are for map keys:
* `MapType` and `ListType` are in `PascalCase`.
* Any other types are in `camelCase`.
Do note that in some cases, keys can have a different case.
For example, if the key is used for identifiers (Like those: `namespace:id`).
Tho it's generally not recommended to use map keys for objects like identifiers or numbers.