mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 16:05:00 +00:00
return
This commit is contained in:
parent
f4f28584b5
commit
a62572111c
1 changed files with 10 additions and 1 deletions
|
@ -23,8 +23,10 @@ public class InviteSubcommand extends Common implements CommandExecutor
|
|||
sender.sendMessage(NO_PERMS);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length != 2)
|
||||
return false;
|
||||
|
||||
Player player = (Player) sender;
|
||||
Guild guild = Guild.getGuild(player);
|
||||
Player invitee = Bukkit.getPlayer(args[1]);
|
||||
|
@ -33,30 +35,37 @@ public class InviteSubcommand extends Common implements CommandExecutor
|
|||
sender.sendMessage(PNF);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Guild.getGuild(invitee) != null)
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "This player is already in another guild!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (guild == null)
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "You aren't in a guild!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (guild.getState() == GuildState.CLOSED)
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "The guild is currently closed!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (guild.getState() == GuildState.OPEN)
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "The guild is open! Tell your friend to join using \"/g join\"!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (INVITES.containsKey(invitee))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "They have already been invited to your guild!");
|
||||
return true;
|
||||
}
|
||||
|
||||
INVITES.put(invitee, guild);
|
||||
invitee.sendMessage(tl("%p%You have been invited to join %s%" + GUtil.colorize(guild.getName())) + "%p% through %s%" + player.getName() + "%p%'s invite!");
|
||||
invitee.sendMessage(tl("%p%Do %s%/g join " + ChatColor.stripColor(GUtil.colorize(guild.getName())) + "%p% to join!"));
|
||||
|
|
Loading…
Reference in a new issue