[Tutorial]Multiple Blocks on Same ID

That's because you havn't been reading the thread, it was brought to my attention that small (semi-easy to fix glitch, I'll update the code in a sec, it's only one more line in the constructor.

You mean this line? ...

if(Block.blocksList[i]!=null){ Block.blocksList[i]=null; }

And, I had sort of skimmed through the debate going on. However, I saw no mention by you (until now) that you believed there was actually a problem. Just that you were sure that your code was working as-is (at the time, before this code update).

Regardless, this new code change still does NOT work.

First off, like was said previously in this thread, the "Super Constructor" HAS TO BE CALLED FIRST. You have it listed second. But, if you nullify the value in the blocks-list after calling the super constructor, your block(s) disappear.

Plus, I can't see how initializing the blocks-list with a null value for it would have made a difference in the first place anyhow.

So, I am also at the point now where I also have to see a working example with source code provided etc.

strange, there is physically no way you will still get an error of same id used, because all that is is a check to see if the item is not equal to null. If it's not is Throws a new exception. If you set that id to null before calling the constructor there is 100% no chance of getting that error. Just saying that it doesn't work does not help, post error codes or no one will ever be able to help you.

The constructor does not need to be called first. You can find many examples (not in the minecraft source, but look around) that the superclass is called at the end or middle of the constructor, and it works, people have made programs like that.

If you can't get it to work with putting the nullification, then you can do it in between the declarations.

when I get the demo working you can look at the source and see everything I'm talking about. I may just not be explaining it good enough, so feel free to ask for more clarification.

As seeing the actual block objects are stored in your class, just the actual class of BlockTester is stored in the blocksList we can set it to null to allow us to define another block with the same id, getting the block from the blocksList will return the main instance, which then you set to it's subtype you want.

omg dude. You don't even let me comment to my own thread, I come on and there is yet another flaming. You have you're own thread that works, if you don't believe this one does then stop posting on it.

you know what, you're right, I studied the difference between 1.4 and 1.8 for how the blocks are stored and there are a few differences, one feature that was taken out was a Map object in the World class that stored the block instance based on an integer[] that contained xyz. Without that, which the most recent place I saw it was 1.6, no this will not work, buy sorry for trying to help if all I get is constant flaming and complaints by one person.

No changes to the way blocks are stored have been made since 1.3 and the only thing that was changed in that patch was to use the MCRegion format.

Ercinee seems to be one of the few persons that actually understand why this approach doesn't work. He is not the one saying "I have a working example up and running in a few seconds" and then having to admit that his solution didn't work in the first place.

First off I said I would try to recreate the code I had before, I didn't say anything about a time limit at all, in fact that tutorial took me a while to write (3 days of constant, save, load, edit, save, load, edit, save, load, edit) It happens that someone asked the question on the day I ended up finishing it. While doing that I realized a few differences between the version I did it before and the current one. I am not fooling anyone, I am asking for this thread to be closed or deleted because I have seen the difference and I don't want people reading this anymore if it does not work. So if this does not work stop posting a million posts on it and just bumping it up to top spot constantly.