Does anyone know the easiest way to add custom blocks?
For example, I'd like a custom block which will show as admincrete when placed, but no matter what I try I always get the "An item with the same key has already been added" exception.
Thanks!
Adding custom blocks
Adding custom blocks
You cannot use certain BBCodes: [img].
Re: Adding custom blocks
There is no easy way. Some previous discussion
Re: Adding custom blocks
Ah ok, I didn't consider that. Thanks anyway
You cannot use certain BBCodes: [img].
Re: Adding custom blocks
You can do it, if you don't care about degrading performance somewhat. E.g. MCSharp forks all copy and convert the entire map before sending, and they're still usable.
Also the specific "An item with the same key has already been added" exception is probably from Map's static constructor, that creates a list of block name aliases. Make sure that your block does not have the same ID as any other block (which is possible with enums), and that there is no overlap between alias names and block names.
Also - if you're going to do physics the MCSharp/MCZall/MCLawl way, be prepared for looooong ugly switch() chains.
Also the specific "An item with the same key has already been added" exception is probably from Map's static constructor, that creates a list of block name aliases. Make sure that your block does not have the same ID as any other block (which is possible with enums), and that there is no overlap between alias names and block names.
Also - if you're going to do physics the MCSharp/MCZall/MCLawl way, be prepared for looooong ugly switch() chains.
Re: Adding custom blocks
Thanks for the help, I'll probably just stick to using collections. Wow that's some ugly stuff! I've pretty much done physics, I wanted a custom block for water / lava physics so it'll be easy to unflood the physics without having to use a < 17 million block collection to identify what is water damage and what was already on the map.
Yesterday I thought about adding redstone and having a custom block for that, then I realized that there's nothing for redstone to interact with :/ haha
Yesterday I thought about adding redstone and having a custom block for that, then I realized that there's nothing for redstone to interact with :/ haha
You cannot use certain BBCodes: [img].
Re: Adding custom blocks
Take a look how I did physics in FemtoCraft, I tried making it as efficient as I could.