Jump to content

Recommended Posts

Posted

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).

Posted

You've not seen my code, have you. It's not quite in Notch's league, but it's not the most readable you'll come across either.

Oh dear.

Posted

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.

Posted

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". ;-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...