package musician101.controlcreativemode;

import java.io.File;
import java.util.List;

import org.bukkit.configuration.file.FileConfiguration;

public class Config
{
	ControlCreativeMode plugin;
	public static boolean blockLavaBucket;
	public static boolean blockTNTMinecart;
	public static boolean blockWaterBucket;
	public boolean checkForUpdate;
	public static List<Integer> noBlockBasedInventory;
	public static List<String> noEntityBasedInventory;
	public static List<Integer> noDrop;
	public static List<Integer> noPlace;
	public static List<String> noSpawn;
	public static List<Integer> noThrow;
	
	/**
	 * Config constructor.
	 * 
	 * @param plugin Reference's the plugin's main class.
	 */
	public Config(ControlCreativeMode plugin)
	{
		this.plugin = plugin;
		File config = new File(plugin.getDataFolder(), "config.yml");
		if (!config.exists())
		{
			if (!config.getParentFile().mkdirs()) plugin.getLogger().warning("Could not create config.yml");
			plugin.saveDefaultConfig();
		}
		reloadConfiguration();
	}
	
	/**
	 * Reloads the server's configuration file.
	 */
	public void reloadConfiguration()
	{
		plugin.reloadConfig();
		final FileConfiguration config = plugin.getConfig();
		blockLavaBucket = config.getBoolean("blockLavaBucket");
		blockTNTMinecart = config.getBoolean("blockTNTMinecart");
		blockWaterBucket = config.getBoolean("blockWaterBucket");
		checkForUpdate = config.getBoolean("checkForUpdate");
		noBlockBasedInventory = config.getIntegerList("noBlockBasedInventory");
		noEntityBasedInventory = config.getStringList("noEntityBasedInventory");
		noDrop = config.getIntegerList("noDrop");
		noPlace = config.getIntegerList("noPlace");
		noSpawn = config.getStringList("noSpawn");
		noThrow = config.getIntegerList("noThrow");
	}
}

@@ -1243,24 +1243,30 @@
 kLavaBucket%22
+, true
 );%0A%09%09blockTN
@@ -1313,16 +1313,22 @@
 inecart%22
+, true
 );%0A%09%09blo
@@ -1379,16 +1379,22 @@
 rBucket%22
+, true
 );%0A%09%09che
@@ -1441,16 +1441,22 @@
 rUpdate%22
+, true
 );%0A%09%09noB

Fix config to use default values if missing in the config.