2016-07-04 22:29:12 +00:00
|
|
|
package buttondevteam.thebuttonmcchat.commands.ucmds;
|
2016-06-22 23:38:35 +00:00
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2016-07-04 22:29:12 +00:00
|
|
|
import buttondevteam.thebuttonmcchat.FlairStates;
|
|
|
|
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
|
|
|
|
2016-06-22 23:38:35 +00:00
|
|
|
public final class IgnoreCommand extends UCommandBase {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String[] GetHelpText(String alias) {
|
|
|
|
return new String[] {
|
|
|
|
"§6---- Ignore flair ----",
|
|
|
|
"Stop the \"write your name in the thread\" message from showing up",
|
|
|
|
"Use /u ignore <username> if you commented from multiple accounts" };
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-06-24 17:32:34 +00:00
|
|
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
2016-06-22 23:38:35 +00:00
|
|
|
final Player player = (Player) sender;
|
2016-07-01 14:54:21 +00:00
|
|
|
TBMCPlayer p = TBMCPlayer.GetFromPlayer(player);
|
2016-06-22 23:38:35 +00:00
|
|
|
if (p.FlairState.equals(FlairStates.Accepted)) {
|
|
|
|
player.sendMessage("§cYou can only ignore the \"write yoőu rname in the thread\" message.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (p.FlairState.equals(FlairStates.Commented)) {
|
|
|
|
player.sendMessage("Sorry, but your flair isn't recorded. Please ask a mod to set it for you.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!p.FlairState.equals(FlairStates.Ignored)) {
|
|
|
|
p.FlairState = FlairStates.Ignored;
|
2016-07-01 14:54:21 +00:00
|
|
|
p.SetFlair(TBMCPlayer.FlairTimeNone);
|
2016-06-22 23:38:35 +00:00
|
|
|
p.UserName = "";
|
|
|
|
player.sendMessage("§bYou have ignored the message. You can still use /u accept to get a flair.§r");
|
|
|
|
} else
|
|
|
|
player.sendMessage("§cYou already ignored the message.§r");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-06-24 17:32:34 +00:00
|
|
|
public String GetUCommandPath() {
|
2016-06-22 23:38:35 +00:00
|
|
|
return "ignore";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|