Solved getPlayer() deprecated

Discussion in 'Plugin Development' started by Markyroson, Jun 18, 2015.

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

    Markyroson

    What was player.getServer().getPlayer() replaced with?
     
  2. Offline

    Drkmaster83

    There's no replacement, really... It still functions all the same as it used to, just with a warning this time around. They changed it to UUID based, so now you can call Server#getPlayer(UUID uuid). But, other than that, using getPlayer(String name) still works, it's just 'discouraged'.
     
    Markyroson likes this.
  3. Offline

    Markyroson

    ah, fair enough. Which one do you use? getPlayer(String name) or Server#getPlayer(UUID uuid) ?
     
  4. Offline

    Drkmaster83

    Completely dependent on what you need to use it for. You can't expect a commandsender to enter in a 32 character UUID to identify a player, so for commands, you'd use the former. However, in terms of uniquity and storage, I'd store a UUID so that (even though this would likely never happen almost ever) if a player changes their name mid-game, I can still maintain my unique reference to them.
     
    Markyroson likes this.
Thread Status:
Not open for further replies.

Share This Page