Skip to content

Commit ce94c3e

Browse files
committed
Update to commit e68fc13a41e7b0268b6ad86b31d16b4937a2b81c with changes.
1 parent cc20ac7 commit ce94c3e

243 files changed

Lines changed: 5451 additions & 2058 deletions

File tree

Some content is hidden

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

.github/builds/mc_version.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,22 @@
44
*/
55

66
import * as fs from "fs"
7-
import * as readline from "readline"
7+
import * as path from "path"
8+
import {fileURLToPath} from "url"
89

9-
export async function getMcVersion() {
10-
let lines = readline.createInterface({
11-
input: fs.createReadStream("../../gradle.properties"),
12-
crlfDelay: Infinity
13-
})
10+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1411

15-
let mcVersion = ""
12+
export async function getMcVersion() {
13+
const filePath = path.resolve(__dirname, "../../gradle/libs.versions.toml")
1614

17-
for await (const line of lines) {
18-
if (line.startsWith("minecraft_version")) {
19-
mcVersion = line.substring(line.indexOf("=") + 1)
20-
break
21-
}
15+
if (!fs.existsSync(filePath)) {
16+
throw new Error(`File not found: ${filePath}`)
2217
}
2318

24-
if (mcVersion === "") {
25-
console.log("Failed to read minecraft_version")
26-
process.exit(1)
27-
}
19+
const content = await fs.promises.readFile(filePath, "utf-8")
20+
21+
const match = content.match(/^\s*minecraft\s*=\s*["']([^"']+)["']\s*$/m)
22+
if (match) return match[1].trim()
2823

29-
return mcVersion
24+
throw new Error(`Failed to find minecraft version in ${filePath}`)
3025
}

build.gradle.kts

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("fabric-loom") version "1.11-SNAPSHOT"
2+
alias(libs.plugins.fabric.loom)
33
id("maven-publish")
44
}
55

@@ -13,7 +13,7 @@ base {
1313
"local"
1414
}
1515

16-
version = properties["minecraft_version"] as String + "-" + suffix
16+
version = libs.versions.minecraft.get() + "-" + suffix
1717
}
1818

1919
repositories {
@@ -69,37 +69,47 @@ configurations {
6969
}
7070
}
7171

72+
sourceSets.create("launcher")
73+
7274
dependencies {
7375
// Fabric
74-
minecraft("com.mojang:minecraft:${properties["minecraft_version"] as String}")
75-
mappings("net.fabricmc:yarn:${properties["yarn_mappings"] as String}:v2")
76-
modImplementation("net.fabricmc:fabric-loader:${properties["loader_version"] as String}")
76+
minecraft(libs.minecraft)
77+
mappings(variantOf(libs.yarn) { classifier("v2") })
78+
modImplementation(libs.fabric.loader)
7779

78-
modInclude(fabricApi.module("fabric-api-base", properties["fapi_version"] as String))
79-
modInclude(fabricApi.module("fabric-resource-loader-v0", properties["fapi_version"] as String))
80-
modInclude(fabricApi.module("fabric-resource-loader-v1", properties["fapi_version"] as String))
80+
val fapiVersion = libs.versions.fabric.api.get()
81+
modInclude(fabricApi.module("fabric-api-base", fapiVersion))
82+
modInclude(fabricApi.module("fabric-resource-loader-v1", fapiVersion))
8183

8284
// Compat fixes
83-
modCompileOnly(fabricApi.module("fabric-renderer-indigo", properties["fapi_version"] as String))
84-
modCompileOnly("maven.modrinth:sodium:${properties["sodium_version"] as String}") { isTransitive = false }
85-
modCompileOnly("maven.modrinth:lithium:${properties["lithium_version"] as String}") { isTransitive = false }
86-
modCompileOnly("maven.modrinth:iris:${properties["iris_version"] as String}") { isTransitive = false }
87-
modCompileOnly("com.viaversion:viafabricplus:${properties["viafabricplus_version"] as String}") { isTransitive = false }
88-
modCompileOnly("com.viaversion:viafabricplus-api:${properties["viafabricplus_version"] as String}") { isTransitive = false }
89-
90-
// Baritone (https://github.com/MeteorDevelopment/baritone)
91-
modCompileOnly("meteordevelopment:baritone:${properties["baritone_version"] as String}-SNAPSHOT")
92-
// ModMenu (https://github.com/TerraformersMC/ModMenu)
93-
modCompileOnly("com.terraformersmc:modmenu:${properties["modmenu_version"] as String}")
94-
95-
// Libraries
96-
jij("meteordevelopment:orbit:${properties["orbit_version"] as String}")
97-
jij("org.meteordev:starscript:${properties["starscript_version"] as String}")
98-
jij("meteordevelopment:discord-ipc:${properties["discordipc_version"] as String}")
99-
jij("org.reflections:reflections:${properties["reflections_version"] as String}")
100-
jij("io.netty:netty-handler-proxy:${properties["netty_version"] as String}") { isTransitive = false }
101-
jij("io.netty:netty-codec-socks:${properties["netty_version"] as String}") { isTransitive = false }
102-
jij("de.florianmichael:WaybackAuthLib:${properties["waybackauthlib_version"] as String}")
85+
modCompileOnly(fabricApi.module("fabric-renderer-indigo", fapiVersion))
86+
modCompileOnly(libs.sodium) { isTransitive = false }
87+
modCompileOnly(libs.lithium) { isTransitive = false }
88+
modCompileOnly(libs.iris) { isTransitive = false }
89+
modCompileOnly(libs.viafabricplus) { isTransitive = false }
90+
modCompileOnly(libs.viafabricplus.api) { isTransitive = false }
91+
92+
modCompileOnly(libs.baritone)
93+
modCompileOnly(libs.modmenu)
94+
95+
// Libraries (JAR-in-JAR)
96+
jij(libs.orbit)
97+
jij(libs.starscript)
98+
jij(libs.discord.ipc)
99+
jij(libs.reflections)
100+
jij(libs.netty.handler.proxy) { isTransitive = false }
101+
jij(libs.netty.codec.socks) { isTransitive = false }
102+
jij(libs.waybackauthlib)
103+
}
104+
105+
sourceSets {
106+
val launcher = getByName("launcher")
107+
108+
launcher.apply {
109+
java {
110+
srcDir("src/launcher/java")
111+
}
112+
}
103113
}
104114

105115
// Handle transitive dependencies for jar-in-jar
@@ -115,7 +125,6 @@ afterEvaluate {
115125
"jsr305" // Compile time annotations only
116126
)
117127

118-
119128
jijConfig.incoming.resolutionResult.allDependencies.forEach { dep ->
120129
val requested = dep.requested.displayName
121130

@@ -137,12 +146,6 @@ loom {
137146
accessWidenerPath = file("src/main/resources/meteor-client.accesswidener")
138147
}
139148

140-
afterEvaluate {
141-
tasks.migrateMappings.configure {
142-
outputDir.set(project.file("src/main/java"))
143-
}
144-
}
145-
146149
tasks {
147150
processResources {
148151
val buildNumber = project.findProperty("build_number")?.toString() ?: ""
@@ -152,8 +155,8 @@ tasks {
152155
"version" to project.version,
153156
"build_number" to buildNumber,
154157
"commit" to commit,
155-
"minecraft_version" to project.property("minecraft_version"),
156-
"loader_version" to project.property("loader_version")
158+
"minecraft_version" to libs.versions.minecraft.get(),
159+
"loader_version" to libs.versions.fabric.loader.get()
157160
)
158161

159162
inputs.properties(propertyMap)
@@ -162,16 +165,24 @@ tasks {
162165
}
163166
}
164167

168+
// Compile launcher with Java 8 for backwards compatibility
169+
getByName<JavaCompile>("compileLauncherJava") {
170+
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
171+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
172+
options.compilerArgs.add("-Xlint:-options")
173+
}
174+
165175
jar {
166176
inputs.property("archivesName", project.base.archivesName.get())
167177

168178
from("LICENSE") {
169179
rename { "${it}_${inputs.properties["archivesName"]}" }
170180
}
171181

172-
// Launch sub project
173-
dependsOn(":launch:compileJava")
174-
from(project(":launch").layout.buildDirectory.dir("classes/java/main"))
182+
// Include launcher classes
183+
val launcher = sourceSets.getByName("launcher")
184+
from(launcher.output.classesDirs)
185+
from(launcher.output.resourcesDir)
175186

176187
manifest {
177188
attributes["Main-Class"] = "meteordevelopment.meteorclient.Main"
@@ -189,7 +200,6 @@ tasks {
189200
}
190201

191202
withType<JavaCompile> {
192-
options.release = 21
193203
options.compilerArgs.add("-Xlint:deprecation")
194204
options.compilerArgs.add("-Xlint:unchecked")
195205
}
@@ -215,7 +225,7 @@ publishing {
215225
from(components["java"])
216226
artifactId = "meteor-client"
217227

218-
version = properties["minecraft_version"] as String + "-SNAPSHOT"
228+
version = libs.versions.minecraft.get() + "-SNAPSHOT"
219229
}
220230
}
221231

gradle.properties

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
11
org.gradle.jvmargs=-Xmx2G
22
org.gradle.configuration-cache=false
33

4-
# Fabric (https://fabricmc.net/develop)
5-
minecraft_version=1.21.10
6-
yarn_mappings=1.21.10+build.1
7-
loader_version=0.17.2
8-
fapi_version=0.135.0+1.21.10
9-
104
# Mod Properties
115
maven_group=meteordevelopment
12-
archives_base_name=meteor-lite
13-
14-
# Dependency Versions
15-
16-
# Baritone (https://github.com/MeteorDevelopment/baritone)
17-
baritone_version=1.21.10
18-
19-
# Sodium (https://github.com/CaffeineMC/sodium-fabric)
20-
sodium_version=mc1.21.10-0.7.2-fabric
21-
22-
# Lithium (https://github.com/CaffeineMC/lithium-fabric)
23-
lithium_version=mc1.21.10-0.20.0-fabric
24-
25-
# Iris (https://github.com/IrisShaders/Iris)
26-
iris_version=1.9.6+1.21.10-fabric
27-
28-
# ModMenu (https://github.com/TerraformersMC/ModMenu)
29-
modmenu_version=15.0.0
30-
31-
# Orbit (https://github.com/MeteorDevelopment/orbit)
32-
orbit_version=0.2.4
33-
34-
# Starscript (https://github.com/MeteorDevelopment/starscript)
35-
starscript_version=0.2.5
36-
37-
# DiscordRPC (https://github.com/MeteorDevelopment/java-discord-rpc)
38-
discordipc_version=1.1
39-
40-
# Reflections (https://github.com/ronmamo/reflections)
41-
reflections_version=0.10.2
42-
43-
# Netty (https://github.com/netty/netty)
44-
netty_version=4.1.118.Final
45-
46-
# ViaFabricPlus (https://github.com/ViaVersion/ViaFabricPlus)
47-
viafabricplus_version=4.3.1
48-
49-
# WaybackAuthLib (https://github.com/FlorianMichael/WaybackAuthLib)
50-
waybackauthlib_version=1.0.1
6+
archives_base_name=meteor-lite

gradle/libs.versions.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[versions]
2+
# Fabric (https://fabricmc.net/develop)
3+
minecraft = "1.21.11"
4+
yarn-mappings = "1.21.11+build.3"
5+
fabric-loader = "0.18.2"
6+
fabric-api = "0.140.0+1.21.11"
7+
8+
# Plugins
9+
# Loom (https://github.com/FabricMC/fabric-loom)
10+
loom = "1.14-SNAPSHOT"
11+
12+
# Mods
13+
# Baritone (https://github.com/MeteorDevelopment/baritone)
14+
baritone = "1.21.10-SNAPSHOT"
15+
# Sodium (https://github.com/CaffeineMC/sodium-fabric)
16+
sodium = "mc1.21.11-0.8.0-fabric"
17+
# Lithium (https://github.com/CaffeineMC/lithium-fabric)
18+
lithium = "mc1.21.11-0.21.1-fabric"
19+
# Iris (https://github.com/IrisShaders/Iris)
20+
iris = "1.10.2+1.21.11-fabric"
21+
# ModMenu (https://github.com/TerraformersMC/ModMenu)
22+
modmenu = "15.0.0"
23+
# Orbit (https://github.com/MeteorDevelopment/orbit)
24+
orbit = "0.2.4"
25+
# Starscript (https://github.com/MeteorDevelopment/starscript)
26+
starscript = "0.2.5"
27+
# DiscordRPC (https://github.com/MeteorDevelopment/java-discord-rpc)
28+
discordipc = "1.1"
29+
# Reflections (https://github.com/ronmamo/reflections)
30+
reflections = "0.10.2"
31+
# Netty (https://github.com/netty/netty)
32+
netty = "4.2.7.Final"
33+
# ViaFabricPlus (https://github.com/ViaVersion/ViaFabricPlus)
34+
viafabricplus = "4.4.0"
35+
# WaybackAuthLib (https://github.com/FlorianMichael/WaybackAuthLib)
36+
waybackauthlib = "1.0.1"
37+
38+
[libraries]
39+
# Fabric base
40+
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
41+
yarn = { module = "net.fabricmc:yarn", version.ref = "yarn-mappings" }
42+
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }
43+
44+
# Mods
45+
sodium = { module = "maven.modrinth:sodium", version.ref = "sodium" }
46+
lithium = { module = "maven.modrinth:lithium", version.ref = "lithium" }
47+
iris = { module = "maven.modrinth:iris", version.ref = "iris" }
48+
baritone = { module = "meteordevelopment:baritone", version.ref = "baritone" }
49+
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
50+
viafabricplus = { module = "com.viaversion:viafabricplus", version.ref = "viafabricplus" }
51+
viafabricplus-api = { module = "com.viaversion:viafabricplus-api", version.ref = "viafabricplus" }
52+
53+
# Libraries
54+
orbit = { module = "meteordevelopment:orbit", version.ref = "orbit" }
55+
starscript = { module = "org.meteordev:starscript", version.ref = "starscript" }
56+
discord-ipc = { module = "meteordevelopment:discord-ipc", version.ref = "discordipc" }
57+
reflections = { module = "org.reflections:reflections", version.ref = "reflections" }
58+
netty-handler-proxy = { module = "io.netty:netty-handler-proxy", version.ref = "netty" }
59+
netty-codec-socks = { module = "io.netty:netty-codec-socks", version.ref = "netty" }
60+
waybackauthlib = { module = "de.florianmichael:WaybackAuthLib", version.ref = "waybackauthlib" }
61+
62+
[plugins]
63+
fabric-loom = { id = "fabric-loom", version.ref = "loom" }

gradle/wrapper/gradle-wrapper.jar

176 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

launch/build.gradle.kts

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

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ pluginManagement {
99
}
1010
}
1111

12-
include("launch")
12+
rootProject.name = "meteor-client"

0 commit comments

Comments
 (0)