Jump to content

Get an item with a particular ID, regardless of what that item actually is


Recommended Posts

Block.blocksList and Item.itemsList are the arrays which contain all references to blocks and items in the game, and are what is checked when the ID from a block or itemstack is used.

Remember that itemsList would be shifted up by 256 because the first 256 IDs are shared by blocks (because a block on the ground and a block in your inventory have the same ID).

Link to comment
Share on other sites

I've just got into a few bad habits because of an exam that I have to do. The code we've been given to work on is ugly as anything you've ever seen and we can't just strip it all out and start from scratch, which would be so much easier and more efficient. My usual style is (I think/hope) pretty good. It should be okay in a month or two after I've been able to weed out any clingy bits of awful.

Link to comment
Share on other sites

Well, my style is so spread-out and deliberate that it gives a lot of people (including my professors, back when I went to university) a case of hives, so if you ever find yourself trying to make your code more readable and structured, my code would be a good reference point to say "if it looks like this, you have gone way too far; back up a bit". ;-)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...