public ChunkLoader.ChunkType getChunkTypeFromMaterial(Material material) {
    if (material == configuration.getPersonalLoaderBlock()) return ChunkLoader.ChunkType.PERSONAL;
    if (material == configuration.getWorldLoaderBlock()) return ChunkLoader.ChunkType.WORLD;
    if (material == configuration.getCreativeLoaderBlock()) return ChunkLoader.ChunkType.CREATIVE;

    return null;
  }
 public Material getChunkLoaderMaterial(ChunkLoader.ChunkType type) {
   switch (type) {
     case PERSONAL:
       return configuration.getPersonalLoaderBlock();
     case WORLD:
       return configuration.getWorldLoaderBlock();
     case CREATIVE:
       return configuration.getCreativeLoaderBlock();
     default:
       return null;
   }
 }
  @Override
  public void onEnable() {
    try {
      Class.forName("net.kaikk.mc.bcl.forge.BCLForge");
    } catch (ClassNotFoundException ex) {
      getLogger()
          .log(
              Level.SEVERE,
              "BCLForge not found. This plugin depends on BCLForge which can be downloaded from http://kaikk.net/mc/",
              ex);
      onDisable();
      return;
    }

    instance = this;
    chunkLoaders = new ArrayList<>();
    activeChunkLoader = new HashMap<>();
    activeLocation = new HashMap<>();

    configuration = new ChunkLoaderConfiguration(this);
    if (configuration.useMySql()) this.data = new MySqlDataProvider(this);

    initializeMenus();
    loadWorldChunks();

    for (Player p : getServer().getOnlinePlayers()) {
      loadPersonalChunks(p.getUniqueId());
    }

    PluginManager pm = this.getServer().getPluginManager();
    pm.registerEvents(new AnotherChunkLoaderEvents(this), this);

    getCommand("anotherchunkloader").setExecutor(new AnotherChunkLoaderCommand(this));
    getCommand("anotherchunkloaderadmin").setExecutor(new AnotherChunkLoaderAdminCommand(this));

    getLogger().info("Successfully enabled AnotherChunkLoader");
  }
  private void initializeMenus() {
    menuMain =
        new IconMenu("Chunk Loader - Main Menu", 9, new MainMenuOptionClickEventHandler(), this)
            .setOption(
                3,
                new ItemStack(configuration.getPersonalLoaderBlock(), 1),
                "Personal chunk loader",
                "Active when you are online.")
            .setOption(
                4,
                new ItemStack(configuration.getWorldLoaderBlock(), 1),
                "World chunk loader",
                "Always active.");

    menuMainAdmin =
        new IconMenu("Chunk Loader - Main Menu", 9, new MainMenuOptionClickEventHandler(), this)
            .setOption(
                3,
                new ItemStack(configuration.getPersonalLoaderBlock(), 1),
                "Personal chunk loader",
                "Active when you are online.")
            .setOption(
                4,
                new ItemStack(configuration.getWorldLoaderBlock(), 1),
                "World chunk loader",
                "Always active.")
            .setOption(
                5,
                new ItemStack(configuration.getCreativeLoaderBlock(), 1),
                "Creative chunk loader",
                "Always active and never expires.");

    menuPersonal =
        new IconMenu("Chunk Loader - Personal", 9, new PersonalOptionClickEventHandler(), this)
            .setOption(
                2,
                new ItemStack(configuration.getPersonalLoaderBlock(), 1),
                "1x1 chunks",
                "Loads 1 chunk.")
            .setOption(
                3,
                new ItemStack(configuration.getPersonalLoaderBlock(), 3),
                "3x3 chunks",
                "Loads 9 chunks.")
            .setOption(
                4,
                new ItemStack(configuration.getPersonalLoaderBlock(), 5),
                "5x5 chunks",
                "Loads 25 chunks.")
            .setOption(
                5,
                new ItemStack(configuration.getPersonalLoaderBlock(), 7),
                "7x7 chunks",
                "Loads 49 chunks.")
            .setOption(
                6,
                new ItemStack(configuration.getPersonalLoaderBlock(), 9),
                "9x9 chunks",
                "Loads 81 chunks.");

    menuWorld =
        new IconMenu("Chunk Loader - World", 9, new WorldOptionClickEventHandler(), this)
            .setOption(
                2,
                new ItemStack(configuration.getWorldLoaderBlock(), 1),
                "1x1 chunks",
                "Loads 1 chunk.")
            .setOption(
                3,
                new ItemStack(configuration.getWorldLoaderBlock(), 3),
                "3x3 chunks",
                "Loads 9 chunks.")
            .setOption(
                4,
                new ItemStack(configuration.getWorldLoaderBlock(), 5),
                "5x5 chunks",
                "Loads 25 chunks.")
            .setOption(
                5,
                new ItemStack(configuration.getWorldLoaderBlock(), 7),
                "7x7 chunks",
                "Loads 49 chunks.")
            .setOption(
                6,
                new ItemStack(configuration.getWorldLoaderBlock(), 9),
                "9x9 chunks",
                "Loads 81 chunks.");

    menuCreative =
        new IconMenu("Chunk Loader - Creative", 9, new CreativeOptionClickEventHandler(), this)
            .setOption(
                2,
                new ItemStack(configuration.getCreativeLoaderBlock(), 1),
                "1x1 chunks",
                "Loads 1 chunk.")
            .setOption(
                3,
                new ItemStack(configuration.getCreativeLoaderBlock(), 3),
                "3x3 chunks",
                "Loads 9 chunks.")
            .setOption(
                4,
                new ItemStack(configuration.getCreativeLoaderBlock(), 5),
                "5x5 chunks",
                "Loads 25 chunks.")
            .setOption(
                5,
                new ItemStack(configuration.getCreativeLoaderBlock(), 7),
                "7x7 chunks",
                "Loads 49 chunks.")
            .setOption(
                6,
                new ItemStack(configuration.getCreativeLoaderBlock(), 9),
                "9x9 chunks",
                "Loads 81 chunks.");
  }