Begin 1.20 port (god this is horrible)

This commit is contained in:
Andrew-71 2023-07-29 21:07:20 +03:00
parent 8730ae91a0
commit 987a18c360
105 changed files with 757 additions and 2300 deletions

View file

@ -1,29 +1,27 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.spongepowered:mixingradle:0.7.+'
}
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle'
id 'org.spongepowered.mixin'
}
apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
base {
archivesName = "${mod_name}-forge-${minecraft_version}"
}
mixin {
add(sourceSets.main, "${mod_id}.refmap.json")
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
config("${mod_id}.mixins.json")
config("${mod_id}.forge.mixins.json")
}
minecraft {
mappings channel: 'official', version: minecraft_version
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
// 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
// Automatically enable forge AccessTransformers if the file exists
// 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
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
project.logger.debug('Forge Access Transformers are enabled for this project.')
}
runs {
@ -36,7 +34,7 @@ minecraft {
mods {
modClientRun {
source sourceSets.main
source project(":Common").sourceSets.main
source project(":common").sourceSets.main
}
}
}
@ -50,7 +48,7 @@ minecraft {
mods {
modServerRun {
source sourceSets.main
source project(":Common").sourceSets.main
source project(":common").sourceSets.main
}
}
}
@ -65,48 +63,43 @@ minecraft {
mods {
modDataRun {
source sourceSets.main
source project(":Common").sourceSets.main
source project(":common").sourceSets.main
}
}
}
}
}
mixin {
add sourceSets.main, 'refmap.tardim_ic.json'
config 'mixins.tardim_ic.json'
}
sourceSets.main.resources.srcDir 'src/generated/resources'
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly project(":Common")
implementation fg.deobf("curse.maven:tardim-531315:4453925")
implementation fg.deobf("org.squiddev:cc-tweaked-1.19.1:${cc_version}")
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
compileOnly project(":common")
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor")
}
tasks.withType(JavaCompile) {
source(project(":Common").sourceSets.main.allSource)
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
from project(":common").sourceSets.main.resources
}
jar.finalizedBy('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact jar
artifactId base.archivesName.get()
from components.java
fg.component(it)
}
}
repositories {