Merge branch 'develop' into API-hideWhen

This commit is contained in:
tastybento 2024-08-01 10:14:03 -07:00 committed by GitHub
commit fc589334df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -114,8 +114,13 @@ public class AdminUnregisterCommand extends ConfirmableCommand {
targetIsland.getMemberSet().forEach(m -> getIslands().removePlayer(targetIsland, m));
// Remove all island players that reference this island
targetIsland.getMembers().clear();
targetIsland.log(new LogEntry.Builder("UNREGISTER").data("player", targetUUID.toString())
.data("admin", user.getUniqueId().toString()).build());
if (user.isPlayer()) {
targetIsland.log(new LogEntry.Builder("UNREGISTER").data("player", targetUUID.toString())
.data("admin", user.getUniqueId().toString()).build());
} else {
targetIsland.log(new LogEntry.Builder("UNREGISTER").data("player", targetUUID.toString())
.data("admin", "console").build());
}
user.sendMessage("commands.admin.unregister.unregistered-island", TextVariables.XYZ, Util.xyz(targetIsland.getCenter().toVector()),
TextVariables.NAME, getPlayers().getName(targetUUID));
}

View File

@ -41,6 +41,7 @@ import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.Settings;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.logs.LogEntry;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.managers.CommandsManager;
@ -270,6 +271,8 @@ public class AdminUnregisterCommandTest {
verify(user).sendMessage("commands.admin.unregister.unregistered-island", TextVariables.XYZ, "1,2,3",
TextVariables.NAME, "name");
verify(island).setOwner(null);
verify(island).log(any(LogEntry.class));
}
/**