Add mixin support and example mixin

This commit is contained in:
BipolarExpedition committed 2026-11-01 20:49:26 -05:00
1 parent c69b3653f8
commit f75568214a
4 files changed
+68 -1

No files matched your search

+21 -1
View File
@@ -1,8 +1,15 @@
buildscript {
repositories {
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}
}
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
}
version = mod_version
@@ -15,6 +22,9 @@ base {
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
// The mappings can be changed at any time and must be in the following format.
@@ -76,6 +86,7 @@ minecraft {
property("mixin.env.remapRefMap", "true")
property("mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")
args '-mixin.config=contraptionsaresafe.mixins.json'
mods {
"${mod_id}" {
@@ -148,6 +159,8 @@ dependencies {
// The group id is ignored when searching -- in this case, it is "blank"
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation(fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:slim") { transitive = false })
implementation(fg.deobf("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}"))
compileOnly(fg.deobf("dev.engine-room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}"))
@@ -190,7 +203,9 @@ tasks.named('jar', Jar).configure {
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"TSRGFx" : "true",
"MixinConfigs" : "contraptionsaresafe.mixins.json"
])
}
@@ -203,6 +218,11 @@ tasks.named('jar', Jar).configure {
// dependsOn 'reobfJar'
// }
mixin {
add sourceSets.main, "contraptionsaresafe.refmap.json"
config "contraptionsaresafe.mixins.json"
}
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {