Merge pull request #54 from jaredlll08/refactor-1.20.4

Modernize the template
This commit is contained in:
Jared 2024-04-22 20:55:54 -06:00 committed by GitHub
commit ac3fddf1cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 310 additions and 323 deletions

View File

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Fabric sources" pattern="!ext[Gradle: cpw.mods:*:*]:*/&amp;&amp;!ext[Gradle: mezz.jei:*:*:*]:*/&amp;&amp;!ext[Gradle: net.jodah:typetools:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:client:extra:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:joined*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:mappings_official:zip:*]:*/&amp;&amp;!ext[Gradle: net.minecraftforge:*:*]:*/" />
</component>

View File

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Forge sources" pattern="!ext[Gradle: loom_mappings_*:*:*]:*/&amp;&amp;!ext[Gradle: net.fabricmc:*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:joined*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:mappings_official:zip:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:minecraft-project-*:*]:*/" />
</component>

View File

@ -2,90 +2,3 @@ plugins {
// Required for NeoGradle // Required for NeoGradle
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
} }
subprojects {
apply plugin: 'java'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
java.withJavadocJar()
jar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
}
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version
])
}
}
sourcesJar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
}
}
repositories {
mavenCentral()
maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)'
url = 'https://maven.blamejared.com'
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.getRelease().set(17)
}
processResources {
def expandProps = [
"version": version,
"group": project.group, //Else we target the task's group.
"minecraft_version": minecraft_version,
"forge_version": forge_version,
"forge_loader_version_range": forge_loader_version_range,
"forge_version_range": forge_version_range,
"minecraft_version_range": minecraft_version_range,
"fabric_version": fabric_version,
"fabric_loader_version": fabric_loader_version,
"mod_name": mod_name,
"mod_author": mod_author,
"mod_id": mod_id,
"license": license,
"description": project.description,
"neoforge_version": neoforge_version,
"neoforge_loader_version_range": neoforge_loader_version_range,
"credits": credits
]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
}

3
buildSrc/build.gradle Normal file
View File

@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}

View File

@ -0,0 +1,114 @@
plugins {
id 'java-library'
id 'maven-publish'
}
base {
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
filter { includeGroupAndSubgroups("org.spongepowered") }
}
maven {
name = 'BlameJared'
url = 'https://maven.blamejared.com'
}
}
dependencies {
implementation 'org.jetbrains:annotations:24.1.0'
}
// Declare capabilities on the outgoing configurations.
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
capability("$group:$mod_id:$version")
}
publishing.publications.configureEach {
suppressPomMetadataWarningsFor(variant)
}
}
sourcesJar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
}
}
jar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
}
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version': project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Built-On-Minecraft' : minecraft_version
])
}
}
processResources {
def expandProps = [
"version": version,
"group": project.group, //Else we target the task's group.
"minecraft_version": minecraft_version,
"forge_version": forge_version,
"forge_loader_version_range": forge_loader_version_range,
"forge_version_range": forge_version_range,
"minecraft_version_range": minecraft_version_range,
"fabric_version": fabric_version,
"fabric_loader_version": fabric_loader_version,
"mod_name": mod_name,
"mod_author": mod_author,
"mod_id": mod_id,
"license": license,
"description": project.description,
"neoforge_version": neoforge_version,
"neoforge_loader_version_range": neoforge_loader_version_range,
"credits": credits,
"java_version": java_version
]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}
publishing {
publications {
register('mavenJava', MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url System.getenv("local_maven_url")
}
}
}

View File

@ -0,0 +1,44 @@
plugins {
id 'multiloader-common'
}
configurations {
commonJava{
canBeResolved = true
}
commonResources{
canBeResolved = true
}
}
dependencies {
compileOnly(project(':common')) {
capabilities {
requireCapability "$group:$mod_id"
}
}
commonJava project(path: ':common', configuration: 'commonJava')
commonResources project(path: ':common', configuration: 'commonResources')
}
tasks.named('compileJava', JavaCompile) {
dependsOn(configurations.commonJava)
source(configurations.commonJava)
}
processResources {
dependsOn(configurations.commonResources)
from(configurations.commonResources)
}
tasks.named('javadoc', Javadoc).configure {
dependsOn(configurations.commonJava)
source(configurations.commonJava)
}
tasks.named("sourcesJar", Jar) {
dependsOn(configurations.commonJava)
from(configurations.commonJava)
dependsOn(configurations.commonResources)
from(configurations.commonResources)
}

View File

@ -1,34 +1,33 @@
plugins { plugins {
id 'idea' id 'multiloader-common'
id 'java'
id 'maven-publish'
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
} }
base {
archivesName = "${mod_name}-common-${minecraft_version}"
}
minecraft { minecraft {
version(minecraft_version) version(minecraft_version)
if(file("src/main/resources/${mod_id}.accesswidener").exists()){ def aw = file("src/main/resources/${mod_id}.accesswidener")
accessWideners(file("src/main/resources/${mod_id}.accesswidener")) if(aw.exists()){
accessWideners(aw)
} }
} }
dependencies { dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
} }
publishing { configurations {
publications { commonJava {
mavenJava(MavenPublication) { canBeResolved = false
artifactId base.archivesName.get() canBeConsumed = true
from components.java
}
} }
repositories { commonResources {
maven { canBeResolved = false
url "file://" + System.getenv("local_maven") canBeConsumed = true
}
} }
} }
artifacts {
commonJava sourceSets.main.java.sourceDirectories.singleFile
commonResources sourceSets.main.resources.sourceDirectories.singleFile
}

View File

@ -2,7 +2,6 @@ package com.example.examplemod.mixin;
import com.example.examplemod.Constants; import com.example.examplemod.Constants;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;

View File

@ -1,18 +1,16 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "com.example.examplemod.mixin", "package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json", "refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [],
], "client": [
"client": [ "MixinMinecraft"
"MixinMinecraft" ],
], "server": [],
"server": [ "injectors": {
], "defaultRequire": 1
"injectors": { }
"defaultRequire": 1
}
} }

View File

@ -1,24 +1,18 @@
plugins { plugins {
id 'java' id 'multiloader-loader'
id 'idea' id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'fabric-loom' version '1.4-SNAPSHOT'
}
base {
archivesName = "${mod_name}-fabric-${minecraft_version}"
} }
dependencies { dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}" minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings() mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
compileOnly project(":common")
} }
loom { loom {
if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) { def aw = project(":common").file("src/main/resources/${mod_id}.accesswidener")
accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener")) if (aw.exists()) {
accessWidenerPath.set(aw)
} }
mixin { mixin {
defaultRefmapName.set("${mod_id}.refmap.json") defaultRefmapName.set("${mod_id}.refmap.json")
@ -28,41 +22,13 @@ loom {
client() client()
setConfigName("Fabric Client") setConfigName("Fabric Client")
ideConfigGenerated(true) ideConfigGenerated(true)
runDir("run") runDir("runs/client")
} }
server { server {
server() server()
setConfigName("Fabric Server") setConfigName("Fabric Server")
ideConfigGenerated(true) ideConfigGenerated(true)
runDir("run") runDir("runs/server")
}
}
}
tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}
processResources {
from project(":common").sourceSets.main.resources
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
} }
} }
} }

View File

@ -1,18 +1,16 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "com.example.examplemod.mixin", "package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json", "refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [],
], "client": [
"client": [ "MixinTitleScreen"
"MixinTitleScreen" ],
], "server": [],
"server": [ "injectors": {
], "defaultRequire": 1
"injectors": {
"defaultRequire": 1
}
} }
}

View File

@ -27,7 +27,7 @@
"fabricloader": ">=${fabric_loader_version}", "fabricloader": ">=${fabric_loader_version}",
"fabric-api": "*", "fabric-api": "*",
"minecraft": "${minecraft_version}", "minecraft": "${minecraft_version}",
"java": ">=17" "java": ">=${java_version}"
}, },
"suggests": { "suggests": {
"another-mod": "*" "another-mod": "*"

View File

@ -1,6 +1,5 @@
plugins { plugins {
id 'idea' id 'multiloader-loader'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
} }
@ -22,50 +21,42 @@ minecraft {
// Automatically enable forge AccessTransformers if the file exists // Automatically enable forge AccessTransformers if the file exists
// This location is hardcoded in Forge and can not be changed. // This location is hardcoded in Forge and can not be changed.
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 // https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { def at = file('src/main/resources/META-INF/accesstransformer.cfg')
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') if (at.exists()) {
accessTransformer = at
} }
runs { runs {
client { client {
workingDirectory project.file('run') workingDirectory file('runs/client')
ideaModule "${rootProject.name}.${project.name}.main" ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client' taskName 'Client'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods { mods {
modClientRun { modClientRun {
source sourceSets.main source sourceSets.main
source project(":common").sourceSets.main
} }
} }
} }
server { server {
workingDirectory project.file('run') workingDirectory file('runs/server')
ideaModule "${rootProject.name}.${project.name}.main" ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server' taskName 'Server'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods { mods {
modServerRun { modServerRun {
source sourceSets.main source sourceSets.main
source project(":common").sourceSets.main
} }
} }
} }
data { data {
workingDirectory project.file('run') workingDirectory file('runs/data')
ideaModule "${rootProject.name}.${project.name}.main" ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data' taskName 'Data'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods { mods {
modDataRun { modDataRun {
source sourceSets.main source sourceSets.main
source project(":common").sourceSets.main
} }
} }
} }
@ -76,39 +67,17 @@ sourceSets.main.resources.srcDir 'src/generated/resources'
dependencies { dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly project(":common")
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor") annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor")
} }
tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}
processResources {
from project(":common").sourceSets.main.resources
}
jar.finalizedBy('reobfJar') jar.finalizedBy('reobfJar')
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
fg.component(it) fg.component(it)
} }
} }
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
} }
sourceSets.each { sourceSets.each {

View File

@ -1,17 +1,15 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "com.example.examplemod.mixin", "package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json", "refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [],
], "client": [
"client": [ "MixinTitleScreen"
"MixinTitleScreen" ],
], "server": [],
"server": [ "injectors": {
], "defaultRequire": 1
"injectors": { }
"defaultRequire": 1
}
} }

View File

@ -4,6 +4,7 @@
# Project # Project
version=1.0.0 version=1.0.0
group=com.example.examplemod group=com.example.examplemod
java_version=17
# Common # Common
minecraft_version=1.20.4 minecraft_version=1.20.4

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

20
gradlew.bat vendored
View File

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail

View File

@ -1,18 +1,14 @@
plugins { plugins {
id 'idea' id 'multiloader-loader'
id 'maven-publish' id 'net.neoforged.gradle.userdev' version '7.0.107'
id 'net.neoforged.gradle.userdev' version '7.0.81'
id 'java-library'
}
base {
archivesName = "${mod_name}-neoforge-${minecraft_version}"
} }
// Automatically enable neoforge AccessTransformers if the file exists // Automatically enable neoforge AccessTransformers if the file exists
// This location is hardcoded in FML and can not be changed. // This location is hardcoded in FML and can not be changed.
// https://github.com/neoforged/FancyModLoader/blob/a952595eaaddd571fbc53f43847680b00894e0c1/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModFile.java#L118 // https://github.com/neoforged/FancyModLoader/blob/a952595eaaddd571fbc53f43847680b00894e0c1/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModFile.java#L118
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { def at = file('src/main/resources/META-INF/accesstransformer.cfg')
minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg') if (at.exists()) {
minecraft.accessTransformers.file at
} }
runs { runs {
configureEach { configureEach {
@ -39,38 +35,4 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies { dependencies {
implementation "net.neoforged:neoforge:${neoforge_version}" implementation "net.neoforged:neoforge:${neoforge_version}"
compileOnly project(":common")
}
// NeoGradle compiles the game, but we don't want to add our common code to the game's code
Spec<Task> notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec<Task>
tasks.withType(JavaCompile).matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}
tasks.withType(ProcessResources).matching(notNeoTask).configureEach {
from project(":common").sourceSets.main.resources
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
} }

View File

@ -1,16 +1,14 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "com.example.examplemod.mixin", "package": "com.example.examplemod.mixin",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [],
], "client": [
"client": [ "MixinTitleScreen"
"MixinTitleScreen" ],
], "server": [],
"server": [ "injectors": {
], "defaultRequire": 1
"injectors": { }
"defaultRequire": 1
}
} }

View File

@ -1,21 +1,52 @@
pluginManagement { pluginManagement {
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
maven { mavenCentral()
name = 'Fabric' exclusiveContent {
url = 'https://maven.fabricmc.net/' forRepository {
maven {
name = 'Fabric'
url = uri("https://maven.fabricmc.net")
}
}
filter {
includeGroup("net.fabricmc")
includeGroup("fabric-loom")
}
} }
maven { exclusiveContent {
name = 'NeoForge' forRepository {
url = 'https://maven.neoforged.net/releases/' maven {
name = 'NeoForge'
url = uri("https://maven.neoforged.net/releases")
}
}
filter {
includeGroupAndSubgroups("net.neoforged")
includeGroup("codechicken")
}
} }
maven { exclusiveContent {
name = 'Forge' forRepository {
url = 'https://maven.minecraftforge.net/' maven {
name = 'Forge'
url = uri("https://maven.minecraftforge.net")
}
}
filter {
includeGroupAndSubgroups("net.minecraftforge")
}
} }
maven { exclusiveContent {
name = 'Sponge Snapshots' forRepository {
url = 'https://repo.spongepowered.org/repository/maven-public/' maven {
name = 'Sponge Snapshots'
url = uri("https://repo.spongepowered.org/repository/maven-public")
}
}
filter {
includeGroupAndSubgroups("org.spongepowered")
}
} }
} }
} }