mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Fix edithome privacy not working
This commit is contained in:
1 parent
6903a705cd
commit
c316d290c5
2 files changed
+1
-5
No files matched your search
@@ -166,7 +166,7 @@ public class EditHomeCommand extends SavedPositionCommand<Home> {
|
|||||||
home.setPublic(privacyArg.get().equals("public"));
|
home.setPublic(privacyArg.get().equals("public"));
|
||||||
plugin.fireEvent(plugin.getHomeEditEvent(home, executor), (event) -> {
|
plugin.fireEvent(plugin.getHomeEditEvent(home, executor), (event) -> {
|
||||||
try {
|
try {
|
||||||
plugin.getManager().homes().setHomePrivacy(home, home.isPublic());
|
plugin.getManager().homes().setHomePrivacy(event.getHome(), home.isPublic());
|
||||||
} catch (ValidationException e) {
|
} catch (ValidationException e) {
|
||||||
int maxHomes = executor instanceof OnlineUser user ?
|
int maxHomes = executor instanceof OnlineUser user ?
|
||||||
user.getMaxPublicHomes(plugin.getSettings().getMaxPublicHomes(),
|
user.getMaxPublicHomes(plugin.getSettings().getMaxPublicHomes(),
|
||||||
|
|||||||
@@ -248,10 +248,6 @@ public class HomesManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setHomePrivacy(@NotNull Home home, boolean isPublic) {
|
public void setHomePrivacy(@NotNull Home home, boolean isPublic) {
|
||||||
if (isPublic == home.isPublic()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPublic && home.getOwner() instanceof OnlineUser online) {
|
if (isPublic && home.getOwner() instanceof OnlineUser online) {
|
||||||
final int publicHomes = plugin.getDatabase().getHomes(home.getOwner()).stream()
|
final int publicHomes = plugin.getDatabase().getHomes(home.getOwner()).stream()
|
||||||
.filter(Home::isPublic)
|
.filter(Home::isPublic)
|
||||||
|
|||||||
Reference in new issue
Block a user