battlefield Posted September 1, 2012 Posted September 1, 2012 After updating my mod from 1.3.1 to 1.3.2 I can't see my entities in the world even though I can hear them and spawn them with spawning eggs. Anyone else having similar problems? I know it's more of a minecraft problem than a forge problem but still this is a forum on which modders are mostly active. Before asking have you registered the entity inside EntityRegistry and it's render inside RenderingRegistry, yes I did that and I double checked it or asking if I have textures on their apropriate spots, yes I have but even If I wouldn't have them I could see the shadow of that entity. I have allso perfomed some quick tests and it seems like my entity wouldn't even be passed into the loaded entities list. Quote
SanAndreaP Posted September 1, 2012 Posted September 1, 2012 the question is here: HOW did you register your entities? A piece of your code would be very helpful then. Quote 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.
battlefield Posted September 2, 2012 Author Posted September 2, 2012 I registered them in my core class(the initialize method gets called from load method), what I posted are just snippets of the code Reveal hidden contents public void initialize() { EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42)); } This method gets called from ClientProxy Reveal hidden contents public void initializeRenders() { RenderingRegistry.registerEntityRenderingHandler(DartEntity.class, new DartRender()); } Quote
SanAndreaP Posted September 2, 2012 Posted September 2, 2012 Then you're registering them wrong, at least the first one: EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42)); You have to use these methods to register your entity properly: EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates); so I would say in your case: EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true); The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on. Quote 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.
battlefield Posted September 2, 2012 Author Posted September 2, 2012 Thank you very much, I didn't know I have to make that call aswell. Quote
juliand665 Posted May 9, 2013 Posted May 9, 2013 On 9/2/2012 at 9:22 AM, SanAndreasP said: Then you're registering them wrong, at least the first one: EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42)); You have to use these methods to register your entity properly: EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates); so I would say in your case: EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true); The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on. Wow, thanks! This really helped me c: Quote
SanAndreaP Posted May 9, 2013 Posted May 9, 2013 On 5/9/2013 at 1:31 PM, juliand665 said: Quote Then you're registering them wrong, at least the first one: EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42)); You have to use these methods to register your entity properly: EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates); so I would say in your case: EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true); The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on. Wow, thanks! This really helped me c: heh, it's like a bit outdated Anyway, you need only the registerModEntity now. The registerGlobalEntityID isn't needed anymore and also I don't recommend to use it, because it has an ID limitation of max. 256 IDs. Quote 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.
Recommended Posts
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.