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( ~[cus
            at org.bukkit.command.SimpleCommandMap.dispatch(
    0) ~[custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServe ~[custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerCon [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(
    :817) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(
    :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(
    ) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [cust
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(
    67) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(
    60) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(
    58) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    :469) [custom.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    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(
    ) ~[?:?]
            at org.bukkit.command.PluginCommand.execute( ~[cus
            ... 13 more
    There is the stacktrace need any lines of code just ask.
  2. Offline


    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


    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.
    // 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