What in the world...? I can't use Lists?

Discussion in 'Plugin Development' started by Taco, Mar 4, 2011.

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

    Taco

    It seems bukkit doesn't like it when I use a List. This is the error I get when I try to reference it any way:

    Code:
    C:\Users\Dalton\Desktop\Bukkit>java -Xms512M -Xmx1024M -jar craftbukkit-0.0.1-SN
    APSHOT.jar
    16:57:03 [INFO] Starting minecraft server version Beta 1.3
    16:57:03 [INFO] Loading properties
    16:57:03 [INFO] Starting Minecraft server on *:25565
    16:57:03 [WARNING] **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    16:57:03 [WARNING] The server will make no attempt to authenticate usernames. Be
    ware.
    16:57:03 [WARNING] While this makes the game possible to play without internet a
    ccess, it also opens up the ability for hackers to connect with any username the
    y choose.
    16:57:03 [WARNING] To change this, set "online-mode" to "true" in the server.set
    tings file.
    16:57:03 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-493-
    g8b5496e-b493jnks (MC: 1.3)
    16:57:03 [INFO] Preparing level "world"
    16:57:03 [INFO] Preparing start region
    16:57:04 [INFO] godPowers version 2.0 is enabled!
    16:57:04 [INFO] Done (0.065s)! For help, type "help" or "?"
    16:57:12 [INFO] 143 recipes
    16:57:12 [INFO] FriedTaco [/192.168.1.127:1131] logged in with entity id 105
    16:57:23 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'godm
    ode' in plugin godPowers v2.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:33)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1
    83)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NullPointerException
            at com.FriedTaco.taco.godPowers.godModeCommand.onCommand(godModeCommand.
    java:30)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:31)
            ... 12 more
    >
    Has anyone else had this problem? The list in question is define as follows:

    public List<String> godMode = new ArrayList<String>();

    I've tried to reference it as both static and nonstatic and updated the variable accordingly with no results.

    Edit: It only seems to do this when I perform an action with a List in my command classes.
     
  2. Offline

    xZise

    Please provide a pastebin link to godModeCommand.java.
    And the class where you defined the list.

    Fabian
     
  3. Offline

    Taco

    Nevermind, I think I just goofed up.

    Edit: I doesn't appear I goofed up. I referenced it statically again and now it works.
     
  4. Offline

    Sammy

    A nickle for every time i goof up on small things ^^
     
  5. Offline

    Taco

    I see what I did wrong. For future reference, what I did was I forgot to give my player variable a value before trying to get it from the List. My bad.

    /request lock
     
Thread Status:
Not open for further replies.

Share This Page