diff --git a/build.gradle b/build.gradle index e2979b1d6..2c9a4f8fe 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ dependencies { modApi("com.terraformersmc:modmenu:${project.modmenu_version}") // Origins compat - modImplementation "com.github.apace100:origins-fabric:${project.origins_version}" + modCompileOnly "com.github.apace100:origins-fabric:${project.origins_version}" // MM Decorations //modRuntimeOnly("nourl:MythicMetalsDecorations:${project.mmdecorations_version}") diff --git a/src/main/java/nourl/mythicmetals/mixin/EntityModelLayersAccessor.java b/src/main/java/nourl/mythicmetals/mixin/EntityModelLayersAccessor.java new file mode 100644 index 000000000..3e302bca1 --- /dev/null +++ b/src/main/java/nourl/mythicmetals/mixin/EntityModelLayersAccessor.java @@ -0,0 +1,17 @@ +package nourl.mythicmetals.mixin; + +import net.minecraft.client.render.entity.model.EntityModelLayer; +import net.minecraft.client.render.entity.model.EntityModelLayers; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.util.Set; + +@Mixin(EntityModelLayers.class) +public interface EntityModelLayersAccessor { + + @Accessor + static Set getLAYERS() { + throw new UnsupportedOperationException(); + } +} diff --git a/src/main/java/nourl/mythicmetals/mixin/MythicMetalsMixinPlugin.java b/src/main/java/nourl/mythicmetals/mixin/MythicMetalsMixinPlugin.java deleted file mode 100644 index 8af2824ad..000000000 --- a/src/main/java/nourl/mythicmetals/mixin/MythicMetalsMixinPlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -package nourl.mythicmetals.mixin; - -import net.fabricmc.loader.api.FabricLoader; -import org.objectweb.asm.tree.ClassNode; -import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; -import org.spongepowered.asm.mixin.extensibility.IMixinInfo; - -import java.util.List; -import java.util.Set; - -public class MythicMetalsMixinPlugin implements IMixinConfigPlugin { - @Override - public void onLoad(String mixinPackage) { - } - - @Override - public String getRefMapperConfig() { - return null; - } - - @Override - public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - return FabricLoader.getInstance().isModLoaded("origins") && !mixinClassName.equals("DamageOverTimePowerMixin"); - } - - @Override - public void acceptTargets(Set myTargets, Set otherTargets) { - - } - - @Override - public List getMixins() { - - 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/nourl/mythicmetals/models/MythicModelHandler.java b/src/main/java/nourl/mythicmetals/models/MythicModelHandler.java index 0ec082319..50d38fe79 100644 --- a/src/main/java/nourl/mythicmetals/models/MythicModelHandler.java +++ b/src/main/java/nourl/mythicmetals/models/MythicModelHandler.java @@ -1,11 +1,11 @@ package nourl.mythicmetals.models; -import net.fabricmc.fabric.mixin.client.rendering.EntityModelLayersAccessor; import net.minecraft.client.model.Dilation; import net.minecraft.client.model.TexturedModelData; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.util.Identifier; +import nourl.mythicmetals.mixin.EntityModelLayersAccessor; import nourl.mythicmetals.utils.RegistryHelper; import java.util.function.BiConsumer; @@ -33,7 +33,7 @@ public static void init(BiConsumer consumer */ public static EntityModelLayer model(String name, String layer) { var result = new EntityModelLayer(RegistryHelper.id(name), layer); - EntityModelLayersAccessor.getLayers().add(result); + EntityModelLayersAccessor.getLAYERS().add(result); return result; } diff --git a/src/main/resources/mythicmetals.mixins.json b/src/main/resources/mythicmetals.mixins.json index 43638e1ae..ee05a9b3b 100644 --- a/src/main/resources/mythicmetals.mixins.json +++ b/src/main/resources/mythicmetals.mixins.json @@ -25,10 +25,10 @@ ], "client": [ "CapeFeatureRendererMixin", + "EntityModelLayersAccessor", "ElytraFeatureRendererMixin", "WorldRendererInvoker" ], - "plugin": "nourl.mythicmetals.mixin.MythicMetalsMixinPlugin", "injectors": { "defaultRequire": 1 }