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

View File

@ -1,8 +1,12 @@
######1.6
* Add a warning message if the user tries to invoke the premium command
* Added missing translation if the server isn't fully started
* Removed ProtocolLib as required dependency. You can use ProtocolSupport or BungeeCord as alternative
* Reduce the number of worker threads from 5 to 3 in ProtocolLib
* Process packets in ProtocolLib async/non-blocking -> better performance
* Fixed missing translation in commands
* Fixed cracked command not working on BungeeCord
* Fix error if forward skins is disabled
######1.5.2

View File

@ -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());
}
}
}

View File

@ -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);

View File

@ -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"));
}
}

View File

@ -91,7 +91,7 @@ public class PlayerConnectionListener implements Listener {
}
@EventHandler
public void onServerConnected(PlayerDisconnectEvent disconnectEvent) {
public void onDisconnect(PlayerDisconnectEvent disconnectEvent) {
ProxiedPlayer player = disconnectEvent.getPlayer();
plugin.getSession().remove(player.getPendingConnection());
}

View File

@ -100,6 +100,12 @@ nameChangeCheck: false
# ChangeSkin, SkinRestoer, ...
forwardSkin: true
# Displays a warning message that this message SHOULD only be invoked by
# users who actually are the owner of this account. So not by cracked players
#
# If they still want to invoke the command, they have to invoke /premium again
premium-warning: true
# Database configuration
# Recommened is the use of MariaDB (a better version of MySQL)

View File

@ -27,12 +27,18 @@ add-premium: '&2Added to the list of premium players'
# Player is already set be a paid account
already-exists: '&4You are already on the premium list'
# Player is already set be a paid account
already-exists-other: '&4You are already on the premium list'
# Player was changed to be cracked
remove-premium: '&2Removed from the list of premium players'
# Player is already set to be cracked
not-premium: '&4You are not in the premium list'
# Player is already set to be cracked
not-premium-other: '&4You are not in the premium list'
# Admin wanted to change the premium of a user that isn't known to the plugin
player-unknown: '&4Player not in the database'
@ -74,6 +80,13 @@ invalid-session: '&4Invalid session'
# The client sent a malicous packet without a login request packet
invalid-requst: '&4Invalid request'
# Message if the bukkit isn't fully started to inject the packets
not-started: '&cServer is not fully started yet. Please retry'
# Warning message if a user invoked /premium command
premium-warming: '&6WARNING: This command should only be invoked if you are the owner of this paid minecraft account
Type /premium again to confirm'
# ========= Bungee/Waterfall only ================================