Weird error ...

Discussion in 'Plugin Development' started by Soxra, Mar 8, 2013.

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

    Soxra

    Hi, i can't understand why i get this error:
    [​IMG]
    Void hasClan:
    PHP:
        public boolean hasClan(Player player){
            
    boolean result false;
            if (
    plugin.getConfig().contains("Players." player.getName() + ".memberOf")){
                
    result true;
            }
            return 
    result;
        }
    Player Chat Event:
    PHP:
            if (eventMsg.startsWith("#") && c.hasClan(player)){
                
    event.setCancelled(true);
                
    String name c.getClan(player);
                
    String nMsg eventMsg.replaceAll("#""");
                List<
    Stringmembers c.getMembers(name);
               
                if (
    c.isAdmin(player)){
                    for (
    Player p Bukkit.getOnlinePlayers()){
                        if (
    members.contains(p.getName())){
                            
    msg.clanChatAdmin(pnamenMsg);
                        }
                    }
                    return;
                }
               
                for (
    Player p Bukkit.getOnlinePlayers()){
                    if (
    members.contains(p.getName())){
                        
    msg.clanChat(pnamenMsg);
                    }
                }
               
            }
     
  2. Offline

    Tirelessly

  3. Offline

    gomeow

    Wy need to see the whole class if that link can't help you
     
  4. Offline

    AmShaegar

    Either plugin or the result of getConfig() is null. Find out which one and why.
     
  5. Offline

    Shinxs

    do you have the constructor for that class because i have had some errors like that and it was most of the time that plugin = null
     
  6. Offline

    Soxra

    If i change this:
    Code:
        Clan plugin;
        public Utils(Clan p){
            this.plugin = p;
        }
    to this:
    Code:
    Plugin c = Bukkit.getPluginManager().getPlugin("Clan");
    its working.. why :O
     
  7. Offline

    AmShaegar

    Because your Type is now Plugin and not Clan? I do not know. I always use Plugin.
     
Thread Status:
Not open for further replies.

Share This Page