Started by
Raikin7
on
Topic category: Plugins and third-party tools
This is how I did it! If you have any questions or improvements feel free to reply! Note this is for 1.19.2 ill likely update it for 1.20 eventually
Does require all mods for forge
https://mcreator.net/plugin/87903/all-mods
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
version = '1.0'
group = 'com.yourname.modid'
archivesBaseName = 'modid'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'official', version: '1.19.2'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
repositories {
mavenCentral()
maven { url = 'https://maven.spongepowered.org/maven' } // SpongePowered Maven repository
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://cursemaven.com' }
}
//added JEI for incase you were wondering how!
dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-43.2.0'
implementation 'org.spongepowered:spongeapi:9.0.0'
implementation fg.deobf("curse.maven:jei-238222:4712866")
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
apply from: 'mcreator.gradle'
def curseMaven(String dependency) {
def parts = dependency.split(':')
if (parts.length == 3) {
return "curse.maven:${parts[0]}-${parts[1]}:${parts[2]}"
} else {
throw new GradleException("Invalid curse.maven dependency format: $dependency")
}
}
Edited by Raikin7 on Fri, 02/02/2024 - 12:18