Getting a Exception error :(

Discussion in 'Plugin Development' started by Insain, Jan 16, 2011.

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

    Insain

    ok well been working on this code for a little bit but i can seem to figure out this Exception error i know were its comeing from but i cant figure it out

    Code:
        public void onPlayerJoin(PlayerEvent event){
            Player player = event.getPlayer();
            String ppp = player.getName();
            this.uuuu(player, ppp);
        }
        public boolean uuuu(Player player, String playerName){
            try {
                BufferedReader br = new BufferedReader(new FileReader("Homer.txt"));
                String sCurLine;
    
                while((sCurLine = br.readLine()) != null){
                    StringTokenizer xyz = new StringTokenizer(sCurLine, ":");
                   [B] if (xyz.nextToken().equals(playerName))[/B]{
                        String x = xyz.nextToken();
                        String y = xyz.nextToken();
                        String z = xyz.nextToken();
                        String pitch = xyz.nextToken();
                        String yaw = xyz.nextToken();
                        Location location = new Location(player.getWorld(), Double.parseDouble(x), Double.parseDouble(y), Double.parseDouble(z), Float.parseFloat(pitch), Float.parseFloat("100"));
                        Homer.put(playerName, location);
                        return true;
                    }
                }
    
            } catch (Exception e){
                e.printStackTrace();
            }
            return false;
        }
    The issue is the bold part in the code its throwing me a Unkown Source Exception error when ever some one Logs in thus cuasing the script to break and the players have to redo there commands agian becuase they fail to load any help would be Great :)
     
  2. Offline

    DjDCH

    First of all, I really think you need to sleep. Just read what you have written. You have reversed letters several times.

    Also, can we have the full exception print, with all details and line numbers ? Because, from what I see and what I know, I don't see the problem.
     
  3. Offline

    Insain

    HAHA!! Sleep who needs it. That was probably my fault for typing to fast because im updating my other plug-ins as well as trying to figure this one out. Anyway here it is[​IMG]
     
  4. Offline

    DjDCH

    From the java doc :
    Code:
    public String nextToken()
        Returns:
            the next token from this string tokenizer.
        Throws:
            NoSuchElementException - if there are no more tokens in this tokenizer's string.
    
    Now you know where the problem come from ! :D
     
Thread Status:
Not open for further replies.

Share This Page