Skip to content

Commit

Permalink
importNeoForge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecdcaeb authored May 3, 2024
1 parent abb1947 commit fb7bc0f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
37 changes: 12 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ buildscript {
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.10.+', changing: true
classpath group: 'net.neoforged.gradle.userdev', name: 'NeoGradle', version: '7.0.109', changing: false
classpath "org.spongepowered:mixingradle:0.7.+"
}
}

//if (propertyBool('use_mirror')) apply from: "gradle/scripts/mirror.gradle"

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'net.neoforged.gradle.userdev'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'java'
Expand Down Expand Up @@ -147,7 +145,7 @@ dependencies {
// The "userdev" classifier will be requested and setup by ForgeGradle.
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "com.cleanroommc:cleanroom:${project.cleanroom_version}"
implementation "com.cleanroommc:cleanroom:${project.cleanroom_version}"

// Example mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
Expand Down Expand Up @@ -190,30 +188,12 @@ dependencies {
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.named('processResources', ProcessResources).configure {
processResources {
def filterList = ['mcmod.info', 'pack.mcmeta']
filterList.addAll(propertyStringList('mixin_configs').collect(config -> "mixins.${config}.json" as String))

var replaceProperties = [
mod_id: propertyString('mod_id'),
mod_name: propertyString('mod_name'),
mod_version: propertyString('mod_version'),
mod_description: propertyString('mod_description'),
mod_authors: "[${propertyStringList('mod_authors', ',').join(', ')}]",
mod_credits: propertyString('mod_credits'),
mod_url: propertyString('mod_url'),
mod_update_json: propertyString('mod_update_json'),
mod_logo_path: propertyString('mod_logo_path'),
mixin_refmap: propertyString('mixin_refmap'),
mixin_package: propertyString('mixin_package')

]
inputs.properties replaceProperties

filesMatching(filterList) {
expand replaceProperties + [project: project]
expand project.properties
}

if (propertyBool('use_access_transformer')) {
rename '(.+_at.cfg)', 'META-INF/$1'
}
Expand Down Expand Up @@ -274,6 +254,13 @@ eclipse {
// Run when importing the project
synchronizationTasks 'genEclipseRuns'
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}

// Merge the resources and classes into the same directory.
// This is done because java expects modules to be in a single directory.
Expand Down
6 changes: 5 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ pluginManagement {
name = 'OutLands'
url = 'https://maven.outlands.top/releases'
}
maven {
name = 'NeoForge'
url = 'https://maven.neoforged.net/releases'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

// Due to an IntelliJ bug, this has to be done
Expand Down

0 comments on commit fb7bc0f

Please sign in to comment.