Error! yay -_-

Discussion in 'Plugin Development' started by bwfcwalshy, Sep 1, 2014.

Thread Status:
Not open for further replies.
  1. Code:
    [14:23:14 INFO]: bwfcwalshy issued server command: /kickstarter browse
    [14:23:14 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'kick
    starter' in plugin Kickstarter v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cus
    tom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    0) ~[custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServe
    r.java:701) ~[custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerCon
    nection.java:956) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java
    :817) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java
    :28) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat
    .java:47) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157
    ) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [cust
    om.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:6
    67) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    60) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    58) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :469) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
            at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.7.0_51]
            at java.util.ArrayList.get(Unknown Source) ~[?:1.7.0_51]
            at com.bwfcwalshy.kickstarter.Kickstarter.onCommand(Kickstarter.java:249
    ) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cus
    tom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            ... 13 more
    There is the stacktrace need any lines of code just ask.
     
  2. Offline

    GreySwordz

    Arrays start at 0 if that helps.
     
  3. DJSkepter It's as if you expect people to read any of the sticky threads!
     
  4. Offline

    fireblast709

    bwfcwalshy You forgot to check if the project actually exists in the List. To prevent such issues, rather move the math outside of the for loop.
    Code:
    // Assuming nothing, 0 and 1 are all page 1
    begin = (page - 1)*10;
    // Since the start is 'equivalent to index 0', adding 9 would be equivalent to the 10th item
    end = max(begin + 9, list.size()-1)
    // Verify that begin < end!
    Then loop from begin till begin <= end
     
  5. I read it. But by then, I already knew how to read stack traces -.-
    It's there for a reason, yes?
     
  6. DJSkepter Yes. But a lot of the people that was targeted at do not read sticky threads and do not search for the solution.
     
Thread Status:
Not open for further replies.

Share This Page