Jump to content

Updating Entities to 1.8.9 from 1.7.10


IronCrystal

Recommended Posts

Hello,

 

I'm sorry, but I'm having some trouble updating my entities since it appears the registration methods I used to use are deprecated.

 

I used to register my custom mob using these three methods:

 

	public static void registerEntity(){

	createEntity(EntityFlappyBird.class, "Flappy Bird", 0xE6F547, 0xFFB300);
	EntityRegistry.addSpawn(EntityFlappyBird.class, 2, 0, 1, EnumCreatureType.CREATURE, new BiomeGenBase[]{BiomeGenBase.forest}); //Add more biomes for more locations
	RenderingRegistry.registerEntityRenderingHandler(EntityFlappyBird.class, new RenderFlappyBird(new ModelFlappyBird(), 0));

}

public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor){
	int randomId = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId);
	EntityRegistry.registerModEntity(entityClass, entityName, randomId, Modcraft.INSTANCE, 64, 1, true);
	createEgg(randomId, solidColor, spotColor);
}

private static void createEgg(int randomId, int solidColor, int spotColor){
	EntityList.entityEggs.put(Integer.valueOf(randomId), new EntityList.EntityEggInfo(randomId, solidColor, spotColor));
}

 

But it seems that RenderingRegistry.registerEntityRenderingHandler(), EntityRegistry.findGlobalUniqueEntityId(), and EntityRegistry.registerGlobalEntityID() are all deprecated.

 

How would be the best way to register an entity now?

 

Edit:  I also had to edit the constructor of the render class since it now requires a RenderManager.  Any idea where that comes from?

Link to comment
Share on other sites

Thank you very much, I was able to get my mob into the game.

 

One last question, if I'm not using a method to find an unused entity ID, how would I find a unique one?  Just for testing I gave a random value but I wouldn't want it conflicting with other mods.

 

EDIT: Nevermind.  I was looking in another thread and it looks like that entity ID is unique within the mod.  So as long as I keep my own IDs separate I should be fine.

Link to comment
Share on other sites

Mod entity ids are sandboxed to your mod.  Start at 0 and go up for each mob you have.

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

Mod entity ids are sandboxed to your mod.  Start at 0 and go up for each mob you have.

 

Since I made the last post, I didn't want to spam this forum with every question I have so I'm going to add this here.

 

I know a lot of rendering was changed for blocks and items in 1.8.

 

I was using a model created in techne for an item, but now the rendering class is littered with errors.  I was using IItemRenderer but it seems to no longer exist.

 

Do I have to use json files for my held items?  If so, is there some way to easily convert the old models to the json?

 

If I am able to use my techne model, how would I do it?  Is there an example someone has?

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.