Don't check against max public homes for other-user home privacy update, Fix #388

This commit is contained in:
William committed 2023-05-04 19:30:04 +01:00
1 parent e51dc89a18
commit 4409ebb424
1 file changed
+2 -2
@@ -288,11 +288,11 @@ public class HomesManager {
}
public void setHomePrivacy(@NotNull Home home, boolean isPublic) {
if (isPublic) {
if (isPublic && home.getOwner() instanceof OnlineUser online) {
final int publicHomes = plugin.getDatabase().getHomes(home.getOwner()).stream()
.filter(Home::isPublic)
.toList().size();
if (publicHomes >= getMaxPublicHomes(home.getOwner())) {
if (publicHomes >= getMaxPublicHomes(online)) {
throw new ValidationException(ValidationException.Type.REACHED_MAX_PUBLIC_HOMES);
}
}