Under generate, just do:
boolean shouldPlace = false;
if(world.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}
if(world.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}
if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}
if(world.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
if(shouldPlace){
world.setBlock(yourBlockName); //Or whatever function to generate the block
}
Keep in mind I just did this on the fly and you WILL have to modify it a bit, but you should be able to handle that...
Another thing, the thing you're trying to do will be inherently laggy because it will likely have to run this code for EVERY block (or some constraint of blocks, like every block between y = 50 and y = 90 or whatever). This would apply to almost any solution for this though. (Unless you want the vines to only generate on your custom trees, in which case you could just make the vines generate as part of the tree and it would make about 8039x more sense then this )