Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Minecraft Server fail to load [1.10.2]

Featured Replies

Posted

Hello guy,

I started programming mod very recently and i'm facing a problem with the port of my mod on server.
Many peoples told that the mod is nowaday universal and works both on client and on server.
However, the server refuse tu start because of java.lang.NoSuchMethodError on my registerRender() method.

I specify i put the   " @SideOnly(Side.CLIENT)" before but nothing change.

I hope you can help me and thank you

error_eclipse.txt

There is a section for modder support, it would probably be better if you posted there:

http://www.minecraftforge.net/forum/forum/70-modder-support/

 

As for your problem, it's difficult to help you without being able to see your actual code. But from what I'm getting you need to use proxies:

https://mcforge.readthedocs.io/en/latest/concepts/sides/

A common use case is to register renderers and models, something which must be called from the main initialization methods preInit, init, or postInit. However, many rendering related classes and registries are not present on the physical server and may crash it. Therefore, we put these actions into the client proxy, ensuring that they will always execute for the physical client.

 

Here is what I do:

My @Mod class:

https://github.com/Kriptikz/Archmage/blob/1.11.2/src/main/java/kriptikz/archmage/Archmage.java

 

My ClientProxy where I register renders for Entities:

https://github.com/Kriptikz/Archmage/blob/1.11.2/src/main/java/kriptikz/archmage/proxy/ClientProxy.java#L29

The problem is when you call new ModItems(); in your common proxy preInit. Which ofc calls the constructor you made in ModItems() which calls initItems(); registerItems(); and registerRenders();  which means your calling registerRenders() in your common proxy preInit. You can only register renders on the client, so this method should only be called in your client proxy. I explain the steps to fix up your code below:

 

First get rid of this constructor:

https://github.com/TheCaliban/CaliArmor/blob/master/src/main/java/com/mod/CaliArmor/init/ModItems.java#L29-L34

 

And make all your methods in ModItems static.

 

Then instead of creating an instance here:

https://github.com/TheCaliban/CaliArmor/blob/master/src/main/java/com/mod/CaliArmor/proxy/CommonProxy.java#L9

 

do this:

public class CommonProxy
{
	public void preInit()
	{
        // Get rid of this, as methods should be all static now
        //new ModItems();

        // initialize items
        ModItems.initItems();

        // register items
        ModItems.registerItems();
      
	}
	public void Init()
	{
		new ModRecipes().registerCraftRecipes();
		new ModRecipes().registerFurnaceRecipes();
		new ModRecipes().registerBrewingRecipes();
	}
}

 

Then for your ClientProxy:

public class ClientProxy extends CommonProxy
{
	@Override
	public void preInit()
	{
            super.preInit();
        
            // register renders
            ModItems.registerRenders();
	}
	@Override
	public void Init()
	{
		super.Init();
	}
}

 

Edited by Kriptikz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.