mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Fix regression in invalid home check (#4425)
This commit is contained in:
parent
f57de40668
commit
b84207f955
@ -161,6 +161,15 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
return loc != null ? loc.location() : null;
|
||||
}
|
||||
|
||||
public boolean hasValidHomes() {
|
||||
for (final LazyLocation loc : holder.homes().values()) {
|
||||
if (loc != null && loc.location() != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Location getHome(final Location world) {
|
||||
if (getHomes().isEmpty()) {
|
||||
return null;
|
||||
|
@ -81,7 +81,7 @@ public class Commandhome extends EssentialsCommand {
|
||||
} else {
|
||||
showError(user.getBase(), new Exception(tl("noHomeSetPlayer")), commandLabel);
|
||||
}
|
||||
} else if (homes.isEmpty() || finalPlayer.getHome(homes.get(0)) == null) {
|
||||
} else if (homes.isEmpty() || !finalPlayer.hasValidHomes()) {
|
||||
showError(user.getBase(), new Exception(tl("noHomeSetPlayer")), commandLabel);
|
||||
} else if (homes.size() == 1 && finalPlayer.equals(user)) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user