Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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  :-[

Posted

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/

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.