Checking if Player is real

Discussion in 'Plugin Development' started by killerman747, May 10, 2014.

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

    killerman747

    So I am trying to use this code:
    Code:java
    1. @SuppressWarnings("deprecation")
    2. Player user = Bukkit.getPlayer(args[1]);
    3. if(user.equals(null)){
    4. player.sendMessage(ChatColor.DARK_RED + "Not Real!");
    5. }else{
    6. //Something
    7. }

    When ever this runs, it returns null on
    Code:java
    1. if(user.equals(null)){

    that line. Is there a better way to do this, or how can I fix this?
     
  2. Offline

    Gecco1234

    What do you mean real, premium? Or non-npc
     
  3. Offline

    killerman747

    Gecco1234
    Premium. Making sure that the args match a name that is registered.
     
  4. Offline

    Gater12

  5. Offline

    killerman747

    Gater12
    Yes, but I need more then just operators, I need to check if the name is registered to an account.
     
  6. Offline

    Gater12

    killerman747
    Check with minecraft.net to see if it's paid.
     
  7. Offline

    ZodiacTheories

  8. Offline

    Smerfa

    check name don't check if it's valid session.
    I know 2 ways of checking session:
    - Create own code to check it - so plugin can work on offline mode. (I don't know how to do that)
    - Use online-mode but check if nickname is "premium" and if NOT then login player manually (onlinemode: true so no-premium with premium nicknames will be kicked, but no-premium with no-premium nicknames will be logged in bypassing Minecraft authorization) - that can be hard to do without editing CraftBukkit source code, but it's possible (without editing source) :>
    But I can't say more, bukkit.org don't like offline mode etc... :
     
  9. Offline

    Gater12

  10. Offline

    Smerfa

  11. Offline

    Gater12

    Smerfa
    It depends on what the OP's plugin wants to do. If the OP just wanted to see if a user inputed a name that is a registered premium account (As it is now) then what more to simply check if the name is associated with a premium account on minecraft.net.

    If the OP wanted to, for lack of better word, do something involving sessions, then it would an entire different problem then it is now.
     
    xTigerRebornx likes this.
Thread Status:
Not open for further replies.

Share This Page