Skip to content

BlockBenchが出力するプロジェクトファイルとかをそのままクラス化するやつ

License

Notifications You must be signed in to change notification settings

Lepinoid/bb-data-structure

Repository files navigation

bb-data-structure

maven

BlockBenchのプロジェクトファイル.bbmodelの情報をクラスに変換する用のライブラリ

kotlinx.serialization に対応しており,ファイルから直接読み込み,書き出しが可能

対応クラス

ClassName Type Extension
BBModelData BBProjectFile .bbmodeldata
ItemModelData ItemModel .json

Gradle

KotlinDSL:

repositories {
     maven { 
         name = "lepinoid"
         url = uri("https://lepinoid.github.io/maven-repo/")
     }
}

dependencies {
  implementation("net.lepinoid:bb-data-structure-jvm:$VERSION")
}

Multiplatform:

commonMain {
    dependencies {
        implementation("net.lepinoid:bb-data-structure:$VERSION")
    }
}

Examples

fun projectFile() {
    val bbModelData: String = //any project file string
    val decode = Json.decodeFromString<BBModelData>(BBModelData.serializer(), bbModelData)
    val encode = Json.encodeToString(BBModelData.serializer(), decode)
}

About

BlockBenchが出力するプロジェクトファイルとかをそのままクラス化するやつ

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages