private boolean killTree(EntityPlayer player, int x, int y, int z)
{
Queue<Vector3> killList = new LinkedList<Vector3>();
killList.add(new Vector3(x, y, z));
Vector3 currentBlock;
while (killList.size() > 0)
{
currentBlock = killList.remove();
Block block = player.worldObj.getBlock(currentBlock.x(), currentBlock.y(), currentBlock.z());
int damage = player.worldObj.getBlockMetadata(currentBlock.x(), currentBlock.y(), currentBlock.z());
String blockType = OreDictionary.getOreName(OreDictionary.getOreID(new ItemStack(block, 1, damage)));
// shorten the coords
int x1 = currentBlock.x();
int y1 = currentBlock.y();
int z1 = currentBlock.z();
if (blockType.equals("logWood") || blockType.equals("treeLeaves"))
{
// Add extra blocks to the list
killList.add(new Vector3(x1, y1 + 1, z1));
killList.add(new Vector3(x1, y1 - 1, z1));
killList.add(new Vector3(x1 + 1, y1, z1));
killList.add(new Vector3(x1 - 1, y1, z1));
killList.add(new Vector3(x1, y1, z1 + 1));
killList.add(new Vector3(x1, y1, z1 - 1));
// Remove the block
player.worldObj.setBlockToAir(x1, y1, z1);
}
}