@Override
    public void actionPerformed(ActionEvent e)
    {
        Object s = e.getSource();
        if (s == previewButton)
        {
            WorldGenerator wg = new WorldGenerator(p.getOutput().output);

            WorldPreviewer wp = new WorldPreviewer();
            wg.addChunkOutput(wp);

            JFrame fr = new JFrame("Minecraft Protos Previewer");
            fr.setSize(500, 500);
            fr.add(wp, BorderLayout.CENTER);
            fr.setVisible(true);

            //Don't remove this or very bad things will happen
            fr.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

            wg.runInThread();
        }
        else if (s == previewBiomesButton)
        {
            BiomeFunction f = p.getOutput().biome;
            new BiomePreviewerFrame(f).setVisible(true);
        }
        else if (s == generateButton)
        {
            WorldGenerator wg = new WorldGenerator(p.getOutput().output);

            DiskChunkOutput out = new DiskChunkOutput(new File("./generated-map/"));
            wg.addChunkOutput(out);

            ProgressFrame pf = new ProgressFrame();
            pf.setVisible(true);
            wg.addProgressListener(pf);

            wg.runInThread();
        }
    }