Logging removed in rev 1205. I don't think any logging is necessary at all, so I removed it altogether. Also the function doesn't modify the object, so I made it const.
Wow, I'm good. I've added cBlockArea:Merge(), the dream function of all world generating plugin writers. It can combine two block areas using different strategies: overwriting everything, overwriting only air and overwriting only with non-air blocks. So finally we can have tree images in schematic files, load them up when generating and merge them onto the generated terrain.
The best thing is, it's made using templates, so the compiler actually inlines the combinator functions, making the operation quite fast. Without templates it would have meant hundreds of lines of code more if I wanted to have it inline. I think this piece of code is going to be one of my favorite "gems".
Theoretically, yes. You still need a plugin or generator that will do the actual pasting, but now the API is complete enough for it to work.
You could also use it for parts - have the generator make a jungle tree trunk with the top, then attach the "branches" at random positions, loading each branch from a schematic file. I think that's how I'll eventually implement it in the generator. It means less schematics for a larger range of different trees. I believe it's also how vanilla does jungle trees.
02-16-2013, 08:11 AM (This post was last modified: 02-16-2013, 08:16 AM by xoft.)
Your function signatures are wrong (console handlers DON'T get a Player parameter - there's no player at the console), you're using tabs for alignment instead of spaces and you broke the alphasorting. Fix that and your code goes in
The problem is that we're calling all blocks in their item forms as E_ITEM_
So if you mine E_BLOCK_IRON_ORE, you get E_ITEM_IRON_ORE pickup and in the E_ITEM_IRON_ORE in your inventory.
And when you place an E_ITEM_RED_FLOWER, you created an E_BLOCK_RED_FLOWER block.
Real problem is, these symbols get exported to Lua, so they're part of the API and plugins may already be using them. Are you willing to break plugins because of this change?
02-16-2013, 08:33 PM (This post was last modified: 02-16-2013, 09:09 PM by xoft.)
I'm more inclined to remove *all* item defs from E_ITEM_STONE to E_ITEM_EMERALD_BLOCK (those that represent blocks in inventory, <256), you can use their E_BLOCK equivalents. This might break some of the plugins, but it's a reasonable change and plugins will adapt in time.
Yeah, I'll do that, at last we'll get rid of all the deprecated block and item names, such as WHITE_CLOTH.