Skip to content

A gradle plugin that generates bindings for blocks and items from a resource pack.

License

Notifications You must be signed in to change notification settings

solidpack/binder

Repository files navigation

binder Gradle Plugin Portal Version

A gradle plugin that generates bindings for blocks and items of a specified minecraft resource pack. This aims to create a typesafe experience through enum classes when creating everything related to resource packs (see example implementation).

Setup

// build.gradle.kts

plugins {
    id("io.github.solid-resourcepack.binder") version "VERSION"
}

sourceSets.main {
    kotlin.srcDir("build/generated") //Include the destination dir
}

dependencies {
    api("io.github.solid-resourcepack.binder:api:VERSION")
}

packBinder {
    packPath.from(layout.projectDirectory.dir("pack-sample")) //Define paths where your resource packs are
    nameDepth = 1 //How much depth of the model namespace should be included
    namespaces.add("example") // Add namespaces you want to generate
    dest.set(layout.buildDirectory.dir("generated")) //Set the destination dir
    packageName.set("com.example.generated") //Set the package of the generated classes
    className.set("PackBindings") //Set the class name of the resulting enum
}