LXGaming / MixinBootstrap

MixinBootstrap is a temporary way of booting Mixin in a MinecraftForge production environment.
Apache License 2.0
54 stars 4 forks source link

New Maintainer of JEID needs help with MixinBootstrap bug #51

Closed Mysticpasta1 closed 2 years ago

Mysticpasta1 commented 2 years ago

I'm the new maintainer of JEID, I was wondering if you had discord? I'm having trouble with fixing the current JEID bug with MixinBootstrap. I was wondering if you can help me fix it. Current issue : #48

This is with latest JEID 1.0.3-55 and latest MixinBootstrap 1.1.0-1.12.2

My discord is Hauntedpasta1#8200

Hope to get this fix soon :D

LXGaming commented 2 years ago

You can use the following to workaround the class being package-private

Class<?> mixinProcessorClass = Class.forName("org.spongepowered.asm.mixin.transformer.MixinProcessor");

then simply replace any instances of MixinProcessor.class with mixinProcessorClass

Mysticpasta1 commented 2 years ago

ah great

Mysticpasta1 commented 2 years ago

ok how do I use your mod as a library for mixin

Mysticpasta1 commented 2 years ago

because apparently mixin doesn't like to load correctly anymore

LXGaming commented 2 years ago

You should be able to use Mixin 0.8.3, Mixin 0.8.4+ has classes in it which cause ASM in Forge 1.12.2 to explode.

If you want to use MixinBootstrap, don't compile Mixin in your mod jar and just mark MixinBootstrap as a dependency on CurseForge

Mysticpasta1 commented 2 years ago

ok but how do I make it to where it is used as a dependency inside the mod itself

LXGaming commented 2 years ago

You don't, MixinBootstrap is not technically a Forge mod, It loads before Forge in order to add the Mixin Library to Minecraft.

Mysticpasta1 commented 2 years ago

oh on a side note how do I get this bit working exactly the line that is comment out typical crashes on any mixin version

package org.dimdev.jeid;

import net.minecraftforge.common.ForgeVersion;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;

import javax.annotation.Nullable;
import java.util.Map;

@IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion)
@IFMLLoadingPlugin.SortingIndex(-7500)
@IFMLLoadingPlugin.Name("JustEnoughIDs Extension Plugin")
//@IFMLLoadingPlugin.TransformerExclusions("org.dimdev.jeid.")
public class JEIDLoadingPlugin implements IFMLLoadingPlugin {

    public JEIDLoadingPlugin() {
       //MixinBootstrap.init(); //this line is crashy
        Utils.LOGGER.info("Initializing JustEnoughIDs core mixins");
        Mixins.addConfiguration("mixins.jeid.core.json");
        Utils.LOGGER.info("Initializing JustEnoughIDs initialization mixins");
        Mixins.addConfiguration("mixins.jeid.init.json");
    }

    @Override public String[] getASMTransformerClass() { Obf.loadData(); return new String[]{ "org.dimdev.jeid.JEIDTransformer" }; }
    @Override public String getModContainerClass() { return null; }
    @Nullable @Override public String getSetupClass() { return null; }
    @Override public void injectData(Map<String, Object> data) {}
    @Override public String getAccessTransformerClass() { return null; }
}
Mysticpasta1 commented 2 years ago

it is a thorn in my side atm

Mysticpasta1 commented 2 years ago

this mod heavy relies on mixin being their before construction

Mysticpasta1 commented 2 years ago

should I add the commentted out line or not

LXGaming commented 2 years ago

What is the crash you are getting?, Also the MixinTweaker (https://github.com/DimensionalDevelopment/JustEnoughIDs/blob/e74921c63539db027816741cb282bc0ecb09601c/build.gradle#L154) handled the initialization of Mixin so you may not require "MixinBootstrap.init();"

Mysticpasta1 commented 2 years ago

it isn't a crash per say more a debug that cause the mod to not load into the game https://gist.github.com/Mysticpasta1/a960de264fc45b13ccc6411769484d3f

LXGaming commented 2 years ago

Use Mixin 0.8.3 to fix that error

Mysticpasta1 commented 2 years ago

ok great but how do I do so when planning on using your mod

like this implementation "org.spongepowered:mixin:0.8.3"

and load MixinBootstrap in the mods folder

Mysticpasta1 commented 2 years ago

ok that was it but new error

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.spongepowered.asm.launch.GlobalProperties.get(Lorg/spongepowered/asm/launch/GlobalProperties$Keys;)Ljava/lang/Object;" the class loader (instance of net/minecraft/launchwrapper/LaunchClassLoader) of the current class, org/spongepowered/asm/mixin/MixinEnvironment, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/spongepowered/asm/launch/GlobalProperties, have different Class objects for the type org/spongepowered/asm/launch/GlobalProperties$Keys used in the signature

Mysticpasta1 commented 2 years ago

idk what this means

Mysticpasta1 commented 2 years ago

I think I know what happen to different mixin libraries collided and exploded

Mysticpasta1 commented 2 years ago

with just your mod in the mod folder in the dev environment and no mixin library loaded this error occurs

Caused by: java.lang.NoClassDefFoundError: org/spongepowered/asm/mixin/Mixins

Mysticpasta1 commented 2 years ago

I noticed you fork JEID do you want me to push the recent changes

LXGaming commented 2 years ago

I've made some changes, I haven't had a chance to test them https://github.com/LXGaming/JustEnoughIDs/tree/fixes

Mysticpasta1 commented 2 years ago

if you can send a PR when done I will merge it

Mysticpasta1 commented 2 years ago

do you want me to just copy it or wait on a PR from you, just curious

LXGaming commented 2 years ago

I'll make a PR

Mysticpasta1 commented 2 years ago

YAY

Mysticpasta1 commented 2 years ago

btw do you want to join dimensional doors discord btw or are you good

Mysticpasta1 commented 2 years ago

thought I'd ask :D

Mysticpasta1 commented 2 years ago

after the PR is merge I will make a jar put it on CF and then I can close all these issue reports :D

Mysticpasta1 commented 2 years ago

so is it working?