Skip to content

Commit

Permalink
tried getting environment annotation remapping working on forge side
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 10, 2024
1 parent 9646ec7 commit b029d7f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import xyz.wagyourtail.unimined.expect.task.ExpectPlatformJar
plugins {
id "net.neoforged.moddev.legacyforge"
id 'xyz.wagyourtail.unimined.expect-platform' version '1.0.5'
Expand All @@ -18,12 +19,16 @@ neoForge {
runs {
client {
client()

}
data {
data()
}
server {
server()
/*expectPlatform.insertAgent(it, "forge", ["xyz/wagyourtail/unimined/expect/annotation/Environment": "net/minecraftforge/api/distmarker/OnlyIn",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType": "net/minecraftforge/api/distmarker/Dist",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType.SERVER": "DEDICATED_SERVER",])*/
}
}
mods {
Expand Down Expand Up @@ -99,9 +104,6 @@ Dependency include(Object dep){

tasks.named('compileJava', JavaCompile) {
source(project(":antimatter-common").sourceSets.main.allSource)
/*expectPlatform.insertAgent(it, "forge", ["xyz/wagyourtail/unimined/expect/annotation/Environment": "net/minecraftforge/api/distmarker/OnlyIn",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType": "net/minecraftforge/api/distmarker/Dist",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType.SERVER": "DEDICATED_SERVER",])*/
}

processResources {
Expand All @@ -118,14 +120,25 @@ sourcesJar {
from(project(':antimatter-common').sourceSets.main.allSource)
}

tasks.named('jar', Jar).configure {
tasks.create("platformJar", ExpectPlatformJar){
platformName = "forge"
inputFiles = sourceSets.main.output
archiveClassifier.set "platform"
remap = ["xyz/wagyourtail/unimined/expect/annotation/Environment": "net/minecraftforge/api/distmarker/OnlyIn",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType": "net/minecraftforge/api/distmarker/Dist",
"xyz/wagyourtail/unimined/expect/annotation/Environment\$EnvType.SERVER": "DEDICATED_SERVER"]
}

tasks.named('reobfJar', Jar).configure {
//input.set(platformJar.archiveFile)
dependsOn platformJar
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "Trinsdar",
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Version' : project.version,
'Implementation-Vendor' : "Trinsdar",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
Expand Down

0 comments on commit b029d7f

Please sign in to comment.