mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-01 00:10:40 +01:00
Fix minor bugs or code smells.
This commit is contained in:
parent
b788d4c49f
commit
6507916fc1
@ -24,7 +24,6 @@ public class IslandTeamInviteAcceptCommand extends ConfirmableCommand {
|
||||
private static final String INVALID_INVITE = "commands.island.team.invite.errors.invalid-invite";
|
||||
private final IslandTeamCommand itc;
|
||||
private UUID playerUUID;
|
||||
private UUID prospectiveOwnerUUID;
|
||||
|
||||
public IslandTeamInviteAcceptCommand(IslandTeamCommand islandTeamCommand) {
|
||||
super(islandTeamCommand, "accept");
|
||||
@ -47,7 +46,7 @@ public class IslandTeamInviteAcceptCommand extends ConfirmableCommand {
|
||||
return false;
|
||||
}
|
||||
// Get the island owner
|
||||
prospectiveOwnerUUID = itc.getInviter(playerUUID);
|
||||
UUID prospectiveOwnerUUID = itc.getInviter(playerUUID);
|
||||
if (prospectiveOwnerUUID == null) {
|
||||
user.sendMessage(INVALID_INVITE);
|
||||
return false;
|
||||
|
@ -167,6 +167,10 @@ public class IslandTeamInviteCommand extends CompositeCommand {
|
||||
user.sendMessage("commands.island.team.invite.removing-invite");
|
||||
}
|
||||
Island island = getIslands().getIsland(getWorld(), user.getUniqueId());
|
||||
if (island == null) {
|
||||
user.sendMessage("general.errors.no-island");
|
||||
return false;
|
||||
}
|
||||
// Fire event so add-ons can run commands, etc.
|
||||
IslandBaseEvent e = TeamEvent.builder()
|
||||
.island(island)
|
||||
|
@ -67,6 +67,10 @@ public class IslandTeamLeaveCommand extends ConfirmableCommand {
|
||||
|
||||
private void leave(User user) {
|
||||
Island island = getIslands().getIsland(getWorld(), user);
|
||||
if (island == null) {
|
||||
user.sendMessage("general.errors.no-island");
|
||||
return;
|
||||
}
|
||||
// Fire event
|
||||
IslandBaseEvent event = TeamEvent.builder()
|
||||
.island(island)
|
||||
|
Loading…
Reference in New Issue
Block a user