Jump to content

[1.12.2] Error when trying to load proxy [Solved]


WORMSTweaker

Recommended Posts

Hello!
So, I wanted to get back into modding, but apparently the world is against me today.
My problem is, that when starting up, FML simply crashes at the construction phase, claiming that it couldn't "load a proxy".
I never had trouble with this kind of error, and I wanted to know if somebody could help me with this.
And just so you know, I read and re-read the few classes I have, looked at multiple exemples on proxies and even rewritten my Client, Server, and CommonProxy (since thre's pretty much nothing in them)

Here's the crash message :
 

Spoiler

[19:45:03] [Client thread/ERROR] [FML]: An error occurred trying to load a proxy into fr.wormstweaker.hyper.Hyper.proxy
java.lang.InstantiationException: null
	at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) ~[?:1.8.0_171]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_171]
	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_171]
	at net.minecraftforge.fml.common.ProxyInjector.inject(ProxyInjector.java:85) [ProxyInjector.class:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:613) [FMLModContainer.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) [LoadController.class:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) [LoadController.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:593) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]

 

And this is my main class, I checked if the paths in @SidedProxy() to see if they were wrong, and they apparently aren't :
 

Spoiler

package fr.wormstweaker.hyper;

import fr.wormstweaker.hyper.proxy.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import static net.minecraftforge.fml.common.registry.GameRegistry.*;

@Mod(
        modid = Hyper.MOD_ID,
        name = Hyper.MOD_NAME,
        version = Hyper.VERSION
)
public class Hyper {

    public static final String MOD_ID = "hyper";
    public static final String MOD_NAME = "Hyper";
    public static final String VERSION = "0.1";

    @Mod.Instance(Hyper.MOD_ID)
    public static Hyper instance;

    @SidedProxy(
            clientSide = "fr.wormstweaker.hyper.proxy.ClientProxy",
            serverSide = "fr.wormstweaker.hyper.proxy.ServerProxy"
    )
    public static CommonProxy proxy;

    @EventHandler
    public void preinit(FMLPreInitializationEvent event) {
        proxy.preInit();
        proxy.registerRenderers();
    }

    @EventHandler
    public void init(FMLInitializationEvent event) {
        proxy.init();
    }

    @EventHandler
    public void postinit(FMLPostInitializationEvent event) {
        proxy.postInit();
    }

public static String prependModID(String name) {return MOD_ID + ":" + name;}
}

 


As you can see, there's pretty much nothing here for now, and the same can be said for my proxy classes.
Those are my Common, Client, and ServerProxy:
 

Spoiler

package fr.wormstweaker.hyper.proxy;

import net.minecraft.entity.player.EntityPlayer;

public abstract class CommonProxy {

    public void preInit() {

    }

    public void init() {

    }

    public void postInit() {

    }

    public void registerRenderers() {

    }

    public boolean playerIsInCreativeMode(EntityPlayer player) {
        return false;
    }

    public boolean isDedicatedServer() {
        return false;
    }
}

 

Spoiler

package fr.wormstweaker.hyper.proxy;

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public abstract class ClientProxy extends CommonProxy {
   @Override
    public void preInit()
    {

    }
    @Override
    public void init()
    {

    }
    @Override
    public void postInit()
    {

    }

    @Override
    public void registerRenderers() {

    }

    @Override
    public boolean playerIsInCreativeMode(EntityPlayer player)
    {
        if (player instanceof EntityPlayerMP) {
            EntityPlayerMP entityPlayerMP = (EntityPlayerMP)player;
            return entityPlayerMP.interactionManager.isCreative();
        } else if(player instanceof EntityPlayerSP) {
            return Minecraft.getMinecraft().playerController.isInCreativeMode();
        }
        return false;
    }

    @Override
    public boolean isDedicatedServer()
    {
        return false;
    }

}

 

Spoiler

package fr.wormstweaker.hyper.proxy;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.SERVER)
public abstract class ServerProxy extends CommonProxy {
    @Override
    public void preInit()
    {

    }
    @Override
    public void init()
    {

    }
    @Override
    public void postInit()
    {

    }

    @Override
    public boolean playerIsInCreativeMode(EntityPlayer player)
    {
        if (player instanceof EntityPlayerMP) {
            EntityPlayerMP entityPlayerMP = (EntityPlayerMP)player;
            return entityPlayerMP.interactionManager.isCreative();
        }
        return false;
    }

    @Override
    public boolean isDedicatedServer()
    {
        return true;
    }

}

 

In term of workspace, I'm working with Intellij Community 2019, and Forge 1.12.2-14.23.5.2838
Attached is the full crash log, and my working folder.
If anybody spot something that is wrong, or have an idea of why this is happening, please feel free to respond, and thanks for the help!

idea64_2019-06-14_20-15-11.png

crash.txt

Edited by WORMSTweaker
Solved
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.