Remove Trees from a Chunk

Discussion in 'Spigot Plugin Development' started by Ukrainian_Reaper, May 29, 2015.

  1. I'm working on custom terrain generation by editing previously generated chunks and I can't think of an efficient way of removing trees. My current algorithm is that once i've found a log, I recursively check all the blocks around it removing them if they are a log or leaves with a base case being if that block is air. If the the conditions are reached (a block is removed) the method is called again incrementing the location in every direction(to insure trees that dont just grow straight up are accounted for). I'm concerned that this will simply take to long considering that some chunks are literally all trees. Has anyone written methods for removing whole trees before? or have any suggestions?


    Thanks!