Getting StackTrace

Discussion in 'Plugin Development' started by Licio123, Jul 30, 2014.

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

    Licio123

    Code:
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:320) ~[bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:486) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:471) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.PlayerList.c(PlayerList.java:225) [bukki
    t.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.PlayerList.a(PlayerList.java:116) [bukki
    t.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.LoginListener.c(LoginListener.java:78) [
    bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.LoginListener.a(LoginListener.java:42) [
    bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:149
    ) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [bukk
    it.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:6
    55) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2
    50) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5
    45) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java
    :457) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6
    17) [bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
    13
            at java.lang.String.substring(Unknown Source) ~[?:1.7.0_51]
            at me.Licio123.Custom.Custom.onjoin(Custom.java:196) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _51]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _51]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_51]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:318) ~[bukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
            ... 14 more
    Code:java
    1. @EventHandler
    2. public void onInteract(PlayerJoinEvent event){
    3. Player ep = event.getPlayer();
    4. if (ep.getName().length() <= 13){
    5. if(ep.isOp()){
    6. ep.setPlayerListName(ChatColor.RED + ep.getName());
    7. } else if (!ep.isOp()){
    8. ep.setPlayerListName(ChatColor.AQUA + ep.getName());
    9. }
    10. } else {
    11. String name = ep.getName().substring(0, 14);
    12. if(ep.isOp()){
    13. ep.setPlayerListName(ChatColor.RED + name);
    14. } else if (!ep.isOp()){
    15. ep.setPlayerListName(ChatColor.AQUA + name);
    16. }
    17. }
    18. }


    This was the code that I used to rename player name in tab anyway it worked but I am getting a bloddy stacktrace and I dont know how to fix this up

    Can you help me?
     
  2. Offline

    Licio123

    There is a white line
     
  3. Licio123 Then your stacktrace and code do not match, please ensure that you use the same version for both.
     
Thread Status:
Not open for further replies.

Share This Page