Jump to content

[1.7.10]Rendering Entity subclasses different


enbecko

Recommended Posts

Hey guys,

 

I have an entity class and two subclasses from it.

But it seems that they are not registered correctly as they are rendering the same although two different renderers have been registered but they still render as the main class.

 

enbecko

Link to comment
Share on other sites

int id = EntityRegistry.findGlobalUniqueEntityId();
       EntityRegistry.registerModEntity(EntityTrain.class, "train", id, this, 80, 1, true);
       EntityRegistry.registerGlobalEntityID(EntityTrain.class, "train", id);

       int id3 = EntityRegistry.findGlobalUniqueEntityId();
       EntityRegistry.registerModEntity(EntityMainTrain.class, "mainTrain", id3, this, 80, 1, true);
       EntityRegistry.registerGlobalEntityID(EntityMainTrain.class, "mainTrain", id3);

       int id2 = EntityRegistry.findGlobalUniqueEntityId();
       EntityRegistry.registerModEntity(EntitySubTrain.class, "subTrain", id2, this, 80, 1, true);
       EntityRegistry.registerGlobalEntityID(EntitySubTrain.class, "subTrain", id2);

 

where EntitySubTrain and EntityMainTrain are subclasses of EntityTrain

 

The clientProxy:

 

RenderingRegistry.registerEntityRenderingHandler(EntityMainTrain.class, new RenderTrain());
RenderingRegistry.registerEntityRenderingHandler(EntitySubTrain.class, new RenderSubTrain());

 

 

EDIT:

The spawned Entity (regardless of what kind) has always the propertys of the first registered

Link to comment
Share on other sites

So it's rendering correctly now, but server and client are asynchron. While the server entity is changing its position the client one is not... I had that problem earlier and fixed it but I forgot what I did that time  :-[

Link to comment
Share on other sites

So it's rendering correctly now, but server and client are asynchron. While the server entity is changing its position the client one is not... I had that problem earlier and fixed it but I forgot what I did that time  :-[

Entity movement is a bit different then the rest of the game, as Entity movement has to be done on the client and server side, or it will be jiggly.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

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