Introduce MixinExtras

This commit is contained in:
embeddedt 2023-08-13 15:53:20 -04:00
parent d7b2f5b75b
commit d9184833ec
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
6 changed files with 11 additions and 1 deletions

View File

@ -94,6 +94,7 @@ allprojects {
maven { maven {
url 'https://maven.terraformersmc.com/releases' url 'https://maven.terraformersmc.com/releases'
} }
maven { url = "https://jitpack.io" }
} }
} }

View File

@ -10,6 +10,7 @@ dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader // Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:${rootProject.mixinextras_version}"))
modCompileOnly("dev.latvian.mods:kubejs:${kubejs_version}") { modCompileOnly("dev.latvian.mods:kubejs:${kubejs_version}") {
transitive = false transitive = false

View File

@ -31,6 +31,7 @@ configurations {
dependencies { dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
testImplementation "net.fabricmc:fabric-loader-junit:${rootProject.fabric_loader_version}" testImplementation "net.fabricmc:fabric-loader-junit:${rootProject.fabric_loader_version}"
include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${rootProject.mixinextras_version}")))
modCompileOnly(fabricApi.module("fabric-api-base", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' } modCompileOnly(fabricApi.module("fabric-api-base", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modCompileOnly(fabricApi.module("fabric-screen-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' } modCompileOnly(fabricApi.module("fabric-screen-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }

View File

@ -45,6 +45,8 @@ repositories {
dependencies { dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}" forge "net.minecraftforge:forge:${rootProject.forge_version}"
shadow(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:${rootProject.mixinextras_version}"))
runtimeOnly("com.github.llamalad7.mixinextras:mixinextras-common:${rootProject.mixinextras_version}")
// Remove the next line if you don't want to depend on the API // Remove the next line if you don't want to depend on the API
// modApi "me.shedaniel:architectury-forge:${rootProject.architectury_version}" // modApi "me.shedaniel:architectury-forge:${rootProject.architectury_version}"
@ -93,8 +95,10 @@ shadowJar {
exclude "fabric.mod.json" exclude "fabric.mod.json"
exclude "architectury.common.json" exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon] configurations = [project.configurations.shadowCommon, project.configurations.shadow]
relocate("com.llamalad7.mixinextras", "org.embeddedt.modernfix.forge.shadow.mixinextras")
archiveClassifier.set("dev-shadow") archiveClassifier.set("dev-shadow")
mergeServiceFiles()
} }
remapJar { remapJar {

View File

@ -3,6 +3,7 @@ package org.embeddedt.modernfix.platform.forge;
import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import com.google.common.io.Resources; import com.google.common.io.Resources;
import com.llamalad7.mixinextras.MixinExtrasBootstrap;
import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.CommandDispatcher;
import cpw.mods.modlauncher.*; import cpw.mods.modlauncher.*;
@ -195,6 +196,7 @@ public class ModernFixPlatformHooksImpl implements ModernFixPlatformHooks {
} }
NightConfigFixer.monitorFileWatcher(); NightConfigFixer.monitorFileWatcher();
MixinExtrasBootstrap.init();
} }
private Method defineClassMethod = null; private Method defineClassMethod = null;

View File

@ -2,6 +2,7 @@
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx2G
junit_version=5.10.0-M1 junit_version=5.10.0-M1
mixinextras_version=0.2.0-beta.9
mod_id=modernfix mod_id=modernfix
minecraft_version=1.16.5 minecraft_version=1.16.5