Posted June 23, 201510 yr I currently have a 1.8 mod that has working slabs for all the colors of the existing hardened stained clay blocks. I am wondering if there are any suggestions on a better way to handle the class creation and block state files for color variations of blocks? Right now the mod has an Item, Slab, Half Slab and Double Slab class for each color which is 4 classes x 16 blocks. I also have a large mass of asset files for the rending. I could simply copy the same code to create the planned stained glass slabs, but wanted to see if there are any recommended approaches or suggestions. Thanks for any insight.
June 24, 201510 yr Why do you even have class-per block? To have block instance you don't need whole damn class for it. Suggestion: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe03_block_variants Have one block with metadata, if not even 1 block, still - ONE class. Not milions. Better suggestion: You kinda seem like you don't know how to properly use java. I mean - class-per-instance is either bad design or lack of knowlegde. Therefore - consider reading more on it. 1.7.10 is no longer supported by forge, you are on your own.
June 24, 201510 yr Author Thank you for the link. Honestly, it is bad design. The good news is I'm aware of it, the bad news is the reasoning below. I have tried to avoid using metadata outside of the absolute need for it to create slab/double slabs. During upgrades you can still manually edit the level.dat if there are block id issues, which I had to perform for the last 1.6 to 1.7 update to keep our world from Beta. Metadata isn't as easily editted outside of entities and storage. I'm also not concerned with the maximum block limit as that has continued to increase over time. To your point, it is the use of instances where I'm lacking. 16x4 classes + 16x5 rendering files for a single set of colored blocks isn't sustainable over the long run if you want to do more than one set, so I have the need to find a better way.
June 24, 201510 yr Since 1.7.X, block IDs no longer exist, so you dont need to worry about ID conflicts anymore! So you should be able to use metadata.
June 26, 201510 yr I Since 1.7.X, block IDs no longer exist, so you dont need to worry about ID conflicts anymore! So you should be able to use metadata. This is not true. Block IDs exist just like before. They are just assigned dynamically. I thought the same thing! A couple people told me that they were removed, and I didn't understand because I can still access IDs in my IDE.
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.