Skip to content

Commit

Permalink
Apply MultiLoader Template's latest changes, though the same import i…
Browse files Browse the repository at this point in the history
…ssue still occurs. Noteworthy, a fresh clone of MultiLoader template doesn't have the issue, so need to go through and make sure we match
  • Loading branch information
BlayTheNinth committed Nov 11, 2023
1 parent 4f2f4ca commit 0cc8f87
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ java_version = 17

# Forge
forge_version = 48.0.1
forge_version_range=[48.0.0,)
forge_version_range=[48,)
forge_loader_version_range=[48,)
forge_mixins=true

# NeoForge
neoforge_version = 20.2.8-beta
neoforge_version = 20.2.47-beta
neoforge_version_range=[20.2,)
neoforge_loader_version_range=[1,)
mapping_channel=official
Expand Down
29 changes: 22 additions & 7 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.5'
id 'net.neoforged.gradle.userdev' version '7.0.41'
id 'net.darkhax.curseforgegradle' version '1.0.14'
id "com.modrinth.minotaur" version "2.+"
}
Expand All @@ -20,6 +20,9 @@ base {

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

if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
}
runs {
configureEach {
// Recommended logging data for a userdev environment
Expand Down Expand Up @@ -70,19 +73,31 @@ dependencies {
compileOnly project(":shared")

compileOnly "org.jetbrains:annotations:22.0.0"

compileOnly "mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version"
if (jei_minecraft_version == minecraft_version) {
runtimeOnly "mezz.jei:jei-$jei_minecraft_version-forge:$jei_version"
}
}

apply from: 'dependencies.gradle'

tasks.withType(JavaCompile) {
// NeoGradle compiles the game, but we don't want to add our common code to the game's code
TaskCollection.metaClass.excludingNeoTasks = { ->
delegate.matching { !it.name.startsWith("neo") }
}

tasks.withType(JavaCompile).excludingNeoTasks().configureEach {
source(project(":shared").sourceSets.main.allSource)
}

tasks.withType(Javadoc).excludingNeoTasks().configureEach {
source(project(":shared").sourceSets.main.allJava)
}

tasks.named("sourcesJar", Jar) {
from(project(":shared").sourceSets.main.allSource)
}

tasks.withType(ProcessResources).excludingNeoTasks().configureEach {
from project(":shared").sourceSets.main.resources
}

def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
def replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
Expand Down
4 changes: 4 additions & 0 deletions neoforge/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
dependencies {
compileOnly "mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version"
if (jei_minecraft_version == minecraft_version) {
runtimeOnly "mezz.jei:jei-$jei_minecraft_version-forge:$jei_version"
}
}
9 changes: 8 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'NeoForge'
url = 'https://maven.neoforged.net/releases/'
}
maven {
name = 'Forge'
url = 'https://maven.minecraftforge.net/'
}
maven {
name = 'Sponge Snapshots'
url = 'https://repo.spongepowered.org/repository/maven-public/'
Expand Down

0 comments on commit 0cc8f87

Please sign in to comment.