mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Safer UUID provider
This commit is contained in:
parent
5a842842a2
commit
d2ef1c350a
@ -315,8 +315,16 @@ public class UUIDHandler {
|
|||||||
return uuidWrapper.getUUID(player);
|
return uuidWrapper.getUUID(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Safely provide the correct UUID provider. Ignores user preference if not possible rather than break the plugin.
|
||||||
|
*/
|
||||||
public static UUID getUUID(OfflinePlayer player) {
|
public static UUID getUUID(OfflinePlayer player) {
|
||||||
if (uuidWrapper == null) {
|
if (uuidWrapper == null) {
|
||||||
|
|
||||||
|
if (Settings.OFFLINE_MODE) {
|
||||||
|
uuidWrapper = new OfflineUUIDWrapper();
|
||||||
|
}
|
||||||
|
else {
|
||||||
try {
|
try {
|
||||||
getUUID(player);
|
getUUID(player);
|
||||||
uuidWrapper = new DefaultUUIDWrapper();
|
uuidWrapper = new DefaultUUIDWrapper();
|
||||||
@ -325,6 +333,7 @@ public class UUIDHandler {
|
|||||||
uuidWrapper = new OfflineUUIDWrapper();
|
uuidWrapper = new OfflineUUIDWrapper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return uuidWrapper.getUUID(player);
|
return uuidWrapper.getUUID(player);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user