Skip to content

Commit

Permalink
Add /uninvite command
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMWM committed Mar 24, 2018
1 parent 06b6449 commit 286205a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/me/ryanhamshire/PopulationDensity/PopulationDensity.java
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,30 @@ else if(cmd.getName().equalsIgnoreCase("invite") && player != null)

return true;
}

else if(cmd.getName().equalsIgnoreCase("uninvite") && player != null)
{
if(args.length < 1) return false;

//send a notification to the invitee, if he's available
Player invitee = this.getServer().getPlayer(args[0]);
if(invitee != null)
{
playerData = this.dataStore.getPlayerData(invitee);
if(playerData.inviter == player)
{
//PopulationDensity.sendMessage(player, TextMode.Success, Messages.InviteAlreadySent, invitee.getName(), player.getName());
player.sendMessage(ChatColor.GREEN + invitee.getName() + " has been uninvited.");
return true;
}
}
else
{
PopulationDensity.sendMessage(player, TextMode.Err, Messages.PlayerNotFound, args[0]);
}

return true;
}

else if(cmd.getName().equalsIgnoreCase("sendregion"))
{
Expand Down

0 comments on commit 286205a

Please sign in to comment.