Finish using the UUID, we are still using blocking methods.
I want to get fully away from blocking methods and instead make the user/player/prisoner/whatever wait to get an answer while we retrieve the uuid information asynchronously.
This commit is contained in:
@ -334,11 +334,10 @@ public class Jail {
|
||||
*
|
||||
* @param name The name of the prisoner to get.
|
||||
* @return the prisoner instance, can be null
|
||||
* @deprecated Use {@link #getPrisoner(UUID)}
|
||||
*/
|
||||
public Prisoner getPrisoner(String name) {
|
||||
public Prisoner getPrisonerByLastKnownName(String name) {
|
||||
for(Prisoner p : this.getAllPrisoners())
|
||||
if(p.getName().equalsIgnoreCase(name))
|
||||
if(p.getLastKnownName().equalsIgnoreCase(name))
|
||||
return p;
|
||||
|
||||
return null;
|
||||
|
@ -53,8 +53,14 @@ public class Prisoner {
|
||||
return UUID.fromString(this.uuid);
|
||||
}
|
||||
|
||||
/** Gets the name of this player. */
|
||||
public String getName() {
|
||||
/** Gets the name of this prisoner. */
|
||||
public String getLastKnownName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/** Sets the name of this prisoner. */
|
||||
public String setLastKnownName(String username) {
|
||||
this.name = username;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user