Fixed return values to match pass/fail.

This commit is contained in:
Tastybento 2018-02-07 21:13:32 -08:00
parent 2be005acb1
commit fc8876cf80

View File

@ -33,23 +33,23 @@ public class IslandTeamInviteAcceptCommand extends AbstractIslandTeamCommand {
UUID playerUUID = user.getUniqueId(); UUID playerUUID = user.getUniqueId();
if(!inviteList.containsKey(playerUUID)) if(!inviteList.containsKey(playerUUID))
return true; return false;
// Check if player has been invited // Check if player has been invited
if (!inviteList.containsKey(playerUUID)) { if (!inviteList.containsKey(playerUUID)) {
user.sendMessage("commands.island.team.invite.errors.none-invited-you"); user.sendMessage("commands.island.team.invite.errors.none-invited-you");
return true; return false;
} }
// Check if player is already in a team // Check if player is already in a team
if (getPlayers().inTeam(playerUUID)) { if (getPlayers().inTeam(playerUUID)) {
user.sendMessage("commands.island.team.invite.errors.you-already-are-in-team"); user.sendMessage("commands.island.team.invite.errors.you-already-are-in-team");
return true; return false;
} }
// Get the team leader // Get the team leader
UUID prospectiveTeamLeaderUUID = inviteList.get(playerUUID); UUID prospectiveTeamLeaderUUID = inviteList.get(playerUUID);
if (!getIslands().hasIsland(prospectiveTeamLeaderUUID)) { if (!getIslands().hasIsland(prospectiveTeamLeaderUUID)) {
user.sendMessage("commands.island.team.invite.errors.invalid-invite"); user.sendMessage("commands.island.team.invite.errors.invalid-invite");
inviteList.remove(playerUUID); inviteList.remove(playerUUID);
return true; return false;
} }
if (DEBUG) if (DEBUG)
getPlugin().getLogger().info("DEBUG: Invite is valid"); getPlugin().getLogger().info("DEBUG: Invite is valid");