Jump to content

[1.9] registerItem is deprecated?


Cerandior

Recommended Posts

Hello guys, i was just checking on 1.9 to figure out what's changed and what is not. Apparently, GameRegistry.registerItems is deprecated. Did forge add a new method to register items on 1.9? It seems that using registerItems won't have any effect on the game.

 

33ze5ac.png

Link to comment
Share on other sites

The doc comments of the deprecated methods tell you which method to use now.

 

I explain how to register items and their models in 1.9 here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I hope you don't mid that i am completely copying your way of registering items at the time. I may come up with something that fits my style later, but anyway, after having a look at your method, I am still not having results. Apparently no item is being registered. Any clue at why this is isn't working?

 

dzlhf.png

Link to comment
Share on other sites

Put a breakpoint in the

registerItem

method and run Minecraft in debug mode. Is the breakpoint hit? Are you getting any errors in the log?

 

Upload your item registration class and an individual item class to Gist or Pastebin with syntax highlighting and link them here. Screenshots are a terrible way to share code.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

To be honest, i have no idea why i was making a screenshot of the class there.

 

Here is the class in which the registration takes place: https://gist.github.com/Cerandior/cc144805c4fd4843b7bf5f24024b28c2

 

"RegisterItems" is being called in the preInit method at the main mod class.

 

Here is a random item class: https://gist.github.com/Cerandior/96d2d15a23eb23897c77e926de78dc8c

 

I will put the breakpoint and post results in a minute.

 

EDIT: The breakpoint is not being hit at all!

Link to comment
Share on other sites

Post your

@Mod

class.

 

So, this is embarrassing. I had forgotten to put the "EventHandler" annotation above preInit, Init and postInit methods. Sorry, i setup things pretty quickly, kinda weird that i forgot that actually. I appreciate that you took the time to help me :)

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.