Jump to content

Entity not rendering in client proxy works in init, but crashes for SMP


Recommended Posts

Posted

Hello I am new to forge modding but am starting to get the hang of things.

I have created a throw able entity, but it rendered as a white cube, so I added a

RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg))

To my client proxy in a void that overrides the server/common proxy. However, this did nothing.

Then I moved that line into the initialization event in my main mod class, and it worked!

but, now it does not work in SMP as the server crashes because it tries to load the renderers for the server too.

Obviously this is what the ClientProxy  is for, but mine doesn't seem to be working if it worked in my main init event and not in there.

 

In my main mod class I have the @SideProxy set up

@SidedProxy(clientSide="aggurai.throwcraft.client.TCClientProxy", serverSide="aggurai.throwcraft.common.TCCommonProxy")
public static TCCommonProxy proxy;

 

And the Common/Server proxy

package aggurai.throwcraft.common;

public class TCCommonProxy {

public void registerRenderThings() {
	// TODO Auto-generated method stub
	//lol
}

}

 

And the client proxy that I tried rendering the entity in, and want to be able to render it in

package aggurai.throwcraft.client;

import net.minecraft.client.renderer.entity.RenderSnowball;
import aggurai.throwcraft.ThrowCraft;
import aggurai.throwcraft.common.TCCommonProxy;
import aggurai.throwcraft.entity.BaseEntity;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class TCClientProxy extends TCCommonProxy {

@Override
public void registerRenderThings()
{
	RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg)); 
}

}

 

If you could help that would be amazing! I know its probably a really simple mistake, if you need any more info let me know and I will give it to you.

Posted

Can we see the crash log?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Here is the crash of the server, only if I have the render code in Init:

 

  Reveal hidden contents

 

 

But it shouldn't have to be in init, I need it to work in my ClientProxy so i don't get the server error from the server trying to access the renderers

Posted

I should also add, I just tried adding the render code to one of my @SideOnly(Side.CLIENT) voids inside the actual item class, and that works on SMP too, however I really need to get the client proxy working instead of doing it this way

Posted

You need a EntityRegistry.registerModEntity call.

 

Example:

 

EntityRegistry.registerModEntity(EntityMyEnt.class, "MyEntity", 1, this, 350, 5, false);

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.

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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