Merge branch 'develop' into admin_setowner

This commit is contained in:
tastybento 2024-03-03 14:35:18 -08:00
commit 994019836a
3 changed files with 9 additions and 6 deletions

View File

@ -88,7 +88,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.1.0</build.version>
<build.version>2.1.2</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<server.jars>${project.basedir}/lib</server.jars>

View File

@ -302,8 +302,7 @@ public class IslandTeamCommand extends CompositeCommand {
return true;
}
if (clickType.equals(ClickType.SHIFT_LEFT) && user.hasPermission(this.acceptCommand.getPermission())) {
getPlugin().log("Invite accepted: " + user.getName() + " accepted " + invite.getType()
+ " invite to island at " + island.getCenter());
getPlugin().log("Invite accepted: " + user.getName() + " accepted " + invite.getType());
// Accept
switch (invite.getType()) {
case COOP -> this.acceptCommand.acceptCoopInvite(user, invite);
@ -558,7 +557,7 @@ public class IslandTeamCommand extends CompositeCommand {
case RanksManager.TRUSTED_RANK -> this.unTrustCommand.unTrustCmd(user, member.getUniqueId());
default -> {
if (kickCommand.canExecute(user, kickCommand.getLabel(), List.of(member.getName()))) {
yield kickCommand.execute(user, kickCommand.getLabel(), List.of(member.getName()));
yield kickCommand.kick(clicker, member.getUniqueId());
} else {
yield false;
}

View File

@ -90,7 +90,10 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
}
}
protected void kick(User user, UUID targetUUID) {
protected boolean kick(User user, UUID targetUUID) {
if (targetUUID == null) {
return false;
}
User target = User.getInstance(targetUUID);
Island oldIsland = Objects.requireNonNull(getIslands().getIsland(getWorld(), targetUUID)); // Should never be
// null because of
@ -99,7 +102,7 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
IslandBaseEvent event = TeamEvent.builder().island(oldIsland).reason(TeamEvent.Reason.KICK)
.involvedPlayer(targetUUID).build();
if (event.isCancelled()) {
return;
return false;
}
target.sendMessage("commands.island.team.kick.player-kicked", TextVariables.GAMEMODE,
getAddon().getDescription().getName(), TextVariables.NAME, user.getName(), TextVariables.DISPLAY_NAME,
@ -121,6 +124,7 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
getParent().getSubCommand("invite").ifPresent(c -> c.setCooldown(oldIsland.getUniqueId(),
targetUUID.toString(), getSettings().getInviteCooldown() * 60));
}
return true;
}
@Override