Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12.2] Model not loading in server


Recommended Posts

I've created a mod over the past week that includes a racecar-like model in the game, and works just like a boat: There is an item that you use to spawn in an instance of the model. Yesterday I decided to test it with an FTB server (where it will ultimately end up), and I got a NoClassDefException, related to the RenderHandler class in my mod. I solved this by putting @SideOnly annotations almost indiscriminately within the project, and moving RegistryHandler.preInitRegistries(); from the main class preInit, to the ClientProxy preInit.

Now, the mod loads in fine to the server (no complaints in the server console), and a client can access the items. However, a model does not spawn in if they use the item. Why is this? I've only made mods focused on offline use, so I'm not well experienced in making a mod server-friendly. The source can be found here, if you wish to dig around in it:


Link to comment
Share on other sites

Ok, so, 1:


Your main mod file does dick. Nothing in your mod should work at all, as no items, blocks, or entities are created or models registered. Some of this is handled via your registry event handler.



Even if you called this method in your proxy, the server has no idea that your items or entities exist because this method only does stuff on the client.



This method does not appear to be called from anywhere.



Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

1. Yeah, the RegistryHandler is basically the meat and potatoes here. As you saw, the main mod class used to call the RegistryHandler method, but I moved that to ClientProxy.

2. I am aware that the server's proxy doesn't do anything, but the NoClassDefException I got earlier led me to believe that registering models was only done client-side, which I'm beginning to think is the wrong way of thinking.

3. That method is called in util/handlers/RegistryHandler.preInitRegistries() Wait a minute I think I just realized, registerEntityRenders isn't called anywhere anymore. Should I put proxy.preInitRegistries() in the main mod's preInit method?

The mod works fine in the development environment, I've tested it that far. It's just getting it to work on a server that I'm not sure about.

Edited by jonesto95
Link to comment
Share on other sites

  • ModelRegistryEvent is a client-only event. You cannot reference it from a common class.
  • Everything in RenderHandler is also client-only (RenderingRegistry), you cannot reference RenderHandler from a common class.
  • Why is your server-side proxy called CommonProxy? And why does your client-side proxy class extend it?
  • The method preInitRegistries in your proxy is not called from anywhere, therefor you never register your entities or their renderers.
  • Why are you (attempting to) register your entities from your client-side proxy? Entities must be registered on both sides.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.