Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 3c3903a

Browse files
authored
Merge pull request #1 from solid-resourcepack/development
feat: generator + mappings for v1.21
2 parents a025bff + a0a7b4c commit 3c3903a

10 files changed

Lines changed: 6152 additions & 3 deletions

File tree

README.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,50 @@
1-
# solid-material ![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/solid-resourcepack/solid-material)
1+
# solid-material ![Maven Central Version](https://img.shields.io/maven-central/v/io.github.solid-resourcepack/solid-material-api?style=flat) ![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/solid-resourcepack/solid-material)
22
A collection of auto generated enum classes for minecraft materials, holding important information for resource packs.
3+
This repository aims to provide a simple way to access material information for resource packs. It is generated from the official minecraft data files and provides a simple way to access the information.
4+
5+
The API is designed to be used in combination with the [solid-api](https://github.com/solid-resourcepack/solid-api) project.
6+
7+
You can however access resource pack information without the solid-api project, by using the generated enum classes [directly](#usage).
8+
9+
## Dependency
10+
11+
### Gradle Kotlin
12+
```kt
13+
implementation("io.github.solid-resourcepack:solid-material-api:VERSION")
14+
```
15+
### Gradle Groovy
16+
```groovy
17+
implementation 'io.github.solid-resourcepack:solid-material-api:VERSION'
18+
```
19+
20+
### Maven
21+
```xml
22+
<dependency>
23+
<groupId>io.github.solid-resourcepack</groupId>
24+
<artifactId>solid-material-api</artifactId>
25+
<version>VERSION</version>
26+
</dependency>
27+
```
28+
29+
## Usage
30+
31+
### Block Materials
32+
```kotlin
33+
val material = SolidBlockMaterial.STONE.toGeneric()
34+
```
35+
36+
### Item Materials
37+
```kotlin
38+
val material = SolidBlockMaterial.STICK.toGeneric()
39+
```
40+
41+
### Material properties
42+
```kotlin
43+
material.parent // The resourcepack parent key of the material (e.g. "minecraft:item/generated")
44+
material.key // The resourcepack key of the material (e.g. "minecraft:item/stick")
45+
material.textures // A list of all textures used by the material
46+
```
347

4-
> [!CAUTION]
5-
> This is very work in progress and experimental
648

749
## Contributing
850
To contribute to this project

build.gradle.kts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
plugins {
5+
alias(libs.plugins.shadow)
6+
alias(libs.plugins.kotlin)
7+
}
8+
9+
10+
allprojects {
11+
group = "io.github.solid-resourcepack"
12+
version = "1.21"
13+
14+
repositories {
15+
mavenCentral()
16+
google()
17+
}
18+
19+
}
20+
21+
subprojects {
22+
apply(plugin = "org.jetbrains.kotlin.jvm")
23+
apply(plugin = "com.github.johnrengelman.shadow")
24+
25+
dependencies {
26+
testImplementation(rootProject.libs.kotlinTest)
27+
implementation(rootProject.libs.kotlinJvm)
28+
}
29+
30+
kotlin {
31+
jvmToolchain(21)
32+
compilerOptions {
33+
jvmTarget.set(JvmTarget.JVM_21)
34+
}
35+
}
36+
37+
tasks.named("shadowJar", ShadowJar::class) {
38+
mergeServiceFiles()
39+
archiveFileName.set("${project.name}.jar")
40+
}
41+
42+
tasks.test {
43+
useJUnitPlatform()
44+
}
45+
}
46+

gradle/libs.versions.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[versions]
2+
kotlin = "1.9.20"
3+
kotlinCoroutines = "1.4.2"
4+
shadow = "8.1.1"
5+
kotlinPoet = "1.18.1"
6+
paper = "1.21-R0.1-SNAPSHOT"
7+
creative = "1.7.3"
8+
sonatypeCentralPortalPublisher = "1.2.3"
9+
10+
[libraries]
11+
kotlinJvm = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
12+
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
13+
kotlinCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinCoroutines" }
14+
kotlinPoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" }
15+
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
16+
17+
creativeApi = { module = "team.unnamed:creative-api", version.ref = "creative" }
18+
creativeSerializer = { module = "team.unnamed:creative-serializer-minecraft", version.ref = "creative" }
19+
20+
[bundles]
21+
creative = [
22+
"creativeApi",
23+
"creativeSerializer"
24+
]
25+
26+
[plugins]
27+
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
28+
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
29+
sonatypeCentralPortalPublisher = { id = "net.thebugmc.gradle.sonatype-central-portal-publisher", version.ref = "sonatypeCentralPortalPublisher" }

settings.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
2+
3+
pluginManagement {
4+
repositories {
5+
mavenCentral()
6+
gradlePluginPortal()
7+
}
8+
}
9+
10+
plugins {
11+
// Apply the foojay-resolver plugin to allow automatic download of JDKs
12+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
13+
}
14+
15+
rootProject.name = "solid-material"
16+
17+
include(
18+
"solid-material-gen",
19+
"solid-material-api",
20+
)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
`maven-publish`
3+
alias(libs.plugins.sonatypeCentralPortalPublisher)
4+
}
5+
6+
dependencies {
7+
compileOnly(libs.bundles.creative)
8+
}
9+
10+
publishing {
11+
publications {
12+
create<MavenPublication>("maven") {
13+
from(components["java"])
14+
}
15+
}
16+
}
17+
18+
19+
centralPortal {
20+
name = project.name
21+
22+
username = project.findProperty("sonatypeUsername") as? String
23+
password = project.findProperty("sonatypePassword") as? String
24+
25+
pom {
26+
name.set("Solid Material")
27+
description.set("A collection of auto generated enum classes for minecraft materials, holding important information for resource packs")
28+
url.set("https://github.com/solid-resourcepack/solid-material")
29+
30+
developers {
31+
developer {
32+
id.set("dayyeeet")
33+
email.set("david@cappell.net")
34+
}
35+
}
36+
licenses {
37+
license {
38+
name.set("Apache-2.0")
39+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
40+
}
41+
}
42+
scm {
43+
url.set("https://github.com/solid-resourcepack/solid-material")
44+
connection.set("git:git@github.com:solid-resourcepack/solid-material.git")
45+
}
46+
}
47+
}
48+
49+
signing {
50+
useGpgCmd()
51+
sign(publishing.publications)
52+
}
53+

0 commit comments

Comments
 (0)