"Incorrect argument amount for type hashmap"

Discussion in 'Plugin Development' started by Stackoverload, Mar 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Stackoverload

    Hello! I've recently have been working on a config and I seem to be getting an error under my hashmap. Here's the code (The problem is in the loadConfigs void at the bottom of the code):

    Code:java
    1. package com.Stackoverload.PlagueZ;
    2.  
    3. import java.io.BufferedWriter;
    4. import java.io.File;
    5. import java.io.FileWriter;
    6. import java.util.HashMap;
    7. import java.util.Map;
    8.  
    9. import org.bukkit.plugin.java.JavaPlugin;
    10. import com.Stackoverload.PlagueZ.Util.*;
    11.  
    12. public class PlagueZ extends JavaPlugin {
    13. public static PlagueZ instance;
    14. public static boolean firstRun = false;
    15.  
    16. @Override
    17. public void onEnable() {
    18. instance = this;
    19. loadConfigs();
    20.  
    21. firstRun = ConfigManager.getConfig("config").getBoolean("Config.never-ever-modify.first-run");
    22. if (firstRun) {
    23. ConfigManager.getConfig("config").set("Config.never-ever-modify.first-run", false);
    24. ConfigManager.saveConfig("config");
    25. }
    26. }
    27.  
    28. @Override
    29. public void onDisable() {
    30.  
    31. }
    32.  
    33. private static void loadConfigs() {
    34. Map<String, Object> defaultConfig = new HashMap<>();
    35. defaultConfig.put("Config.never-ever-modify.first-run", true);
    36.  
    37. ConfigManager.newConfig("config", instance, defaultConfig);
    38. }
    39. }


    The ConfigManager is a class I made, zero errors.
     
  2. Offline

    2MBKindiegames

    Try changing line 34 into:
     
    Stackoverload and Jhtzb like this.
  3. Offline

    Bammerbom

  4. Offline

    Stackoverload

    Thank you sooo much! <3
     
  5. Offline

    2MBKindiegames

    Stackoverload
    You're very welcome! If you need any more help, just create a new topic or PM me!

    -If your question has been answered, please mark this post as SOLVED!
     
Thread Status:
Not open for further replies.

Share This Page