Fixed bug where processing message would always get displayed

and the player could never execute /mctop or /mcrank if chat display
was disabled.
This commit is contained in:
TfT_02 2014-08-24 09:21:40 -07:00
parent 48d3280e5e
commit 7da661546f
2 changed files with 4 additions and 4 deletions

View File

@ -37,6 +37,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
if (useChat) {
displayChat();
}
((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
}
private void displayChat() {
@ -57,7 +58,6 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
rank = skills.get(null);
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
player.removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
}
public void displayBoard() {

View File

@ -42,6 +42,9 @@ public class MctopCommandDisplayTask extends BukkitRunnable {
displayChat();
}
if (sender instanceof Player) {
((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
}
sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip"));
}
@ -62,9 +65,6 @@ public class MctopCommandDisplayTask extends BukkitRunnable {
sender.sendMessage(String.format("%2d. %s%s - %s%s", place, ChatColor.GREEN, stat.name, ChatColor.WHITE, stat.statVal));
place++;
}
if (sender instanceof Player) {
((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
}
}
private void displayBoard() {