Jump to content

registerGlobalEntityID vs registerModEntity


flaminyogurt

Recommended Posts

Can someone explain to me the difference between to two methods listed in the title? When to use each one, and why each one is called? The both seem to do similar things, Ive looked at the forge code and the methods are different. I am confused as too what each one is used for and which one or both should be used to register entities properly. Also when to use findGlobalUniqueEntityID to find the id. The only code Ive been able to find either used one, both of the register methods and only sometimes uses the findGlobalUniqueEntityID method. What is the correct or at least most conventionally proper way to register an entity?

Link to comment
Share on other sites

You shouldn't need the first one.  There's very little reason (if any) to have a global ID.

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

Due to an integer overflow error that Mojang won't fix, the globalEntityID has a very limited range of values. Which is why findGlobalUniqueEntityID was implemented (by ModLoader i presume?) to avoid conflict between such IDs.

 

registerModEntity is implemented by Forge to deal with both issues at once. With this you don't need to care about conflicting id, as it uses internal id, and each mod has 256 of them, thus not very "limited". As a bonus, you also have more control over tracking range and such.

In conclusion:

Use registerModEntity. It is a lot better.

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