how could it be less typing? for the other dimension you just need to create additional loops around it, so less than 10 lines of code.
However, if you're really lazy there might be some fill methods available somewhere. For example the StructureComponent class has a fillWithBlocks() method but it is protected scope so really only used for structures. If you look at the code in that method it is pretty much same as what you're writing.