Jump to content

Recommended Posts

Posted

Hi guys I hope you can help me with some update-issues caused by deprecated code, etc.

 

1st issue:

The easiest. The method EntityLiving#getMaxHealth() seems to has been removed. How do I do that now?

 

2nd issue:

"The type RenderMinedom must implement the inherited abstract method Render.func_110775_a(Entity)". I don't know what this is there for...  has the texture-variable been removed? What should I return? (ofc a ResourceLocation but what exactly is this?)

 

3rd issue:

The method Item#getDamageVsEntity() is now deprecated. I loved how this worked and stuff... is this now meant to be decided at the entity only?

 

I hope I get some feedback on how to upgrade my mod to the current version of forge. Thanks, community, in advance.

Me

 

Posted

EntityLivingBase::func_110138_aP() should be what you're searching for.

Ohhh man, this method is final. Hm, I think looking into Zombie or Skeleton should give me some hints.

A ResourceLocation is basically what the name says. A wrapper class around the location of any kind of resource. Most of the times you just create on for each texture (new ResourceLocation(PathToTexture)). Store that in some field in your Render class and return it.

So normally I check for the class of the entity given and hand back the right location? I guess that would be how it's meant to work but I set the textures manually later on. Do you know if it would throw an exception if I return null?

It's deprecated because there is no real place to hook into this anymore since 1.6 introduced the Attribute system. You probably want to override func_111205_h in your Item class and take a look at the ItemSword class how it handles it's damage value.

Attribute system? Can you explain that a little bit more, please? It's just that I returned different damage values if it was an entity written by myself (they have ~2000 life so can't slay them with a normal sword).

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.