[Coding] Java help

Discussion in 'Bukkit Help' started by komes, Feb 1, 2011.

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

    komes

    Ok well here is my problem. I have made the basics to this plugin i am fiddling around with, for my first project. And i have ran into this problem. So i have 3 classes BlastPick.java, BlastPickPlayerListener.java, BlastPickBlockListener. and in my PlayeListener i have 2 methods onPlayerCommand and onLength.


    Code:
     public void onPlayerCommand(PlayerChatEvent event) {
              //Make the message a string.
                String[] split = event.getMessage().split(" ");
                //Get the player that talked.
                Player player = event.getPlayer();
                //If the first part of the string is /BlastPick or /b then do this.
                if ((split[0].equalsIgnoreCase("/BlastBox"))) {
                    //Run the method toggleVision for player
                    plugin.toggleVision(player);
                    event.setCancelled(true);
                }
    
            }
    Code:
    public int onLength(PlayerChatEvent event) {
                  String s;
                  int Length = 0;
                  String[] split = event.getMessage().split(" ");
    
                    if ((split[0].equalsIgnoreCase("/BlastLength"))) {
                        s = split[1];
                        Length = Integer.parseInt(s.trim());
                    }
                    return Length;
                }



    And see i want to use the return value i get from onLength in my BlockListener class but don't know how?

    Also Thanks for responding.
     
  2. Offline

    Pezmantbh

  3. Offline

    komes

    Thanks
     
Thread Status:
Not open for further replies.

Share This Page