#Create some noise
heightmap = Perlin(seed=0, frequency=48, levels=2)
#All constructors for worlds need to look like this
def constructor(seed as int, blockgen as IBlockLookup):
Lookup = blockgen
#This method will retrieve a block at a given (x,y,z) coordinate
def GetBlock(x as int, y as int, z as int) as IBlock:
height = heightmap.GetValue(x, y, min=0, max=32)
#If z < lvl, then that mean's that the block we're checking is in the ground
if z < height:
return Lookup.GetBlock[of Grass]()
#If all else fails, we know that we must be in Air, so return EmptyBlock
return Lookup.EmptyBlock