Jump to content

[1.10.2] How to change ItemStack item?


yooksi

Recommended Posts

I found out that deprecated does not mean do not use. Deprecated rather means more like "i'd rather you not use it but if you have to go then go ahead."

 

In my code I have a block which has multi textures and FACING so orientation matters. One of the functions there      getStateFromMeta(int meta) is marked as deprecated.

 

@Deprecated

    public IBlockState getStateFromMeta(int meta)

    {

        return this.getDefaultState();

    }

 

Now if you don't use this function the block resets position every time you reload the game so in this case is deprecated but YOU HAVE TO USE IT. So what do I do? I use it. There's no other way :D

 

Point is if it says deprecated is because original MC team are trying to move away from this function so expect it to go away in the future but doesn't mean you can't use it now.

 

Makes sense, but if it's going to go away in the future, isn't it better to avoid using it before your code gets so dependent on it that it requires a complete rewrite to make it compliant to the new changes?

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

Link to comment
Share on other sites

Mojang uses @Deprecated to mark methods you, as a modder, shouldn't call yourself but rather another version e.g. one in

IBlockState

. You are still able to override those methods.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.