From 80931f0eb737568abf3c0893c1b01b43ba5b5293 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Wed, 3 Dec 2025 01:09:53 +0100 Subject: [PATCH] setup mixins --- gradle.properties | 6 +++--- .../common/transform/EnderCorePlugin.java | 21 +++++++++++++++---- .../resources/mixins.endercore.early.json | 8 +++++++ src/main/resources/mixins.endercore.json | 7 +++++++ 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/mixins.endercore.early.json create mode 100644 src/main/resources/mixins.endercore.json diff --git a/gradle.properties b/gradle.properties index 03b81dc..3520ac1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -74,7 +74,7 @@ apiPackage = api accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! -usesMixins = false +usesMixins = true # Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. # This can speed up compile times thanks to not running the mixin annotation processor on all input sources. @@ -82,7 +82,7 @@ usesMixins = false separateMixinSourceSet = # Adds some debug arguments like verbose output and class export. -usesMixinDebug = false +usesMixinDebug = true # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = @@ -90,7 +90,7 @@ mixinPlugin = # Specify the package that contains all of your Mixins. The package must exist or # the build will fail. If you have a package property defined in your mixins..json, # it must match with this or the build will fail. -mixinsPackage = +mixinsPackage = common.mixins # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # This parameter is for legacy compatibility only diff --git a/src/main/java/com/enderio/core/common/transform/EnderCorePlugin.java b/src/main/java/com/enderio/core/common/transform/EnderCorePlugin.java index c85c530..315f5db 100644 --- a/src/main/java/com/enderio/core/common/transform/EnderCorePlugin.java +++ b/src/main/java/com/enderio/core/common/transform/EnderCorePlugin.java @@ -1,18 +1,20 @@ package com.enderio.core.common.transform; +import java.util.ArrayList; +import java.util.List; import java.util.Map; +import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader; + import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; -@SuppressWarnings("unused") @MCVersion("1.7.10") -@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) -// we want deobf no matter what -public class EnderCorePlugin implements IFMLLoadingPlugin { +public class EnderCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader { public static boolean runtimeDeobfEnabled = false; public static final Logger logger = LogManager.getLogger("EnderCore"); @@ -41,4 +43,15 @@ public class EnderCorePlugin implements IFMLLoadingPlugin { public String getAccessTransformerClass() { return null; } + + @Override + public String getMixinConfig() { + return "mixins.endercore.early.json"; + } + + @Override + public List getMixins(Set loadedCoreMods) { + final List mixins = new ArrayList<>(); + return mixins; + } } diff --git a/src/main/resources/mixins.endercore.early.json b/src/main/resources/mixins.endercore.early.json new file mode 100644 index 0000000..6f2bbd0 --- /dev/null +++ b/src/main/resources/mixins.endercore.early.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "com.enderio.core.common.mixins.early", + "refmap": "mixins.endercore.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +} diff --git a/src/main/resources/mixins.endercore.json b/src/main/resources/mixins.endercore.json new file mode 100644 index 0000000..f7fab62 --- /dev/null +++ b/src/main/resources/mixins.endercore.json @@ -0,0 +1,7 @@ +{ + "required": true, + "minVersion": "0.8.5-GTNH", + "refmap": "mixins.endercore.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +}