Skip to content

Commit

Permalink
Shadow Mixin and MixinExtras
Browse files Browse the repository at this point in the history
  • Loading branch information
fonnymunkey committed May 15, 2024
1 parent 06197cf commit 4e7b7a2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
35 changes: 27 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ buildscript {
maven {
url = 'https://repo.spongepowered.org/maven'
}
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7.+'
classpath("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0")
}
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'

Expand All @@ -30,17 +35,13 @@ minecraft {

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven {
url = 'https://repo.spongepowered.org/maven'
}
}

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

implementation "org.spongepowered:mixin:0.8.5"
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
shadow 'io.github.llamalad7:mixinextras-common:0.3.5'

shadow 'org.spongepowered:mixin:0.8.5'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

mixin {
Expand All @@ -58,6 +59,21 @@ processResources {
}
}

shadowJar {
configurations = [project.configurations.shadow]
mergeServiceFiles()

exclude 'org/spongepowered/asm/launch/MixinLaunchPlugin*'
exclude 'org/spongepowered/asm/launch/MixinTransformationService*'
exclude 'org/spongepowered/asm/launch/platform/container/ContainerHandleModLauncherEx*'

archiveClassifier.set('')
}

reobf {
shadowJar {}
}

jar {
manifest {
attributes([
Expand All @@ -72,6 +88,9 @@ jar {
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker"
])
}

archiveClassifier.set('THIN')
}

build.dependsOn(shadowJar)
jar.finalizedBy('reobfJar')
3 changes: 3 additions & 0 deletions src/main/java/fermiumbooter/FermiumPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import com.llamalad7.mixinextras.MixinExtrasBootstrap;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -18,6 +20,7 @@ public class FermiumPlugin implements IFMLLoadingPlugin {

public FermiumPlugin() {
MixinBootstrap.init();
MixinExtrasBootstrap.init();
Mixins.addConfiguration("mixins.fermiumbooter.init.json");
}

Expand Down

0 comments on commit 4e7b7a2

Please sign in to comment.