mirror of
https://github.com/NLthijs48/AreaShop.git
synced 2024-11-16 15:25:11 +01:00
Fix using landlordName setting without using landlord (uuid) setting
This commit is contained in:
parent
6b8e161e43
commit
40d45c7786
@ -398,13 +398,20 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||||||
*/
|
*/
|
||||||
public UUID getLandlord() {
|
public UUID getLandlord() {
|
||||||
String landlord = getStringSetting("general.landlord");
|
String landlord = getStringSetting("general.landlord");
|
||||||
if(landlord != null) {
|
if(landlord != null && !landlord.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
return UUID.fromString(landlord);
|
return UUID.fromString(landlord);
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
// Incorrect UUID
|
// Incorrect UUID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String landlordName = getStringSetting("general.landlordName");
|
||||||
|
if(landlordName != null && !landlordName.isEmpty()) {
|
||||||
|
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(landlordName);
|
||||||
|
if(offlinePlayer != null) {
|
||||||
|
return offlinePlayer.getUniqueId();
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user