Skip to content

Commit

Permalink
more suffering
Browse files Browse the repository at this point in the history
  • Loading branch information
player005 committed Oct 8, 2024
1 parent d706717 commit d47b9c2
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 29 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
id("fabric-loom") version "1.7.3" apply false
}

val MINECRAFT_VERSION by extra { "1.20.4" }
val NEOFORGE_VERSION by extra { "20.4.237" }
val MINECRAFT_VERSION by extra { "1.20.6" }
val NEOFORGE_VERSION by extra { "20.6.121" }
val FABRIC_LOADER_VERSION by extra { "0.16.5" }
val FABRIC_API_VERSION by extra { "0.91.6+1.20.2" }
val FABRIC_API_VERSION by extra { "0.100.8+1.20.6" }

val PARCHMENT_VERSION by extra { "2024.04.14" }
val PARCHMENT_VERSION by extra { "2024.06.16" }

val MOD_VERSION by extra { "1.1.1" }

Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
parchment("org.parchmentmc.data:parchment-${MINECRAFT_VERSION}:${PARCHMENT_VERSION}@zip")
})

modImplementation("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
//modImplementation("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
}

tasks {
Expand Down
49 changes: 42 additions & 7 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,54 @@ val PARCHMENT_VERSION: String? by rootProject.extra
val FABRIC_LOADER_VERSION: String by rootProject.extra
val FABRIC_API_VERSION: String by rootProject.extra

dependencies {
minecraft(group = "com.mojang", name = "minecraft", version = MINECRAFT_VERSION)

mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${MINECRAFT_VERSION}:${PARCHMENT_VERSION}@zip")
})
base {
archivesName.set("vegan-delight-fabric-${MINECRAFT_VERSION}")
}

modImplementation("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
loom {
runs {
named("client") {
client()
configName = "Fabric Client"
ideConfigGenerated(true)
runDir("run")
}
named("server") {
server()
configName = "Fabric Server"
ideConfigGenerated(true)
runDir("run")
}
}
}

tasks {
withType<JavaCompile> {
source(project(":common").sourceSets.main.get().allSource)
}

javadoc { source(project(":common").sourceSets.main.get().allJava) }

processResources {
from(project(":common").sourceSets.main.get().resources)

inputs.property("version", project.version)

filesMatching("fabric.mod.json") {
expand(mapOf("version" to project.version))
}
}

jar {
from(rootDir.resolve("LICENSE.md"))
}
}

dependencies {
minecraft("com.mojang:minecraft:${MINECRAFT_VERSION}")

mappings(loom.officialMojangMappings())
modImplementation("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
compileOnly(project(":common"))
}
44 changes: 27 additions & 17 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
id("java")
id("idea")
id("net.neoforged.moddev") version "1.0.20"
// id("net.neoforged.moddev") version "2.0.34-beta"
// id("net.minecraftforge.gradle") version "[6.0,6.2)"
id("net.neoforged.gradle.userdev") version "7.0.165"
}

val MINECRAFT_VERSION: String by rootProject.extra
Expand All @@ -28,26 +29,17 @@ tasks.jar {

tasks.jar.get().destinationDirectory = rootDir.resolve("build").resolve("libs")

neoForge {
// Specify the version of NeoForge to use.
version = NEOFORGE_VERSION

parchment {
minecraftVersion = MINECRAFT_VERSION
mappingsVersion = PARCHMENT_VERSION
runs {
configureEach {
modSource(project.sourceSets.main.get())
}
create("client") {

runs {
create("client") {
client()
}
}

mods {
create("no_escape") {
sourceSet(sourceSets.main.get())
sourceSet(project(":common").sourceSets.main.get())
}
create("data") {
programArguments.addAll("--mod", "vegandelight", "--all", "--output", file("src/generated/resources/").getAbsolutePath(), "--existing", file("src/main/resources/").getAbsolutePath())
}
}

Expand All @@ -56,7 +48,25 @@ tasks.named("compileTestJava").configure {
}

dependencies {
implementation(project.project(":common").sourceSets.main.get().output)
implementation("net.neoforged:neoforge:${NEOFORGE_VERSION}")
compileOnly(project.project(":common").sourceSets.main.get().output)
}


// NeoGradle compiles the game, but we don't want to add our common code to the game's code
val notNeoTask: (Task) -> Boolean = { it: Task -> !it.name.startsWith("neo") && !it.name.startsWith("compileService") }

tasks.withType<JavaCompile>().matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.get().allSource)
}

tasks.withType<Javadoc>().matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.get().allJava)
}

tasks.withType<ProcessResources>().matching(notNeoTask).configureEach {
from(project(":common").sourceSets.main.get().resources)
}


java.toolchain.languageVersion = JavaLanguageVersion.of(21)

0 comments on commit d47b9c2

Please sign in to comment.