Error on checkTime() functio

Discussion in 'Plugin Development' started by deathtaker26, Jan 23, 2013.

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

    deathtaker26

    I have a function that checks the time of the world and calls an event

    Code:
        public void checkTime(){
       
            if(Bukkit.getServer().getWorld("Survival2").getTime() > 13000 && Bukkit.getServer().getWorld("Survival2").getTime() < 23000){
                    for(Player p: Bukkit.getServer().getOnlinePlayers()){
                        //change player
                       
                        if(getCurse(p).equalsIgnoreCase("werewolf")){
                            if(getWerewolfState(p) == false){
                                transformWerewolf(p, true);
                            }
                            }
                        }
                }else{
                    for(Player p: Bukkit.getServer().getOnlinePlayers()){
                        //change player
                        if(getCurse(p).equalsIgnoreCase("werewolf")){
                            if(getWerewolfState(p) == true){
                                transformWerewolf(p, false);
                            }
                            }
                        }
                }
            }
    I have a command ccrefresh which calls check time and here's the error im getting:

    can anyone help me find a solution?

    whoops i almost forgot, line 101 is this line:
    (first time)
    Code:
    if(getCurse(p).equalsIgnoreCase("werewolf")){
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  2. Offline

    stuntguy3000

    "getCurse"

    What?
     
  3. Offline

    deathtaker26

    sorry the function getCurse is:
    Code:
        public String getCurse(Player player){
            String result = "";
            try{
                File players = new File(getDataFolder(), "players.yml");
                FileConfiguration curses = YamlConfiguration.loadConfiguration(players);
                result = curses.getString("Players.Curses." + player.getDisplayName());
               
                return result;
            }catch(Exception e1){
                e1.printStackTrace();
                return result;
            }
        
    just an update I just found that the error is in getCurse, I believe it has to do with the getString() function what could be causing this? I read something about including it in my jar file but that can't be right.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
Thread Status:
Not open for further replies.

Share This Page