Skip to content

Commit b295adf

Browse files
Split the mod up in 2 subprojects, add datagen subproject, improve 3D model generation/texture stitching (#8)
2 parents 2a34282 + f86802b commit b295adf

File tree

113 files changed

+1966
-706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1966
-706
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,19 @@ jobs:
3333
env:
3434
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
3535

36+
- name: Publish to Maven Repository
37+
if: ${{ success() && github.repository == 'GeyserMC/Rainbow' && github.ref_name == 'master' }}
38+
run: ./gradlew publish
39+
env:
40+
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
41+
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
42+
3643
- name: Archive Artifacts
3744
uses: GeyserMC/actions/upload-multi-artifact@master
3845
if: success()
3946
with:
4047
artifacts: |
41-
rainbow:build/libs/Rainbow.jar
48+
rainbow:client/build/libs/Rainbow.jar
4249
4350
- name: Get Version
4451
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Rainbow' }}
@@ -69,7 +76,7 @@ jobs:
6976
privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
7077
host: ${{ secrets.DOWNLOADS_SERVER_IP }}
7178
files: |
72-
build/libs/Rainbow.jar
79+
client/build/libs/Rainbow.jar
7380
changelog: ${{ steps.metadata.outputs.body }}
7481

7582
# - name: Publish to Modrinth
@@ -87,4 +94,4 @@ jobs:
8794
discordWebhook: ${{ secrets.DISCORD_WEBHOOK }}
8895
status: ${{ job.status }}
8996
body: ${{ steps.metadata.outputs.body }}
90-
includeDownloads: ${{ success() && github.repository == 'GeyserMC/Rainbow' && github.ref_name == 'master' }}
97+
includeDownloads: ${{ github.ref_name == 'master' }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Discord](https://img.shields.io/discord/613163671870242838.svg?color=%237289da&label=discord)](https://discord.gg/geysermc)
55

66
Rainbow is a client-side Minecraft mod for the Fabric modloader to generate Geyser item mappings and bedrock resourcepacks
7-
for use with Geyser's [custom item API (v2)](https://github.com/geyserMC/geyser/pull/5189). Rainbow is available for Minecraft 1.21.7 and 1.21.8.
7+
for use with Geyser's [custom item API (v2)](https://github.com/geyserMC/geyser/pull/5189). Rainbow is available for Minecraft 1.21.9 and 1.21.10.
88

99
Rainbow is currently experimental and capable of the following:
1010

build-logic/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
maven {
7+
name = "Fabric"
8+
url = uri("https://maven.fabricmc.net/")
9+
}
10+
gradlePluginPortal()
11+
}
12+
13+
dependencies {
14+
// Very ugly... https://github.com/gradle/gradle/issues/15383
15+
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
16+
17+
implementation(libs.fabric.loom)
18+
}

build-logic/settings.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
create("libs") {
4+
from(files("../gradle/libs.versions.toml"))
5+
}
6+
}
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import org.gradle.accessors.dm.LibrariesForLibs
2+
import org.gradle.api.Project
3+
import org.gradle.kotlin.dsl.getByType
4+
5+
val Project.libs: LibrariesForLibs
6+
get() = rootProject.extensions.getByType()
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
plugins {
2+
id("fabric-loom")
3+
}
4+
5+
version = properties["mod_version"]!! as String
6+
group = properties["maven_group"]!! as String
7+
8+
val archivesBaseName = properties["archives_base_name"]!! as String
9+
val targetJavaVersion = 21
10+
11+
base {
12+
archivesName = archivesBaseName
13+
}
14+
15+
repositories {
16+
maven {
17+
name = "ParchmentMC"
18+
url = uri("https://maven.parchmentmc.org")
19+
}
20+
21+
maven {
22+
name = "Jitpack"
23+
url = uri("https://jitpack.io")
24+
}
25+
26+
maven {
27+
name = "Open Collaboration"
28+
url = uri("https://repo.opencollab.dev/main")
29+
}
30+
}
31+
32+
dependencies {
33+
minecraft(libs.minecraft)
34+
mappings(loom.layered {
35+
officialMojangMappings()
36+
parchment(libs.parchment)
37+
})
38+
39+
modImplementation(libs.fabric.loader)
40+
modImplementation(libs.fabric.api)
41+
}
42+
43+
tasks {
44+
processResources {
45+
inputs.property("version", version)
46+
inputs.property("supported_versions", libs.versions.minecraft.supported.get())
47+
inputs.property("loader_version", libs.versions.fabric.loader.get())
48+
filteringCharset = "UTF-8"
49+
50+
filesMatching("fabric.mod.json") {
51+
expand(
52+
mapOf(
53+
"version" to version,
54+
"supported_versions" to libs.versions.minecraft.supported.get(),
55+
"loader_version" to libs.versions.fabric.loader.get()
56+
)
57+
)
58+
}
59+
}
60+
61+
jar {
62+
from("LICENSE") {
63+
rename { "${it}_${archivesBaseName}" }
64+
}
65+
}
66+
67+
withType<JavaCompile>().configureEach {
68+
options.encoding = "UTF-8"
69+
options.release = targetJavaVersion
70+
}
71+
}
72+
73+
java {
74+
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
75+
if (JavaVersion.current() < javaVersion) {
76+
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
77+
}
78+
withSourcesJar()
79+
}
80+
81+
loom {
82+
runs {
83+
named("server") {
84+
runDir = "run-server"
85+
}
86+
}
87+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
`maven-publish`
3+
}
4+
5+
val archivesBaseName = properties["archives_base_name"]!! as String
6+
7+
publishing {
8+
repositories {
9+
maven {
10+
name = "geysermc"
11+
url = uri(
12+
when {
13+
version.toString().endsWith("-SNAPSHOT") -> "https://repo.opencollab.dev/maven-snapshots"
14+
else -> "https://repo.opencollab.dev/maven-releases"
15+
}
16+
)
17+
credentials(PasswordCredentials::class)
18+
}
19+
}
20+
21+
publications {
22+
register("publish", MavenPublication::class) {
23+
artifactId = archivesBaseName
24+
from(project.components["java"])
25+
}
26+
}
27+
}

build.gradle

Lines changed: 0 additions & 76 deletions
This file was deleted.

client/build.gradle.kts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import net.fabricmc.loom.task.RemapJarTask
2+
3+
plugins {
4+
id("rainbow.base-conventions")
5+
id("rainbow.publish-conventions")
6+
}
7+
8+
dependencies {
9+
// Implement namedElements so IDEs can use it correctly, but include the remapped build
10+
implementation(project(path = ":rainbow", configuration = "namedElements"))
11+
include(project(":rainbow"))
12+
}
13+
14+
tasks {
15+
val copyJarTask = register<Copy>("copyRainbowClientJar") {
16+
group = "build"
17+
18+
val remapJarTask = getByName<RemapJarTask>("remapJar")
19+
dependsOn(remapJarTask)
20+
21+
from(remapJarTask.archiveFile)
22+
rename {
23+
"Rainbow.jar"
24+
}
25+
into(project.layout.buildDirectory.file("libs"))
26+
}
27+
28+
named("build") {
29+
dependsOn(copyJarTask)
30+
}
31+
}

client/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
archives_base_name=rainbow-client

0 commit comments

Comments
 (0)