From acb20295a0a933a295550886fc3236abef0fdfbd Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Thu, 26 Sep 2024 03:01:01 +0200 Subject: [PATCH] transfer to early/late mixin stuff --- gradle.properties | 4 +- .../com/kuba6000/mobsinfo/api/MobRecipe.java | 2 +- .../mobsinfo/api/helper/EnderIOHelper.java | 2 +- .../api/helper/InfernalMobsCoreHelper.java | 2 +- .../kuba6000/mobsinfo/api/utils/MobUtils.java | 2 +- .../kuba6000/mobsinfo/api/utils/ModUtils.java | 6 +- .../mobsinfo/loader/EventDiscovery.java | 2 +- .../mobsinfo/loader/MobRecipeLoader.java | 10 +- .../loader/VanillaMobRecipeLoader.java | 2 +- .../mobsinfo/loader/VillagerTradesLoader.java | 2 +- .../loader/extras/DraconicEvolution.java | 2 +- .../mobsinfo/loader/extras/ExtraLoader.java | 4 +- .../mobsinfo/mixin/EarlyMixinLoader.java | 46 +++++++ .../mobsinfo/mixin/LateMixinLoader.java | 22 ++++ .../com/kuba6000/mobsinfo/mixin/Mixin.java | 67 ++++++++--- .../kuba6000/mobsinfo/mixin/MixinPlugin.java | 113 ------------------ .../kuba6000/mobsinfo/mixin/TargetedMod.java | 59 ++++----- .../minecraft/ASMEventHandlerAccessor.java | 2 +- .../minecraft/EnchantmentHelperMixin.java | 2 +- .../{ => early}/minecraft/EntityAccessor.java | 2 +- .../minecraft/EntityLivingAccessor.java | 2 +- .../minecraft/EntityLivingBaseAccessor.java | 2 +- .../minecraft/EntitySlimeAccessor.java | 2 +- .../minecraft/EntityVillagerAccessor.java | 2 +- .../minecraft/EventBusAccessor.java | 2 +- .../{ => early}/minecraft/GuiAccessor.java | 2 +- .../minecraft/GuiContainerAccessor.java | 2 +- .../RendererLivingEntityAccessor.java | 2 +- .../minecraft/VillagerRegistryAccessor.java | 2 +- .../ChocoCraft/EntityAnimalChocoboMixin.java | 2 +- .../DQRespect/DqmEntitySweetbagMixin.java | 4 +- .../DQRespect/FuncCalcMobParamMixin.java | 2 +- .../MinecraftForgeEventHandlerAccessor.java | 2 +- .../DraconicEvolution/RenderMobSoulMixin.java | 2 +- .../EnderIO/BlockPoweredSpawnerAccessor.java | 2 +- .../EnderIO/ItemSoulVesselAccessor.java | 2 +- .../Forestry/EntityButterflyMixin.java | 2 +- .../EntityMobHomelandEndermanMixin.java | 2 +- .../EntityMobLouseMixin.java | 4 +- .../InfernalMobsCoreAccessor.java | 2 +- .../kuba6000/mobsinfo/nei/EnderIOGetter.java | 2 +- .../com/kuba6000/mobsinfo/nei/MobHandler.java | 4 +- .../mobsinfo/nei/MobHandlerInfernal.java | 2 +- .../ScrollableContainerHandler.java | 2 +- .../mobsinfo/nei/scrollable/Scrollbar.java | 4 +- src/main/resources/mixins.mobsinfo.early.json | 8 ++ src/main/resources/mixins.mobsinfo.json | 7 +- src/main/resources/mixins.mobsinfo.late.json | 8 ++ 48 files changed, 213 insertions(+), 221 deletions(-) create mode 100644 src/main/java/com/kuba6000/mobsinfo/mixin/EarlyMixinLoader.java create mode 100644 src/main/java/com/kuba6000/mobsinfo/mixin/LateMixinLoader.java delete mode 100644 src/main/java/com/kuba6000/mobsinfo/mixin/MixinPlugin.java rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/ASMEventHandlerAccessor.java (89%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EnchantmentHelperMixin.java (96%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EntityAccessor.java (85%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EntityLivingAccessor.java (85%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EntityLivingBaseAccessor.java (87%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EntitySlimeAccessor.java (83%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EntityVillagerAccessor.java (84%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/EventBusAccessor.java (83%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/GuiAccessor.java (84%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/GuiContainerAccessor.java (86%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/RendererLivingEntityAccessor.java (86%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => early}/minecraft/VillagerRegistryAccessor.java (88%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/ChocoCraft/EntityAnimalChocoboMixin.java (91%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/DQRespect/DqmEntitySweetbagMixin.java (81%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/DQRespect/FuncCalcMobParamMixin.java (93%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java (87%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/DraconicEvolution/RenderMobSoulMixin.java (95%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/EnderIO/BlockPoweredSpawnerAccessor.java (88%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/EnderIO/ItemSoulVesselAccessor.java (85%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/Forestry/EntityButterflyMixin.java (95%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java (92%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/HardcoreEnderExpansion/EntityMobLouseMixin.java (89%) rename src/main/java/com/kuba6000/mobsinfo/mixin/{ => late}/InfernalMobs/InfernalMobsCoreAccessor.java (94%) create mode 100644 src/main/resources/mixins.mobsinfo.early.json create mode 100644 src/main/resources/mixins.mobsinfo.late.json diff --git a/gradle.properties b/gradle.properties index 95c093c..7439bd4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -94,7 +94,7 @@ separateMixinSourceSet = usesMixinDebug = false # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. -mixinPlugin = mixin.MixinPlugin +mixinPlugin = # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! mixinsPackage = mixin @@ -102,7 +102,7 @@ mixinsPackage = mixin # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # This parameter is for legacy compatibility only # Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin -coreModClass = +coreModClass = mixin.EarlyMixinLoader # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! diff --git a/src/main/java/com/kuba6000/mobsinfo/api/MobRecipe.java b/src/main/java/com/kuba6000/mobsinfo/api/MobRecipe.java index 74d1183..138cfd0 100644 --- a/src/main/java/com/kuba6000/mobsinfo/api/MobRecipe.java +++ b/src/main/java/com/kuba6000/mobsinfo/api/MobRecipe.java @@ -25,7 +25,7 @@ import com.kuba6000.mobsinfo.api.helper.EnderIOHelper; import com.kuba6000.mobsinfo.api.helper.InfernalMobsCoreHelper; import com.kuba6000.mobsinfo.loader.MobRecipeLoader; -import com.kuba6000.mobsinfo.mixin.InfernalMobs.InfernalMobsCoreAccessor; +import com.kuba6000.mobsinfo.mixin.late.InfernalMobs.InfernalMobsCoreAccessor; import atomicstryker.infernalmobs.common.InfernalMobsCore; import jas.spawner.modern.MVELProfile; diff --git a/src/main/java/com/kuba6000/mobsinfo/api/helper/EnderIOHelper.java b/src/main/java/com/kuba6000/mobsinfo/api/helper/EnderIOHelper.java index fab9a2e..895e9d3 100644 --- a/src/main/java/com/kuba6000/mobsinfo/api/helper/EnderIOHelper.java +++ b/src/main/java/com/kuba6000/mobsinfo/api/helper/EnderIOHelper.java @@ -25,7 +25,7 @@ import net.minecraft.entity.boss.IBossDisplayData; import com.kuba6000.mobsinfo.api.LoaderReference; -import com.kuba6000.mobsinfo.mixin.EnderIO.ItemSoulVesselAccessor; +import com.kuba6000.mobsinfo.mixin.late.EnderIO.ItemSoulVesselAccessor; import crazypants.enderio.EnderIO; diff --git a/src/main/java/com/kuba6000/mobsinfo/api/helper/InfernalMobsCoreHelper.java b/src/main/java/com/kuba6000/mobsinfo/api/helper/InfernalMobsCoreHelper.java index a2721ad..09d9a1e 100644 --- a/src/main/java/com/kuba6000/mobsinfo/api/helper/InfernalMobsCoreHelper.java +++ b/src/main/java/com/kuba6000/mobsinfo/api/helper/InfernalMobsCoreHelper.java @@ -10,7 +10,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.IMob; -import com.kuba6000.mobsinfo.mixin.InfernalMobs.InfernalMobsCoreAccessor; +import com.kuba6000.mobsinfo.mixin.late.InfernalMobs.InfernalMobsCoreAccessor; import atomicstryker.infernalmobs.common.InfernalMobsCore; diff --git a/src/main/java/com/kuba6000/mobsinfo/api/utils/MobUtils.java b/src/main/java/com/kuba6000/mobsinfo/api/utils/MobUtils.java index ce39c2a..85b4f26 100644 --- a/src/main/java/com/kuba6000/mobsinfo/api/utils/MobUtils.java +++ b/src/main/java/com/kuba6000/mobsinfo/api/utils/MobUtils.java @@ -39,7 +39,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.util.Rectangle; -import com.kuba6000.mobsinfo.mixin.minecraft.RendererLivingEntityAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.RendererLivingEntityAccessor; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/kuba6000/mobsinfo/api/utils/ModUtils.java b/src/main/java/com/kuba6000/mobsinfo/api/utils/ModUtils.java index 796390d..0f437c0 100644 --- a/src/main/java/com/kuba6000/mobsinfo/api/utils/ModUtils.java +++ b/src/main/java/com/kuba6000/mobsinfo/api/utils/ModUtils.java @@ -40,9 +40,9 @@ import com.google.common.collect.Multimap; import com.kuba6000.mobsinfo.MobsInfo; -import com.kuba6000.mobsinfo.mixin.minecraft.ASMEventHandlerAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EventBusAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.VillagerRegistryAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.ASMEventHandlerAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EventBusAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.VillagerRegistryAccessor; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/EventDiscovery.java b/src/main/java/com/kuba6000/mobsinfo/loader/EventDiscovery.java index 17cef26..a60eba5 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/EventDiscovery.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/EventDiscovery.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.kuba6000.mobsinfo.mixin.minecraft.EventBusAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EventBusAccessor; import cpw.mods.fml.common.eventhandler.IEventListener; diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java b/src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java index de39b21..50af37c 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java @@ -84,11 +84,11 @@ import com.kuba6000.mobsinfo.config.Config; import com.kuba6000.mobsinfo.config.OverridesConfig; import com.kuba6000.mobsinfo.loader.extras.ExtraLoader; -import com.kuba6000.mobsinfo.mixin.InfernalMobs.InfernalMobsCoreAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EntityAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EntityLivingAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EntityLivingBaseAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EntitySlimeAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntityAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntityLivingAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntityLivingBaseAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntitySlimeAccessor; +import com.kuba6000.mobsinfo.mixin.late.InfernalMobs.InfernalMobsCoreAccessor; import com.kuba6000.mobsinfo.nei.MobHandler; import com.kuba6000.mobsinfo.network.LoadConfigPacket; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/VanillaMobRecipeLoader.java b/src/main/java/com/kuba6000/mobsinfo/loader/VanillaMobRecipeLoader.java index 344d2db..ad9cd4e 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/VanillaMobRecipeLoader.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/VanillaMobRecipeLoader.java @@ -42,7 +42,7 @@ import com.kuba6000.mobsinfo.api.DummyWorld; import com.kuba6000.mobsinfo.api.MobDrop; import com.kuba6000.mobsinfo.api.MobRecipe; -import com.kuba6000.mobsinfo.mixin.minecraft.EntitySlimeAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntitySlimeAccessor; public class VanillaMobRecipeLoader { diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/VillagerTradesLoader.java b/src/main/java/com/kuba6000/mobsinfo/loader/VillagerTradesLoader.java index 5a6ff1d..4dc1f46 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/VillagerTradesLoader.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/VillagerTradesLoader.java @@ -37,7 +37,7 @@ import com.kuba6000.mobsinfo.api.utils.ItemID; import com.kuba6000.mobsinfo.api.utils.ModUtils; import com.kuba6000.mobsinfo.config.Config; -import com.kuba6000.mobsinfo.mixin.minecraft.VillagerRegistryAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.VillagerRegistryAccessor; import com.kuba6000.mobsinfo.nei.VillagerTradesHandler; import com.kuba6000.mobsinfo.network.LoadConfigPacket; diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/extras/DraconicEvolution.java b/src/main/java/com/kuba6000/mobsinfo/loader/extras/DraconicEvolution.java index cf29c6a..65e10f3 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/extras/DraconicEvolution.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/extras/DraconicEvolution.java @@ -22,7 +22,7 @@ import com.kuba6000.mobsinfo.api.IChanceModifier; import com.kuba6000.mobsinfo.api.MobDrop; import com.kuba6000.mobsinfo.api.MobRecipe; -import com.kuba6000.mobsinfo.mixin.DraconicEvolution.MinecraftForgeEventHandlerAccessor; +import com.kuba6000.mobsinfo.mixin.late.DraconicEvolution.MinecraftForgeEventHandlerAccessor; import io.netty.buffer.ByteBuf; diff --git a/src/main/java/com/kuba6000/mobsinfo/loader/extras/ExtraLoader.java b/src/main/java/com/kuba6000/mobsinfo/loader/extras/ExtraLoader.java index 880145c..adbc7b1 100644 --- a/src/main/java/com/kuba6000/mobsinfo/loader/extras/ExtraLoader.java +++ b/src/main/java/com/kuba6000/mobsinfo/loader/extras/ExtraLoader.java @@ -19,8 +19,8 @@ import com.kuba6000.mobsinfo.api.LoaderReference; import com.kuba6000.mobsinfo.api.MobDrop; import com.kuba6000.mobsinfo.api.MobRecipe; -import com.kuba6000.mobsinfo.mixin.minecraft.ASMEventHandlerAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.EventBusAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.ASMEventHandlerAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EventBusAccessor; import cpw.mods.fml.common.eventhandler.ASMEventHandler; import cpw.mods.fml.common.eventhandler.IEventListener; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/EarlyMixinLoader.java b/src/main/java/com/kuba6000/mobsinfo/mixin/EarlyMixinLoader.java new file mode 100644 index 0000000..f024ff6 --- /dev/null +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/EarlyMixinLoader.java @@ -0,0 +1,46 @@ +package com.kuba6000.mobsinfo.mixin; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader; + +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; + +@IFMLLoadingPlugin.MCVersion("1.7.10") +public class EarlyMixinLoader implements IFMLLoadingPlugin, IEarlyMixinLoader { + + @Override + public String[] getASMTransformerClass() { + return null; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) {} + + @Override + public String getAccessTransformerClass() { + return null; + } + + @Override + public String getMixinConfig() { + return "mixins.mobsinfo.early.json"; + } + + @Override + public List getMixins(Set loadedCoreMods) { + return Mixin.getEarlyMixins(loadedCoreMods); + } +} diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/LateMixinLoader.java b/src/main/java/com/kuba6000/mobsinfo/mixin/LateMixinLoader.java new file mode 100644 index 0000000..04055cc --- /dev/null +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/LateMixinLoader.java @@ -0,0 +1,22 @@ +package com.kuba6000.mobsinfo.mixin; + +import java.util.List; +import java.util.Set; + +import com.gtnewhorizon.gtnhmixins.ILateMixinLoader; +import com.gtnewhorizon.gtnhmixins.LateMixin; + +@LateMixin +public class LateMixinLoader implements ILateMixinLoader { + + @Override + public String getMixinConfig() { + return "mixins.mobsinfo.late.json"; + } + + @Override + public List getMixins(Set loadedMods) { + return Mixin.getLateMixins(loadedMods); + } + +} diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/Mixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/Mixin.java index 0c34e48..e0e63d3 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/Mixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/Mixin.java @@ -2,9 +2,10 @@ import static com.kuba6000.mobsinfo.mixin.TargetedMod.*; +import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.List; +import java.util.Set; import cpw.mods.fml.relauncher.FMLLaunchHandler; @@ -54,30 +55,68 @@ public enum Mixin { public final String mixinClass; public final List targetedMods; private final Side side; - - Mixin(String mixinClass, Side side, TargetedMod... targetedMods) { - this.mixinClass = mixinClass; - this.targetedMods = Arrays.asList(targetedMods); - this.side = side; - } + private final Phase phase; Mixin(String mixinClass, TargetedMod... targetedMods) { this.mixinClass = mixinClass; this.targetedMods = Arrays.asList(targetedMods); this.side = Side.BOTH; + this.phase = this.targetedMods.size() == 1 && this.targetedMods.contains(VANILLA) ? Phase.EARLY : Phase.LATE; + } + + public static List getEarlyMixins(Set loadedCoreMods) { + final List mixins = new ArrayList<>(); + for (Mixin mixin : Mixin.values()) { + if (mixin.phase == Phase.EARLY) { + mixins.add(mixin.mixinClass); + } + } + return mixins; + } + + public static List getLateMixins(Set loadedMods) { + // NOTE: Any targetmod here needs a modid, not a coremod id + final List mixins = new ArrayList<>(); + for (Mixin mixin : Mixin.values()) { + if (mixin.phase == Phase.LATE) { + if (mixin.shouldLoad(loadedMods)) { + mixins.add(mixin.mixinClass); + } + } + } + return mixins; + } + + private boolean shouldLoad(Set loadedMods) { + return shouldLoadSide() && allModsLoaded(loadedMods); } - public boolean shouldLoad(List loadedMods) { - return (side == Side.BOTH || side == Side.SERVER && FMLLaunchHandler.side() - .isServer() - || side == Side.CLIENT && FMLLaunchHandler.side() - .isClient()) - && new HashSet<>(loadedMods).containsAll(targetedMods); + private boolean shouldLoadSide() { + return side == Side.BOTH || (side == Side.SERVER && FMLLaunchHandler.side() + .isServer()) + || (side == Side.CLIENT && FMLLaunchHandler.side() + .isClient()); } - enum Side { + private boolean allModsLoaded(Set loadedMods) { + if (targetedMods.isEmpty()) return false; + for (TargetedMod target : targetedMods) { + if (target == TargetedMod.VANILLA) continue; + if (target.modId != null && !loadedMods.isEmpty() && !loadedMods.contains(target.modId)) { + return false; + } + } + return true; + } + + private enum Side { BOTH, CLIENT, SERVER } + + private enum Phase { + EARLY, + LATE, + } } diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/MixinPlugin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/MixinPlugin.java deleted file mode 100644 index c6290d4..0000000 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/MixinPlugin.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.kuba6000.mobsinfo.mixin; - -import static com.kuba6000.mobsinfo.MobsInfo.MODID; -import static com.kuba6000.mobsinfo.mixin.TargetedMod.VANILLA; -import static java.nio.file.Files.walk; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import net.minecraft.launchwrapper.Launch; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.lib.tree.ClassNode; -import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; -import org.spongepowered.asm.mixin.extensibility.IMixinInfo; - -import com.gtnewhorizon.gtnhmixins.MinecraftURLClassPath; - -@SuppressWarnings("unused") -public class MixinPlugin implements IMixinConfigPlugin { - - private static final Logger LOG = LogManager.getLogger(MODID + " mixins"); - private static final Path MODS_DIRECTORY_PATH = new File(Launch.minecraftHome, "mods/").toPath(); - - @Override - public void onLoad(String mixinPackage) {} - - @Override - public String getRefMapperConfig() { - return null; - } - - @Override - public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - return false; - } - - @Override - public void acceptTargets(Set myTargets, Set otherTargets) {} - - @Override - public List getMixins() { - final boolean isDevelopmentEnvironment = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); - - List loadedMods = Arrays.stream(TargetedMod.values()) - .filter(mod -> mod == VANILLA || (mod.loadInDevelopment && isDevelopmentEnvironment) || loadJarOf(mod)) - .collect(Collectors.toList()); - - for (TargetedMod mod : TargetedMod.values()) { - if (loadedMods.contains(mod)) { - LOG.info("Found " + mod.modName + "! Integrating now..."); - } else { - LOG.info("Could not find " + mod.modName + "! Skipping integration...."); - } - } - - List mixins = new ArrayList<>(); - for (Mixin mixin : Mixin.values()) { - if (mixin.shouldLoad(loadedMods)) { - mixins.add(mixin.mixinClass); - LOG.debug("Loading mixin: " + mixin.mixinClass); - } - } - return mixins; - } - - private boolean loadJarOf(final TargetedMod mod) { - try { - File jar = findJarOf(mod); - if (jar == null) { - LOG.info("Jar not found for " + mod); - return false; - } - - LOG.info("Attempting to add " + jar + " to the URL Class Path"); - if (!jar.exists()) { - throw new FileNotFoundException(jar.toString()); - } - MinecraftURLClassPath.addJar(jar); - return true; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - public static File findJarOf(final TargetedMod mod) { - try (Stream stream = walk(MODS_DIRECTORY_PATH)) { - return stream.filter(mod::isMatchingJar) - .map(Path::toFile) - .findFirst() - .orElse(null); - } catch (IOException e) { - e.printStackTrace(); - return null; - } - } - - @Override - public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} - - @Override - public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} -} diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/TargetedMod.java b/src/main/java/com/kuba6000/mobsinfo/mixin/TargetedMod.java index 333d28b..6055e2c 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/TargetedMod.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/TargetedMod.java @@ -1,51 +1,38 @@ package com.kuba6000.mobsinfo.mixin; -import java.nio.file.Path; - -import com.google.common.io.Files; +import cpw.mods.fml.common.Mod; public enum TargetedMod { - VANILLA("Minecraft", "unused", true), - INFERNAL_MOBS("InfernalMobs", "InfernalMobs-", true), - ENDER_IO("EnderIO", "EnderIO", true), - DRACONIC_EVOLUTION("DraconicEvolution", "Draconic-Evolution-", true), - DQ_RESPECT("DQMIIINext", "[1.7.10]DQRmod", true), - CHOCO_CRAFT("chococraft", "ChocoCraftPlus-", true), - BATTLE_GEAR_2("battlegear2", "battlegear2-", true), - HARDCORE_ENDER_EXPANSION("HardcoreEnderExpansion", "HardcoreEnderExpansion-", true), - FORESTRY("Forestry", "Forestry-", true), - - ; - + BATTLE_GEAR_2("Mine & Blade Battlegear 2", null, "battlegear2"), + CHOCO_CRAFT("ChocoCraft Plus", null, "chococraft"), + DQ_RESPECT("DQRespect", null, "DQMIIINext"), + DRACONIC_EVOLUTION("Draconic Evolution", null, "DraconicEvolution"), + ENDER_IO("Ender IO", null, "EnderIO"), + FORESTRY("Forestry", null, "Forestry"), + HARDCORE_ENDER_EXPANSION("Hardcore Ender Expansion", null, "HardcoreEnderExpansion"), + INFERNAL_MOBS("Infernal Mobs", null, "InfernalMobs"), + VANILLA("Minecraft", null); + + /** The "name" in the {@link Mod @Mod} annotation */ public final String modName; - public final String jarNamePrefixLowercase; - public final boolean loadInDevelopment; + /** Class that implements the IFMLLoadingPlugin interface */ + public final String coreModClass; + /** The "modid" in the {@link Mod @Mod} annotation */ + public final String modId; - TargetedMod(String modName, String jarNamePrefix, boolean loadInDevelopment) { - this.modName = modName; - this.jarNamePrefixLowercase = jarNamePrefix.toLowerCase(); - this.loadInDevelopment = loadInDevelopment; + TargetedMod(String modName, String coreModClass) { + this(modName, coreModClass, null); } - @SuppressWarnings("UnstableApiUsage") - public boolean isMatchingJar(Path path) { - final String pathString = path.toString(); - final String nameLowerCase = Files.getNameWithoutExtension(pathString) - .toLowerCase(); - final String fileExtension = Files.getFileExtension(pathString); - - return nameLowerCase.startsWith(jarNamePrefixLowercase) && "jar".equals(fileExtension); + TargetedMod(String modName, String coreModClass, String modId) { + this.modName = modName; + this.coreModClass = coreModClass; + this.modId = modId; } @Override public String toString() { - return "TargetedMod{" + "modName='" - + modName - + '\'' - + ", jarNamePrefixLowercase='" - + jarNamePrefixLowercase - + '\'' - + '}'; + return "TargetedMod{modName='" + modName + "', coreModClass='" + coreModClass + "', modId='" + modId + "'}"; } } diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/ASMEventHandlerAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/ASMEventHandlerAccessor.java similarity index 89% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/ASMEventHandlerAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/ASMEventHandlerAccessor.java index 40e1cb7..916e2e0 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/ASMEventHandlerAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/ASMEventHandlerAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EnchantmentHelperMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EnchantmentHelperMixin.java similarity index 96% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EnchantmentHelperMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EnchantmentHelperMixin.java index bf02aad..b9a6e7a 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EnchantmentHelperMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EnchantmentHelperMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import static com.kuba6000.mobsinfo.loader.MobRecipeLoader.randomEnchantmentDetectedString; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityAccessor.java similarity index 85% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityAccessor.java index f8bca66..33b9c48 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import java.util.Random; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingAccessor.java similarity index 85% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingAccessor.java index f0fe3c5..a4c9dab 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.entity.EntityLiving; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingBaseAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingBaseAccessor.java similarity index 87% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingBaseAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingBaseAccessor.java index abeec6e..f520509 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityLivingBaseAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityLivingBaseAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntitySlimeAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntitySlimeAccessor.java similarity index 83% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntitySlimeAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntitySlimeAccessor.java index 3f2687d..757840a 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntitySlimeAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntitySlimeAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.entity.monster.EntitySlime; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityVillagerAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityVillagerAccessor.java similarity index 84% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityVillagerAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityVillagerAccessor.java index 16e68e8..b0bf849 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EntityVillagerAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EntityVillagerAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.entity.passive.EntityVillager; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EventBusAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EventBusAccessor.java similarity index 83% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EventBusAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EventBusAccessor.java index e18c191..a02f021 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/EventBusAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/EventBusAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiAccessor.java similarity index 84% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiAccessor.java index a55b74c..71013a9 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiContainerAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiContainerAccessor.java similarity index 86% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiContainerAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiContainerAccessor.java index d753421..8836a0e 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/GuiContainerAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/GuiContainerAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.client.gui.inventory.GuiContainer; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/RendererLivingEntityAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/RendererLivingEntityAccessor.java similarity index 86% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/RendererLivingEntityAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/RendererLivingEntityAccessor.java index d37fbb3..8cd4297 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/RendererLivingEntityAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/RendererLivingEntityAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RendererLivingEntity; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/VillagerRegistryAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/VillagerRegistryAccessor.java similarity index 88% rename from src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/VillagerRegistryAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/VillagerRegistryAccessor.java index 81b3865..22df037 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/minecraft/VillagerRegistryAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/early/minecraft/VillagerRegistryAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.minecraft; +package com.kuba6000.mobsinfo.mixin.early.minecraft; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/ChocoCraft/EntityAnimalChocoboMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/ChocoCraft/EntityAnimalChocoboMixin.java similarity index 91% rename from src/main/java/com/kuba6000/mobsinfo/mixin/ChocoCraft/EntityAnimalChocoboMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/ChocoCraft/EntityAnimalChocoboMixin.java index 8ccb082..ffb2da5 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/ChocoCraft/EntityAnimalChocoboMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/ChocoCraft/EntityAnimalChocoboMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.ChocoCraft; +package com.kuba6000.mobsinfo.mixin.late.ChocoCraft; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/DqmEntitySweetbagMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/DqmEntitySweetbagMixin.java similarity index 81% rename from src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/DqmEntitySweetbagMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/DqmEntitySweetbagMixin.java index 436758a..e73c80d 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/DqmEntitySweetbagMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/DqmEntitySweetbagMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.DQRespect; +package com.kuba6000.mobsinfo.mixin.late.DQRespect; import java.util.Random; @@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -import com.kuba6000.mobsinfo.mixin.minecraft.EntityAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntityAccessor; import dqr.entity.mobEntity.monsterTensei.DqmEntitySweetbag; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/FuncCalcMobParamMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/FuncCalcMobParamMixin.java similarity index 93% rename from src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/FuncCalcMobParamMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/FuncCalcMobParamMixin.java index f3ce2a3..d8c26b6 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/DQRespect/FuncCalcMobParamMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DQRespect/FuncCalcMobParamMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.DQRespect; +package com.kuba6000.mobsinfo.mixin.late.DQRespect; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java similarity index 87% rename from src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java index 582ae86..ea09e7a 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/MinecraftForgeEventHandlerAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.DraconicEvolution; +package com.kuba6000.mobsinfo.mixin.late.DraconicEvolution; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/RenderMobSoulMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/RenderMobSoulMixin.java similarity index 95% rename from src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/RenderMobSoulMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/RenderMobSoulMixin.java index 08072bd..bfac7a6 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/DraconicEvolution/RenderMobSoulMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/DraconicEvolution/RenderMobSoulMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.DraconicEvolution; +package com.kuba6000.mobsinfo.mixin.late.DraconicEvolution; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/BlockPoweredSpawnerAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/BlockPoweredSpawnerAccessor.java similarity index 88% rename from src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/BlockPoweredSpawnerAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/BlockPoweredSpawnerAccessor.java index e506964..1704c9c 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/BlockPoweredSpawnerAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/BlockPoweredSpawnerAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.EnderIO; +package com.kuba6000.mobsinfo.mixin.late.EnderIO; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/ItemSoulVesselAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/ItemSoulVesselAccessor.java similarity index 85% rename from src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/ItemSoulVesselAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/ItemSoulVesselAccessor.java index bdb3421..aad9313 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/EnderIO/ItemSoulVesselAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/EnderIO/ItemSoulVesselAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.EnderIO; +package com.kuba6000.mobsinfo.mixin.late.EnderIO; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/Forestry/EntityButterflyMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/Forestry/EntityButterflyMixin.java similarity index 95% rename from src/main/java/com/kuba6000/mobsinfo/mixin/Forestry/EntityButterflyMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/Forestry/EntityButterflyMixin.java index e71f5c8..11e2dfc 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/Forestry/EntityButterflyMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/Forestry/EntityButterflyMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.Forestry; +package com.kuba6000.mobsinfo.mixin.late.Forestry; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java similarity index 92% rename from src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java index 36b9609..d42abb3 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobHomelandEndermanMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.HardcoreEnderExpansion; +package com.kuba6000.mobsinfo.mixin.late.HardcoreEnderExpansion; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobLouseMixin.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobLouseMixin.java similarity index 89% rename from src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobLouseMixin.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobLouseMixin.java index db23ef2..c9f7220 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/HardcoreEnderExpansion/EntityMobLouseMixin.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/HardcoreEnderExpansion/EntityMobLouseMixin.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.HardcoreEnderExpansion; +package com.kuba6000.mobsinfo.mixin.late.HardcoreEnderExpansion; import java.util.Random; @@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.kuba6000.mobsinfo.loader.MobRecipeLoader; -import com.kuba6000.mobsinfo.mixin.minecraft.EntityAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.EntityAccessor; import chylex.hee.entity.mob.EntityMobLouse; import chylex.hee.tileentity.spawner.LouseRavagedSpawnerLogic; diff --git a/src/main/java/com/kuba6000/mobsinfo/mixin/InfernalMobs/InfernalMobsCoreAccessor.java b/src/main/java/com/kuba6000/mobsinfo/mixin/late/InfernalMobs/InfernalMobsCoreAccessor.java similarity index 94% rename from src/main/java/com/kuba6000/mobsinfo/mixin/InfernalMobs/InfernalMobsCoreAccessor.java rename to src/main/java/com/kuba6000/mobsinfo/mixin/late/InfernalMobs/InfernalMobsCoreAccessor.java index 8e6228d..7cae1a7 100644 --- a/src/main/java/com/kuba6000/mobsinfo/mixin/InfernalMobs/InfernalMobsCoreAccessor.java +++ b/src/main/java/com/kuba6000/mobsinfo/mixin/late/InfernalMobs/InfernalMobsCoreAccessor.java @@ -1,4 +1,4 @@ -package com.kuba6000.mobsinfo.mixin.InfernalMobs; +package com.kuba6000.mobsinfo.mixin.late.InfernalMobs; import java.util.ArrayList; import java.util.Random; diff --git a/src/main/java/com/kuba6000/mobsinfo/nei/EnderIOGetter.java b/src/main/java/com/kuba6000/mobsinfo/nei/EnderIOGetter.java index a06fb9f..1f5d00d 100644 --- a/src/main/java/com/kuba6000/mobsinfo/nei/EnderIOGetter.java +++ b/src/main/java/com/kuba6000/mobsinfo/nei/EnderIOGetter.java @@ -4,7 +4,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import com.kuba6000.mobsinfo.mixin.EnderIO.BlockPoweredSpawnerAccessor; +import com.kuba6000.mobsinfo.mixin.late.EnderIO.BlockPoweredSpawnerAccessor; import crazypants.enderio.EnderIO; import crazypants.enderio.machine.spawner.BlockPoweredSpawner; diff --git a/src/main/java/com/kuba6000/mobsinfo/nei/MobHandler.java b/src/main/java/com/kuba6000/mobsinfo/nei/MobHandler.java index c19bba0..f69a231 100644 --- a/src/main/java/com/kuba6000/mobsinfo/nei/MobHandler.java +++ b/src/main/java/com/kuba6000/mobsinfo/nei/MobHandler.java @@ -78,8 +78,8 @@ import com.kuba6000.mobsinfo.api.utils.MobUtils; import com.kuba6000.mobsinfo.api.utils.ModUtils; import com.kuba6000.mobsinfo.config.Config; -import com.kuba6000.mobsinfo.mixin.InfernalMobs.InfernalMobsCoreAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.GuiContainerAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.GuiContainerAccessor; +import com.kuba6000.mobsinfo.mixin.late.InfernalMobs.InfernalMobsCoreAccessor; import com.kuba6000.mobsinfo.nei.scrollable.IScrollableGUI; import com.kuba6000.mobsinfo.nei.scrollable.Scrollbar; import com.kuba6000.mobsinfo.savedata.PlayerData; diff --git a/src/main/java/com/kuba6000/mobsinfo/nei/MobHandlerInfernal.java b/src/main/java/com/kuba6000/mobsinfo/nei/MobHandlerInfernal.java index a48254e..b72f3af 100644 --- a/src/main/java/com/kuba6000/mobsinfo/nei/MobHandlerInfernal.java +++ b/src/main/java/com/kuba6000/mobsinfo/nei/MobHandlerInfernal.java @@ -18,7 +18,7 @@ import com.kuba6000.mobsinfo.MobsInfo; import com.kuba6000.mobsinfo.api.helper.TranslationHelper; import com.kuba6000.mobsinfo.api.utils.FastRandom; -import com.kuba6000.mobsinfo.mixin.InfernalMobs.InfernalMobsCoreAccessor; +import com.kuba6000.mobsinfo.mixin.late.InfernalMobs.InfernalMobsCoreAccessor; import com.kuba6000.mobsinfo.nei.scrollable.IScrollableGUI; import com.kuba6000.mobsinfo.nei.scrollable.Scrollbar; diff --git a/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/ScrollableContainerHandler.java b/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/ScrollableContainerHandler.java index 51c5842..413488f 100644 --- a/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/ScrollableContainerHandler.java +++ b/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/ScrollableContainerHandler.java @@ -5,7 +5,7 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import com.kuba6000.mobsinfo.mixin.minecraft.GuiContainerAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.GuiContainerAccessor; import codechicken.nei.guihook.IContainerObjectHandler; import codechicken.nei.recipe.GuiRecipe; diff --git a/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/Scrollbar.java b/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/Scrollbar.java index 1d788b4..9dbe2a6 100644 --- a/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/Scrollbar.java +++ b/src/main/java/com/kuba6000/mobsinfo/nei/scrollable/Scrollbar.java @@ -11,8 +11,8 @@ import org.lwjgl.opengl.GL11; -import com.kuba6000.mobsinfo.mixin.minecraft.GuiAccessor; -import com.kuba6000.mobsinfo.mixin.minecraft.GuiContainerAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.GuiAccessor; +import com.kuba6000.mobsinfo.mixin.early.minecraft.GuiContainerAccessor; import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIClientUtils; diff --git a/src/main/resources/mixins.mobsinfo.early.json b/src/main/resources/mixins.mobsinfo.early.json new file mode 100644 index 0000000..43b76cc --- /dev/null +++ b/src/main/resources/mixins.mobsinfo.early.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "com.kuba6000.mobsinfo.mixin.early", + "refmap": "mixins.mobsinfo.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +} diff --git a/src/main/resources/mixins.mobsinfo.json b/src/main/resources/mixins.mobsinfo.json index c3a9655..0f39cdc 100644 --- a/src/main/resources/mixins.mobsinfo.json +++ b/src/main/resources/mixins.mobsinfo.json @@ -1,12 +1,7 @@ { "required": true, "minVersion": "0.8.5-GTNH", - "package": "com.kuba6000.mobsinfo.mixin", - "plugin": "com.kuba6000.mobsinfo.mixin.MixinPlugin", "refmap": "mixins.mobsinfo.refmap.json", "target": "@env(DEFAULT)", - "compatibilityLevel": "JAVA_8", - "mixins": [], - "client": [], - "server": [] + "compatibilityLevel": "JAVA_8" } diff --git a/src/main/resources/mixins.mobsinfo.late.json b/src/main/resources/mixins.mobsinfo.late.json new file mode 100644 index 0000000..b5e9cd4 --- /dev/null +++ b/src/main/resources/mixins.mobsinfo.late.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "com.kuba6000.mobsinfo.mixin.late", + "refmap": "mixins.mobsinfo.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +}