private void addBranches(CustomObjectCoordinate coordObject, int depth) {
    for (Branch branch : getBranches(coordObject.getObject(), coordObject.getRotation())) {
      CustomObjectCoordinate childCoordObject =
          branch.toCustomObjectCoordinate(
              world, random, coordObject.getX(), coordObject.getY(), coordObject.getZ());

      // Don't add null objects
      if (childCoordObject == null) {
        continue;
      }

      // Add this object to the chunk
      addToSpawnList(childCoordObject);

      // Also add the branches of this object
      if (depth < maxBranchDepth) {
        addBranches(childCoordObject, depth + 1);
      }
    }
  }