Going through a file and adding each line into an array

Discussion in 'Bukkit Discussion' started by cronikkk, Jul 14, 2011.

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

    cronikkk

    http://pastebin.com/ZjN2e58e

    There is the code

    What i'm trying to do is check messages to see if a user is swearing. I have the text file created in McServerDirectory/plugins/iWarning/badwords.txt

    Code:
    19:23:05 [SEVERE] Could not pass event PLAYER_CHAT to iWarning
    java.lang.NullPointerException
            at java.lang.String.contains(Unknown Source)
            at net.minedev.cronikkk.iWarning.Methods.WordFilter.checkMessage(WordFil
    ter.java:48)
            at net.minedev.cronikkk.iWarning.IWPlayerListener.onPlayerChat(IWPlayerL
    istener.java:35)
            at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.ja
    va:279)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:321)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:681)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Thats the error I get.

    Figured I'd add. as you can see in the source code, it prints out the first line. It did successfully do that. Its gotta be somethign with the .contains();

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  2. Offline

    DreadKyller

    I do not see any errors in the code. nothing possibly null. yet somehow words[counter] is returning null.
     
  3. Offline

    cronikkk

    Unfortunately :/
     
Thread Status:
Not open for further replies.

Share This Page