SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.4k stars 192 forks source link

LinkageError #317

Closed yandhi closed 5 years ago

yandhi commented 5 years ago

Hi, I know this issue has been reported twice already. However, tested on both me and a co-developers workstations, this problem persists. Basically the client believes there are two instances of Entity. For past reference, at one point this very project source and code worked perfectly fine. I also made a test project for 1.12.2 with a simple initialization call and it also produces the same problem.

As I do not know if this is possible to fix, just please keep me up to date.

Thanks in advance, Kix.

The Console output for this problem is below:


[17:35:46] [main/INFO] [LaunchWrapper]: Loading tweak class name me.kix.uzi.UziTweaker
[17:35:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[17:35:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[17:35:46] [main/INFO] [FML]: Forge Mod Loader version 14.23.3.2655 for Minecraft 1.12.2 loading
[17:35:46] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_141, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_141\jre
[17:35:46] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[17:35:46] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[17:35:46] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[17:35:46] [main/INFO] [LaunchWrapper]: Calling tweak class me.kix.uzi.UziTweaker
[17:35:46] [main/INFO] [STDOUT]: [me.kix.uzi.UziTweaker:injectIntoClassLoader:29]: Initializing Uzi's mixins
[17:35:47] [main/INFO] [mixin]: SpongePowered MIXIN Subsystem Version=0.7.11 Source=file:/C:/Users/Verble/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.7.11-SNAPSHOT/7a670207bdb97db418118ad1e9bb42424ff3776d/mixin-0.7.11-SNAPSHOT.jar Service=LaunchWrapper Env=CLIENT
[17:35:47] [main/INFO] [mixin]: Compatibility level set to JAVA_8
[17:35:47] [main/ERROR] [mixin]: Mixin config mixins.uzi.json does not specify "minVersion" property
[17:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[17:35:47] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[17:35:47] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[17:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name org.spongepowered.asm.mixin.EnvironmentStateTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[17:35:49] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[17:35:49] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[17:35:49] [main/INFO] [LaunchWrapper]: Calling tweak class org.spongepowered.asm.mixin.EnvironmentStateTweaker
[17:35:49] [main/INFO] [mixin]: Initialised Mixin FML Remapper Adapter with net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper@76ececd
[17:35:49] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[17:35:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[17:35:51] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[17:35:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[17:35:51] [main/WARN] [mixin]: Reference map 'mixins.uzi.refmap.json' for mixins.uzi.json could not be read. If this is a development environment you can ignore this message
[17:35:51] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:renderer.MixinEntityRenderer, name: me.kix.uzi.api.game.impl.renderer.MixinEntityRenderer
[17:35:51] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:renderer.MixinRender, name: me.kix.uzi.api.game.impl.renderer.MixinRender
[17:35:51] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:screen.MixinGuiChest, name: me.kix.uzi.api.game.impl.screen.MixinGuiChest
[17:35:51] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:entity.MixinEntity, name: me.kix.uzi.api.game.impl.entity.MixinEntity
[17:35:51] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:entity.MixinEntityLivingBase, name: me.kix.uzi.api.game.impl.entity.MixinEntityLivingBase
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:entity.MixinEntityPlayerSP, name: me.kix.uzi.api.game.impl.entity.MixinEntityPlayerSP
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.MixinMinecraft, name: me.kix.uzi.api.game.impl.client.MixinMinecraft
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.key.MixinKeybinding, name: me.kix.uzi.api.game.impl.client.key.MixinKeybinding
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.font.MixinFontRenderer, name: me.kix.uzi.api.game.impl.client.font.MixinFontRenderer
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.multiplayer.MixinPlayerControllerMP, name: me.kix.uzi.api.game.impl.client.multiplayer.MixinPlayerControllerMP
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.world.ChunkProviderServerMixin, name: me.kix.uzi.api.game.impl.client.world.ChunkProviderServerMixin
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:client.world.ChunkProviderClientMixin, name: me.kix.uzi.api.game.impl.client.world.ChunkProviderClientMixin
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:connection.MixinNetworkManager, name: me.kix.uzi.api.game.impl.connection.MixinNetworkManager
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:connection.MixinNetHandlerPlayClient, name: me.kix.uzi.api.game.impl.connection.MixinNetHandlerPlayClient
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:block.MixinBlock, name: me.kix.uzi.api.game.impl.block.MixinBlock
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:block.MixinBlockDoublePlant, name: me.kix.uzi.api.game.impl.block.MixinBlockDoublePlant
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:block.MixinBlockFarmland, name: me.kix.uzi.api.game.impl.block.MixinBlockFarmland
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:packet.MixinCPacketUseEntity, name: me.kix.uzi.api.game.impl.packet.MixinCPacketUseEntity
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:packet.MixinCPacketPlayer, name: me.kix.uzi.api.game.impl.packet.MixinCPacketPlayer
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:screen.MixinGuiScreen, name: me.kix.uzi.api.game.impl.screen.MixinGuiScreen
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:screen.MixinGuiMultiplayer, name: me.kix.uzi.api.game.impl.screen.MixinGuiMultiplayer
[17:35:52] [main/ERROR] [mixin]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.uzi.json:renderer.MixinRenderManager, name: me.kix.uzi.api.game.impl.renderer.MixinRenderManager
[17:35:52] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[17:35:53] [main/INFO] [net.minecraft.client.Minecraft]: Setting user: Player108
[17:35:58] [main/INFO] [net.minecraft.client.Minecraft]: LWJGL Version: 2.9.4
[17:35:59] [main/INFO] [FML]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_141, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 444552312 bytes (423 MB) / 718274560 bytes (685 MB) up to 3795845120 bytes (3620 MB)
    JVM Flags: 0 total; 
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 391.25' Renderer: 'GeForce GTX 1070/PCIe/SSE2'
[17:35:59] [main/INFO] [FML]: MinecraftForge v14.23.3.2655 Initialized
[17:35:59] [main/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[17:35:59] [main/INFO] [FML]: Replaced 1036 ore ingredients
[17:35:59] [main/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[17:35:59] [main/INFO] [FML]: Searching C:\Users\Verble\Development\uzi\run\mods for mods
[17:36:01] [main/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[17:36:01] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge] at CLIENT
[17:36:01] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge] at SERVER
[17:36:02] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 108894979 nanos
[17:36:02] [main/INFO] [net.minecraft.client.resources.SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge
[17:36:02] [main/INFO] [FML]: Processing ObjectHolder annotations
[17:36:02] [main/INFO] [FML]: Found 1168 ObjectHolder annotations
[17:36:02] [main/INFO] [FML]: Identifying ItemStackHolder annotations
[17:36:02] [main/INFO] [FML]: Found 0 ItemStackHolder annotations
[17:36:03] [main/INFO] [FML]: Configured a dormant chunk cache size of 0
[17:36:03] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[17:36:03] [main/INFO] [FML]: Applying holder lookups
[17:36:03] [main/INFO] [FML]: Holder lookups applied
[17:36:03] [main/INFO] [FML]: Applying holder lookups
[17:36:03] [main/INFO] [FML]: Holder lookups applied
[17:36:03] [main/INFO] [FML]: Applying holder lookups
[17:36:03] [main/INFO] [FML]: Holder lookups applied
[17:36:03] [main/INFO] [FML]: Applying holder lookups
[17:36:03] [main/INFO] [FML]: Holder lookups applied
[17:36:03] [main/INFO] [FML]: Injecting itemstacks
[17:36:03] [main/INFO] [FML]: Itemstack injection complete
[17:36:03] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: OUTDATED Target: 14.23.5.2768
[17:36:05] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager]: Starting up SoundSystem...
[17:36:06] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: Initializing LWJGL OpenAL
[17:36:06] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[17:36:06] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: OpenAL initialized.
[17:36:06] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager]: Sound engine started
[17:36:10] [main/INFO] [FML]: Max texture size: 16384
[17:36:10] [main/INFO] [net.minecraft.client.renderer.texture.TextureMap]: Created: 512x512 textures-atlas
[17:36:12] [main/INFO] [FML]: Applying holder lookups
[17:36:12] [main/INFO] [FML]: Holder lookups applied
[17:36:12] [main/INFO] [FML]: Injecting itemstacks
[17:36:12] [main/INFO] [FML]: Itemstack injection complete
[17:36:12] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[17:36:12] [main/INFO] [com.mojang.text2speech.NarratorWindows]: Narrator library for x64 successfully loaded
[17:36:12] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Why did you do that?

Time: 4/2/19 5:36 PM
Description: Initializing game

java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "net/minecraft/entity/Entity"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at me.kix.uzi.management.plugin.manage.PluginManager.init(PluginManager.java:31)
    at me.kix.uzi.Uzi.init(Uzi.java:37)
    at net.minecraft.client.Minecraft.handler$init$zzc000(Minecraft.java:3566)
    at net.minecraft.client.Minecraft.init(Minecraft.java:611)
    at net.minecraft.client.Minecraft.run(Minecraft.java:416)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at me.kix.uzi.management.plugin.manage.PluginManager.init(PluginManager.java:31)
    at me.kix.uzi.Uzi.init(Uzi.java:37)
    at net.minecraft.client.Minecraft.handler$init$zzc000(Minecraft.java:3566)
    at net.minecraft.client.Minecraft.init(Minecraft.java:611)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:416)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)```
liach commented 5 years ago

give the code. you are loading entity class in coremod/tweaker code, which is not mixin's fault

yandhi commented 5 years ago

My MixinEntity class appears as so:

@Mixin(Entity.class)
public abstract class MixinEntity {

    @Shadow
    public double posX;
    @Shadow
    public double posY;
    @Shadow
    public double posZ;
    @Shadow
    public double motionX;
    @Shadow
    public double motionZ;
    @Shadow
    public float rotationYaw;
    @Shadow
    public float rotationPitch;
    @Shadow
    public boolean onGround;
    @Shadow
    public World world;
    private Angle rotations;

    @Shadow
    public abstract boolean isSprinting();

    @Shadow
    public abstract boolean isRiding();

    @Shadow
    public abstract boolean isSneaking();

    @Shadow
    public void move(MoverType type, double x, double y, double z) {}

    public Angle getRotations() {
        if (rotations == null)
            rotations = new Angle(0, 0);
        return rotations.setYaw(rotationYaw).setPitch(rotationPitch);
    }
}
yandhi commented 5 years ago

My Tweaker looks like so:

public class UziTweaker implements ITweaker {

    @Override
    public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) { }

    @Override
    public void injectIntoClassLoader(LaunchClassLoader classLoader) {
        MixinBootstrap.init();
        Mixins.addConfiguration("mixins.uzi.json");
        MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
    }

    @Override
    public String getLaunchTarget() {
        return "net.minecraft.client.main.Main";
    }

    @Override
    public String[] getLaunchArguments() {
        return new String[0];
    }
}
ZombieHDGaming commented 5 years ago

What......what is the point of the tweaker? If you're using Forge for your project (which it looks like you are), all you would need is to create an FML Loading Plugin for initializing your mixins and let Mixins and Forge handle the rest. Realistically, without seeing more code, we can't help too much unless we know the circumstances of what you're trying to do.

If you're just making a Forge mod, then get rid of the tweaker. There's no need for that, and an FML plugin works perfectly fine, maybe a MixinConfigPlugin if needed. For a better idea, take a look at the way VanillaFix handles Mixins and a MixinConfigPlugin.

liach commented 5 years ago

Hmm, if you can link to the project, I may help more, as I spotted nowhere where you might have classloaded Entity too early yet. On a side note, your public Angle getRotations() method declared in your mixin cannot be called unless you call it via reflection. You should make the mixin class implement an interface that exposes Angle getRotations() method.

Mumfrey commented 5 years ago

Since you are not willing to provide the actual code then we can't really help you further. You are violating the coremod contract by classloading a game class during PREINIT but without your codebase we can't tell you where. This is not a bug in mixin so closing as invalid. If you are willing to post your codebase then you can continue to discuss the problem here but I'm closing this issue since this is a bug tracker not a support forum.

Mumfrey commented 5 years ago

I should also point out that the documentation explicitly and exhaustively explains bootstrapping mixin and at no point does it say to create a tweaker. In fact it expressly mentions using Mixin's own tweaker because this is used as a marker to allow discovery of other mixin containers, using a different tweaker will immediately break this functionality.

yandhi commented 5 years ago

Okay, Thanks for the help guys. Even though my issue was invalid, reading up on the documentation that Mumfrey posted helped a lot. I managed to get it working in a production environment. As for a testing environment, I should be able to fix it for their as well. Thanks guys!