Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MegumiKasuga committed Apr 15, 2024
1 parent cb55df7 commit 40487d0
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 59 deletions.
141 changes: 86 additions & 55 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ buildscript {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net'}
maven { url = 'https://maven.parchmentmc.org' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/'}
mavenCentral()
jcenter()
}
Expand All @@ -13,47 +12,31 @@ buildscript {
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
}
}
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'

version = "${mod_version}"
group = 'willow.train.kuayue' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'kuayue'

println(project.name)

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"

minecraft {

mappings channel: 'parchment', version: '2022.09.18-1.19.2'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.2'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

runs {
client {
workingDirectory project.file('run')
Expand All @@ -69,13 +52,11 @@ minecraft {
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespace', 'kuayue'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'kuayue'

property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
mods {
kuayue {
source sourceSets.main
Expand All @@ -85,16 +66,16 @@ minecraft {

server {
workingDirectory project.file('run')
arg '-torg.spongepowered.asm.launch.MixinTweaker'
arg '-mixin.config=kuayue.mixins.json'

property 'forge.logging.markers', 'REGISTRIES'

property 'forge.logging.console.level', 'debug'

arg '-torg.spongepowered.asm.launch.MixinTweaker'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'kuayue'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

mods {
kuayue {
source sourceSets.main
Expand All @@ -107,15 +88,24 @@ minecraft {
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
workingDirectory project.file('run')

arg '-mixin.config=kuayue.mixins.json'
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'kuayue'

property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

mods {
kuayue {
source sourceSets.main
Expand All @@ -124,6 +114,7 @@ minecraft {
}

data {
arg '-mixin.config=kuayue.mixins.json'
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'
Expand All @@ -143,7 +134,9 @@ minecraft {
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
sourceSets.main.resources {
srcDir 'src/generated/resources'
}

repositories {
// Put repositories for dependencies here
Expand All @@ -153,47 +146,66 @@ repositories {
// flatDir {
// dir 'libs'
// }
mavenCentral()
maven {
name = 'ModMaven'
url = 'https://modmaven.dev'
name = 'tterrag maven'
url = 'https://maven.tterrag.com/'
}
// maven {
// // location of the maven that hosts JEI files
// name = "Progwml6 maven"
// url = "https://dvs1.progwml6.com/files/maven/"
// }
maven {
url = 'https://maven.theillusivec4.top/'
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
name = 'tterrag maven'
url = 'https://maven.tterrag.com/'
url = "https://maven.theillusivec4.top/"
}
maven {
url "https://cursemaven.com"
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
flatDir {
dirs 'libs'
}

mavenLocal()
flatDir {dir 'libs'}
}

dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.19.2-43.3.0'
minecraft 'net.minecraftforge:forge:1.19.2-43.3.2'
implementation fg.deobf("com.simibubi.create:create-${create_minecraft_version}:${create_version}:slim") { transitive = false }
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")
// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") // Adds registrate as a dependency
// implementation fg.deobf("com.simibubi.create:create-${create_minecraft_version}:${create_version}:slim") { transitive = false }
// implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
//implementation fg.deobf("curse.maven:create-steam-n-rails-688231:4726383")

compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge:${jei_version}")

implementation fg.deobf("curse.maven:worldedit-225608:3922622")

implementation 'org.spongepowered:mixin:0.8.5'
implementation "org.spongepowered:mixin:${mixin_version}"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
testAnnotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"

implementation fg.deobf("blank:kasuga_lib-0.13:0.13")
// implementation files('libs/Mixed-Arithmetic-Logic-Interpreter-1.0.0.jar')
implementation fg.deobf(files("libs/kasuga_lib-0.13.jar"))
// testImplementation "edu.carole:Mixed-Arithmetic-Logic-Interpreter:1.0.0"
// clientAnnotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
// apiAnnotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency

// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")

Expand All @@ -207,11 +219,11 @@ jar {
manifest {
attributes([
"Specification-Title" : "kuayue",
"Specification-Vendor" : "FairingStudio",
"Specification-Vendor" : "NeoKuayueTeam",
"Specification-Version" : "20", // We are version 18 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "FairingStudio",
"Implementation-Vendor" : "NeoKuayueTeam",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConfigs': 'kuayue.mixins.json'
])
Expand All @@ -220,14 +232,33 @@ jar {

// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
// 当需要发布正式版本的时候用下面这个,给开发用的版本则不要用这个,task 跑 jarJar
jar.finalizedBy('reobfJar')

// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
tasks.named("jar").configure {
archiveClassifier = ''

// finalizedBy 'reobfJar'
}

java {
// withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
register('mavenJava', MavenPublication) {
artifact jar
artifact sourcesJar
// artifact javadocJar
groupId = "willow.train.kuayue"
artifactId = "kuayue"
version = "0.4.0"

fg.component(it)
}
}
repositories {
Expand All @@ -242,6 +273,6 @@ tasks.withType(JavaCompile).configureEach {
}

mixin {
//add sourceSets.main, 'mixins.example.refmap.json'
add sourceSets.main, 'mixins.kuayue.refmap.json'
config 'kuayue.mixins.json'
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
org.gradle.jvmargs=-Xmx7G
org.gradle.daemon=false

jarVersion = 0.3.8n-izayoi_sakuya-rc5

curios_version =1.19.2-5.1.1.0
jei_minecraft_version=1.19.2
mixin_version=0.8.5
mixingradle_version = 0.7.+
jei_version=11.2.0.246
mc_version=1.19.2
mod_version = 0.3.8n-izayoi_sakuya-rc5
mod_version = 0.4.0

jarVersion = 0.4.0

registrate_version = MC1.19-1.1.5
create_minecraft_version = 1.19.2
flywheel_minecraft_version = 1.19.2
create_version = 0.5.1.e-44
flywheel_version = 0.6.10-20
registrate_version = MC1.19-1.1.5
Binary file modified libs/kasuga_lib-0.13.jar
Binary file not shown.

0 comments on commit 40487d0

Please sign in to comment.