when PlayerQuitEvent is never called

This commit is contained in:
Jesse Boyd 2018-01-04 19:24:00 +11:00
parent 59557cf889
commit 5ddefcea22
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -115,14 +115,23 @@ public class UUIDHandler {
if (implementation == null) { if (implementation == null) {
return null; return null;
} }
return implementation.getPlayer(uuid); return check(implementation.getPlayer(uuid));
} }
public static PlotPlayer getPlayer(String name) { public static PlotPlayer getPlayer(String name) {
if (implementation == null) { if (implementation == null) {
return null; return null;
} }
return implementation.getPlayer(name); return check(implementation.getPlayer(name));
}
private static PlotPlayer check(PlotPlayer plr) {
if (plr != null && !plr.isOnline()) {
UUIDHandler.getPlayers().remove(plr.getName());
PS.get().IMP.unregister(plr);
plr = null;
}
return plr;
} }
public static UUID getUUIDFromString(String nameOrUUIDString) { public static UUID getUUIDFromString(String nameOrUUIDString) {