Fixed message removal

This commit is contained in:
games647 committed 2016-06-10 09:23:15 +02:00
1 parent 7733135ce4
commit 0b899f61a8
5 files changed
+25 -6

No files matched your search

@@ -31,7 +31,10 @@ public class CrackedCommand implements CommandExecutor {
if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, sender.getName());
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy"));
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else {
//todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
@@ -59,7 +62,10 @@ public class CrackedCommand implements CommandExecutor {
if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, args[0]);
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy"));
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else {
//todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);
@@ -36,7 +36,10 @@ public class PremiumCommand implements CommandExecutor {
if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, sender.getName());
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy"));
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else {
// //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
@@ -65,7 +68,10 @@ public class PremiumCommand implements CommandExecutor {
if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, args[0]);
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy"));
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else {
//todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);
@@ -89,16 +89,21 @@ public class ForceLoginTask implements Runnable {
String message = plugin.getCore().getMessage("auto-register");
if (message != null) {
message = message.replace("%password", generatedPassword);
player.sendMessage(message);
}
player.sendMessage(message);
return success;
}
private boolean forceLogin(BukkitAuthPlugin authPlugin, Player player) {
plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName());
boolean success = authPlugin.forceLogin(player);
player.sendMessage(plugin.getCore().getMessage("auto-login"));
String message = plugin.getCore().getMessage("auto-login");
if (message != null) {
player.sendMessage(message);
}
return success;
}