I've got my terrain generator to working, but bad thing is it seems to not generate ground blocks and spikes even though it should.

Here are functions responsible for generating ground and spike blocks:

Code:
function TWorldGenerator._genStepGround(Chunk: TChunk): TChunk;
var chunksize,x,y:Integer;

begin
  chunksize:=Length(Chunk);
  for x:=0 to chunksize-1 do begin
    for y:=1 to chunksize-2 do begin
      //we start at Y=1 and end one index before end of chunk as we need to test block before that for being
      //air and if there is something under.
      if ((Chunk[x][y]=AIRID) and (Chunk[x][y-1]=AIRID) and (Chunk[x][y+1]=GROUNDID))
         then Chunk[x][y]:=INVINCIBLEBLOCKID;
    end;
  end;
  result:=Chunk;
end;

function TWorldGenerator._genStepTraps(Chunk: TChunk): TChunk;
var chunksize,x,y:Integer;

begin
  chunksize:=Length(Chunk);
  for x:=0 to chunksize-1 do begin
    for y:=1 to chunksize-2 do begin
      //we start at Y=1 and end one index before end of chunk as we need to test block before that for being
      //air and if there is something under.
      if ((Chunk[x][y]=AIRID) and (Chunk[x][y-1]=AIRID) and ((Chunk[x][y+1]=GROUNDID) or
         (Chunk[x][y+1]=INVINCIBLEBLOCKID)) and (Random(101)<TrapChance)) then Chunk[x][y]:=SPIKEID;
         //randomizing above is so whole ground won't be in traps.
    end;
  end;
  result:=Chunk;

end;
And here is whole world generation unit (pastebin since it is quite big): http://pastebin.com/fLFjsC8Z

ChunkUtils is simple unit that contains only function that draws circles in chunk (for carving cave - carving step happens before generating blocks and spikes, so that isn't a problem). boolUtils is unit with just one function that checks if value is between two values. Nothing too fancy. Also don't worry about functions that doesn't return values - they're just stubs and aren't implemented yet.