This is for checking the block's oredict and destroying it if it is wood. This will allow your giant to work with every type of tree.
See this if loop thingy?
if (block != Blocks.COMMAND_BLOCK && block != Blocks.REPEATING_COMMAND_BLOCK && block != Blocks.CHAIN_COMMAND_BLOCK && block != Blocks.IRON_BARS && block != Blocks.END_GATEWAY)
{
flag1 = this.world.setBlockToAir(blockpos) || flag1;
}
else
{
flag = true;
}
Locate it in your code and change the condition to match your need.
Personally, I would discourage copying from vanilla in this case, as the code you copied can be rewritten to better fit your needs.