Skip to content

Commit 858d66f

Browse files
committed
Clean fabric build jar.
1 parent 2c0b5a9 commit 858d66f

File tree

2 files changed

+12
-50
lines changed

2 files changed

+12
-50
lines changed

bootstrap/fabric/build.gradle.kts

+11-47
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ repositories {
1414
// }
1515
}
1616

17-
configurations.create("merge")
18-
1917
dependencies {
2018
minecraft("com.mojang:minecraft:${project.properties["minecraft_version"]}")
2119
mappings(loom.layered {
@@ -31,18 +29,8 @@ dependencies {
3129
//Kyori
3230
modCompileOnly("net.fabricmc:fabric-loader:${project.properties["loader_version"]}")
3331
modCompileOnly("net.fabricmc.fabric-api:fabric-api:${project.properties["fabric_version"]}")
34-
modImplementation("net.kyori:adventure-platform-mod-shared-fabric-repack:6.1.0") {
35-
exclude("net.kyori", "adventure-api")
36-
exclude("net.fabricmc")
37-
}
38-
modImplementation("net.kyori:adventure-platform-fabric:6.1.0") {
39-
exclude("net.kyori", "adventure-api")
40-
exclude("net.fabricmc")
41-
}
42-
43-
//Shadow
44-
"merge"("net.kyori:adventure-text-serializer-legacy:4.17.0")
45-
"merge"("net.kyori:adventure-api:4.17.0")
32+
modImplementation(include("net.kyori:adventure-platform-mod-shared-fabric-repack:6.1.0")!!)
33+
modImplementation(include("net.kyori:adventure-platform-fabric:6.1.0")!!)
4634
}
4735

4836
loom {
@@ -62,53 +50,29 @@ fabricModJson {
6250
license = listOf("MIT")
6351
environment = Environment.SERVER
6452
entrypoints = listOf(
65-
mainEntrypoint("net.kyori.adventure.platform.fabric.impl.AdventureFabricCommon"),
66-
mainEntrypoint("net.kyori.adventure.platform.fabric.impl.compat.permissions.PermissionsApiIntegration"),
67-
entrypoint("adventure-internal:sidedproxy/server", "net.kyori.adventure.platform.modcommon.impl.server.DedicatedServerProxy"),
68-
serverEntrypoint("kr.toxicity.hud.bootstrap.fabric.FabricBootstrapImpl"),
53+
serverEntrypoint("kr.toxicity.hud.bootstrap.fabric.FabricBootstrapImpl")
6954
)
7055
depends = mapOf(
7156
"fabricloader" to listOf(">=${project.properties["loader_version"]}"),
7257
"minecraft" to listOf("~${project.properties["minecraft_version"]}"),
7358
"java" to listOf(">=21"),
74-
"fabric-api" to listOf("*")
75-
)
76-
mixins = listOf(
77-
mixin("adventure-platform-fabric.accessor.mixins.json"),
78-
mixin("adventure-platform-fabric.mixins.json"),
79-
mixin("adventure-platform-mod-shared.accessor.mixins.json"),
80-
mixin("adventure-platform-mod-shared.mixins.json")
59+
"fabric-api" to listOf("*"),
60+
"adventure-platform-fabric" to listOf("*"),
61+
"polymer-resource-pack" to listOf("*"),
62+
"placeholder-api" to listOf("*")
8163
)
8264
suggests = mapOf(
83-
"placeholder-api" to listOf("*"),
8465
"luckperms" to listOf("*"),
85-
"polymer-resource-pack" to listOf("*")
8666
)
8767
}
8868

89-
val addedJar by tasks.creating(Jar::class.java) {
90-
from(sourceSets.main.get().output)
91-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
92-
configurations.modImplementation.map {
93-
it.resolve()
94-
}.get().forEach {
95-
from(zipTree(it)) {
96-
exclude("META-INF/*.SF")
97-
exclude("META-INF/*.DSA")
98-
exclude("META-INF/*.RSA")
99-
}
100-
}
101-
}
102-
10369
tasks {
10470
remapJar {
105-
inputFile = addedJar.archiveFile
10671
archiveClassifier = "remapped"
107-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
108-
configurations.getByName("merge").forEach {
109-
from(zipTree(it)) {
110-
exclude("META-INF/**")
111-
}
72+
from(configurations.modImplementation.get().filter {
73+
!it.name.startsWith("fabric")
74+
}) {
75+
into("META-INF/jars")
11276
}
11377
}
11478
runServer {

build.gradle.kts

+1-3
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ val fabricJar by tasks.creating(Jar::class.java) {
333333
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
334334
from(zipTree(fabricBootstrap.tasks.named("remapJar").map {
335335
(it as org.gradle.jvm.tasks.Jar).archiveFile
336-
})) {
337-
exclude("META-INF/jars/**")
338-
}
336+
}))
339337
from(zipTree(tasks.shadowJar.map {
340338
it.archiveFile
341339
}))

0 commit comments

Comments
 (0)