// Path: src/com/wasteofplastic/askygrid/Settings.java
// public class Settings {
//     // Permission prefix
//     public final static String PERMPREFIX = "askygrid.";
//     // The island command
//     public final static String ISLANDCOMMAND = "asg";
//     // The challenge command
//     public static final String CHALLENGECOMMAND = "asgc";
//     // The spawn command (Essentials spawn for example)
//     public final static String SPAWNCOMMAND = "spawn";
//     // Admin command
//     public static final String ADMINCOMMAND = "asgadmin";
//    
//     public static Set<String> challengeList;
//     public static int waiverAmount;
//     public static List<String> challengeLevels;
//     public static String worldName;
//     public static int monsterSpawnLimit;
//     public static int animalSpawnLimit;
//     public static int waterAnimalSpawnLimit;
//     // IslandGuard settings
//     public static boolean allowPvP;
//     public static int spawnDistance;
//     public static int islandXOffset;
//     public static int islandZOffset;
//     public static int claim_protectionRange;
//     public static Double startingMoney;
//     public static boolean resetMoney;
// 
//     // public static boolean ultraSafeBoats;
//     public static boolean logInRemoveMobs;
//     public static boolean removeMobs;
// 
//     // Challenge completion broadcast
//     public static boolean broadcastMessages;
//     // Nether world
//     public static boolean createNether;
//     public static boolean clearInventory;
//     // Use control panel for /island
//     public static boolean useControlPanel;
//     // Prevent /island when falling
//     public static boolean allowTeleportWhenFalling;
//    // Challenges - show or remove completed on-time challenges
//     public static boolean removeCompleteOntimeChallenges;
//     public static boolean addCompletedGlow;
// 
//     // Use Economy
//     public static boolean useEconomy;
// 
//     // Use physics when pasting schematic blocks
//     public static boolean usePhysics;
// 
//     // Falling blocked commands
//     public static List<String> fallingCommandBlockList;
//     public static boolean resetEnderChest;
//     public static boolean updateCheck;
//     public static long islandStartX;
//     public static long islandStartZ;
//     public static boolean allowNetherPvP;
//     public static int maxHomes;
//     public static boolean immediateTeleport;
//     public static int debug;
//     public static boolean respawnAtHome;
//     public static boolean restrictWither;
//     public static List<String> startCommands;
//     public static boolean useWarpPanel;
//     public static List<EntityType> mobWhiteList = new ArrayList<EntityType>();
//     public static boolean muteDeathMessages;
//     public static boolean allowFireSpread;
//     public static int gridHeight;
//     public static boolean allowBreakBlocks;
//     public static boolean allowPlaceBlocks;
//     public static boolean allowBedUse;
//     public static boolean allowBucketUse;
//     public static boolean allowShearing;
//     public static boolean allowEnderPearls;
//     public static boolean allowDoorUse;
//     public static boolean allowLeverButtonUse;
//     public static boolean allowCropTrample;
//     public static boolean allowChestAccess;
//     public static boolean allowFurnaceUse;
//     public static boolean allowRedStone;
//     public static boolean allowMusic;
//     public static boolean allowCrafting;
//     public static boolean allowBrewing;
//     public static boolean allowGateUse;
//     public static boolean allowMobHarm;
//     public static boolean allowFlowIn;
//     public static boolean allowFlowOut;
//     public static int spawnHeight;
//     public static boolean allowTNTDamage;
//     public static boolean allowChestDamage;
//     public static List<String> bannedCommandList;
//     
//     
//     public static boolean allowHorseInvAccess;
//     public static boolean createEnd;
//     public static double endPortalProb;
//     public static long spawnCenterX;
//     public static long spawnCenterZ;
//     public static boolean allowFallDamage;
//     public static boolean createBiomes;
//     public static boolean growTrees;
//     public static Sound warpSound;
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import com.wasteofplastic.askygrid.Settings;
package com.wasteofplastic.askygrid.generators;




public class SkyGridGen extends ChunkGenerator {
    // Blocks that need to be placed on dirt
    private final static List<Material> needDirt = Arrays.asList(Material.SAPLING, Material.RED_MUSHROOM, Material.BROWN_MUSHROOM,
	    Material.SUGAR_CANE_BLOCK, Material.LONG_GRASS, Material.DEAD_BUSH, Material.YELLOW_FLOWER, Material.RED_ROSE, Material.DOUBLE_PLANT);

    @Override
    public byte[][] generateBlockSections(World world, Random random, int chunkx, int chunkz, BiomeGrid biomeGrid) {
	BiomeGenerator biomeGenerator = new BiomeGenerator(world);
	// Default block
	Material blockMat = Material.AIR;
	// This gets all the blocks that can be picked and their probabilities
	BlockProbability prob = WorldStyles.get(world.getEnvironment()).getProb();
	// Biomes
	// Settings.createBiomes
	//int noise = (int)Math.floor(voronoi.noise(chunkx, chunkz, 1) * Biome.values().length);
	//Bukkit.getLogger().info("DEBUG: " + noise + " biome = " + Biome.values()[noise]);


	// The chunk we are making
	byte[][] chunk = new byte[world.getMaxHeight() / 16][];
// Path: src/com/wasteofplastic/askygrid/Settings.java
// public class Settings {
//     // Permission prefix
//     public final static String PERMPREFIX = "askygrid.";
//     // The island command
//     public final static String ISLANDCOMMAND = "asg";
//     // The challenge command
//     public static final String CHALLENGECOMMAND = "asgc";
//     // The spawn command (Essentials spawn for example)
//     public final static String SPAWNCOMMAND = "spawn";
//     // Admin command
//     public static final String ADMINCOMMAND = "asgadmin";
//    
//     public static Set<String> challengeList;
//     public static int waiverAmount;
//     public static List<String> challengeLevels;
//     public static String worldName;
//     public static int monsterSpawnLimit;
//     public static int animalSpawnLimit;
//     public static int waterAnimalSpawnLimit;
//     // IslandGuard settings
//     public static boolean allowPvP;
//     public static int spawnDistance;
//     public static int islandXOffset;
//     public static int islandZOffset;
//     public static int claim_protectionRange;
//     public static Double startingMoney;
//     public static boolean resetMoney;
// 
//     // public static boolean ultraSafeBoats;
//     public static boolean logInRemoveMobs;
//     public static boolean removeMobs;
// 
//     // Challenge completion broadcast
//     public static boolean broadcastMessages;
//     // Nether world
//     public static boolean createNether;
//     public static boolean clearInventory;
//     // Use control panel for /island
//     public static boolean useControlPanel;
//     // Prevent /island when falling
//     public static boolean allowTeleportWhenFalling;
//    // Challenges - show or remove completed on-time challenges
//     public static boolean removeCompleteOntimeChallenges;
//     public static boolean addCompletedGlow;
// 
//     // Use Economy
//     public static boolean useEconomy;
// 
//     // Use physics when pasting schematic blocks
//     public static boolean usePhysics;
// 
//     // Falling blocked commands
//     public static List<String> fallingCommandBlockList;
//     public static boolean resetEnderChest;
//     public static boolean updateCheck;
//     public static long islandStartX;
//     public static long islandStartZ;
//     public static boolean allowNetherPvP;
//     public static int maxHomes;
//     public static boolean immediateTeleport;
//     public static int debug;
//     public static boolean respawnAtHome;
//     public static boolean restrictWither;
//     public static List<String> startCommands;
//     public static boolean useWarpPanel;
//     public static List<EntityType> mobWhiteList = new ArrayList<EntityType>();
//     public static boolean muteDeathMessages;
//     public static boolean allowFireSpread;
//     public static int gridHeight;
//     public static boolean allowBreakBlocks;
//     public static boolean allowPlaceBlocks;
//     public static boolean allowBedUse;
//     public static boolean allowBucketUse;
//     public static boolean allowShearing;
//     public static boolean allowEnderPearls;
//     public static boolean allowDoorUse;
//     public static boolean allowLeverButtonUse;
//     public static boolean allowCropTrample;
//     public static boolean allowChestAccess;
//     public static boolean allowFurnaceUse;
//     public static boolean allowRedStone;
//     public static boolean allowMusic;
//     public static boolean allowCrafting;
//     public static boolean allowBrewing;
//     public static boolean allowGateUse;
//     public static boolean allowMobHarm;
//     public static boolean allowFlowIn;
//     public static boolean allowFlowOut;
//     public static int spawnHeight;
//     public static boolean allowTNTDamage;
//     public static boolean allowChestDamage;
//     public static List<String> bannedCommandList;
//     
//     
//     public static boolean allowHorseInvAccess;
//     public static boolean createEnd;
//     public static double endPortalProb;
//     public static long spawnCenterX;
//     public static long spawnCenterZ;
//     public static boolean allowFallDamage;
//     public static boolean createBiomes;
//     public static boolean growTrees;
//     public static Sound warpSound;
// }


// Path: src/com/wasteofplastic/askygrid/generators/SkyGridGen.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import com.wasteofplastic.askygrid.Settings;

package com.wasteofplastic.askygrid.generators;




public class SkyGridGen extends ChunkGenerator {
    // Blocks that need to be placed on dirt
    private final static List<Material> needDirt = Arrays.asList(Material.SAPLING, Material.RED_MUSHROOM, Material.BROWN_MUSHROOM,
	    Material.SUGAR_CANE_BLOCK, Material.LONG_GRASS, Material.DEAD_BUSH, Material.YELLOW_FLOWER, Material.RED_ROSE, Material.DOUBLE_PLANT);

    @Override
    public byte[][] generateBlockSections(World world, Random random, int chunkx, int chunkz, BiomeGrid biomeGrid) {
	BiomeGenerator biomeGenerator = new BiomeGenerator(world);
	// Default block
	Material blockMat = Material.AIR;
	// This gets all the blocks that can be picked and their probabilities
	BlockProbability prob = WorldStyles.get(world.getEnvironment()).getProb();
	// Biomes
	// Settings.createBiomes
	//int noise = (int)Math.floor(voronoi.noise(chunkx, chunkz, 1) * Biome.values().length);
	//Bukkit.getLogger().info("DEBUG: " + noise + " biome = " + Biome.values()[noise]);


	// The chunk we are making
	byte[][] chunk = new byte[world.getMaxHeight() / 16][];
	if (Settings.createBiomes && world.getEnvironment().equals(Environment.NORMAL)) {