Fix missing translation

This commit is contained in:
games647
2016-06-15 13:26:20 +02:00
parent 4800a88886
commit b74faa2fd5
7 changed files with 36 additions and 13 deletions
@@ -6,7 +6,6 @@ import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@@ -39,7 +38,7 @@ public class CrackedCommand implements CommandExecutor {
//todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
if (profile.isPremium()) {
sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players");
sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
profile.setPremium(false);
profile.setUuid(null);
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@@ -49,7 +48,7 @@ public class CrackedCommand implements CommandExecutor {
}
});
} else {
sender.sendMessage(ChatColor.DARK_RED + "You are not in the premium list");
sender.sendMessage(plugin.getCore().getMessage("not-premium"));
}
}
@@ -75,7 +74,7 @@ public class CrackedCommand implements CommandExecutor {
}
if (profile.isPremium()) {
sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players");
sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
profile.setPremium(false);
profile.setUuid(null);
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@@ -85,7 +84,7 @@ public class CrackedCommand implements CommandExecutor {
}
});
} else {
sender.sendMessage(ChatColor.DARK_RED + "Player is not in the premium list");
sender.sendMessage(plugin.getCore().getMessage("not-premium-other"));
}
}
}
@@ -97,6 +96,7 @@ public class CrackedCommand implements CommandExecutor {
if (sender instanceof Player) {
notifiyBungeeCord((Player) sender, target);
} else {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
//todo: add console support
// Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
// notifiyBungeeCord(firstPlayer, target);
@@ -109,7 +109,7 @@ public class CrackedCommand implements CommandExecutor {
dataOutput.writeUTF("OFF");
dataOutput.writeUTF(target);
plugin.getLogger().info("No player online to send a plugin message to the proxy");
sender.sendPluginMessage(plugin, plugin.getName(), dataOutput.toByteArray());
}
}
}
@@ -6,7 +6,6 @@ import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@@ -44,7 +43,7 @@ public class PremiumCommand implements CommandExecutor {
// //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
if (profile.isPremium()) {
sender.sendMessage(ChatColor.DARK_RED + "You are already on the premium list");
sender.sendMessage(plugin.getCore().getMessage("already-exists"));
} else {
//todo: resolve uuid
profile.setPremium(true);
@@ -55,7 +54,7 @@ public class PremiumCommand implements CommandExecutor {
}
});
sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players");
sender.sendMessage(plugin.getCore().getMessage("add-premium"));
}
}
@@ -81,7 +80,7 @@ public class PremiumCommand implements CommandExecutor {
}
if (profile.isPremium()) {
sender.sendMessage(ChatColor.DARK_RED + "Player is already on the premium list");
sender.sendMessage(plugin.getCore().getMessage("already-exists-other"));
} else {
//todo: resolve uuid
profile.setPremium(true);
@@ -92,7 +91,7 @@ public class PremiumCommand implements CommandExecutor {
}
});
sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players");
sender.sendMessage(plugin.getCore().getMessage("add-premium"));
}
}
}
@@ -104,6 +103,7 @@ public class PremiumCommand implements CommandExecutor {
if (sender instanceof Player) {
notifiyBungeeCord((Player) sender, target);
} else {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
//todo: add console support
// Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
// notifiyBungeeCord(firstPlayer, target);
@@ -30,7 +30,7 @@ public class BukkitJoinListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerLogin(PlayerLoginEvent loginEvent) {
if (loginEvent.getResult() == Result.ALLOWED && !plugin.isServerFullyStarted()) {
loginEvent.disallow(Result.KICK_OTHER, "§cServer is not fully started yet. Please retry");
loginEvent.disallow(Result.KICK_OTHER, plugin.getCore().getMessage("not-started"));
}
}