From 286205ac6db68667a14a31433df398dae8151b23 Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Sat, 24 Mar 2018 11:53:14 -0700 Subject: [PATCH] Add /uninvite command --- .../PopulationDensity/PopulationDensity.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/me/ryanhamshire/PopulationDensity/PopulationDensity.java b/src/me/ryanhamshire/PopulationDensity/PopulationDensity.java index a0042b0..b37192f 100644 --- a/src/me/ryanhamshire/PopulationDensity/PopulationDensity.java +++ b/src/me/ryanhamshire/PopulationDensity/PopulationDensity.java @@ -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")) {