mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
1.2.0 BETA 8
This commit is contained in:
parent
96c649bbe1
commit
71aee98c29
Binary file not shown.
|
@ -79,6 +79,7 @@ public enum StockAbilities {
|
|||
public static StockAbilities getAbility(int index) {
|
||||
if (index == -1)
|
||||
return null;
|
||||
return (StockAbilities)Arrays.asList(values()).get(index);
|
||||
if (index > 41) return null;
|
||||
return Arrays.asList(StockAbilities.values()).get(index);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ public class Commands {
|
|||
String[] whoaliases = {"who", "w"};
|
||||
String[] importaliases = {"import", "i"};
|
||||
|
||||
public static boolean debug = ProjectKorra.plugin.getConfig().getBoolean("debug");
|
||||
|
||||
private static BukkitTask importTask;
|
||||
private void init() {
|
||||
PluginCommand projectkorra = plugin.getCommand("projectkorra");
|
||||
|
@ -266,6 +268,9 @@ public class Commands {
|
|||
final int total = bPlayers.size();
|
||||
final CommandSender sender = s;
|
||||
s.sendMessage(ChatColor.GREEN + "Import of data started. Do NOT stop / reload your server.");
|
||||
if (debug) {
|
||||
s.sendMessage(ChatColor.RED + "Console will print out all of the players that are imported as they import.");
|
||||
}
|
||||
importTask = Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||
public void run() {
|
||||
int i = 0;
|
||||
|
@ -276,7 +281,7 @@ public class Commands {
|
|||
|
||||
while (i < 10) {
|
||||
if (bPlayers.isEmpty()) {
|
||||
sender.sendMessage(ChatColor.GREEN + "Import complete, it may be best to reload your server.");
|
||||
sender.sendMessage(ChatColor.GREEN + "All data has been queued up, please allow up to 5 minutes for the data to complete, then reboot your server.");
|
||||
Bukkit.getServer().getScheduler().cancelTask(importTask.getTaskId());
|
||||
for (Player player: Bukkit.getOnlinePlayers()) {
|
||||
Methods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||
|
@ -310,6 +315,9 @@ public class Commands {
|
|||
// ex.printStackTrace();
|
||||
// }
|
||||
i++;
|
||||
if (debug) {
|
||||
System.out.println("[ProjectKorra] Successfully imported " + bPlayer.player + ". " + bPlayers.size() + " players left to import.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 0, 40);
|
||||
|
|
|
@ -474,6 +474,7 @@ public class ConfigManager {
|
|||
plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft");
|
||||
plugin.getConfig().addDefault("Storage.MySQL.user", "root");
|
||||
|
||||
config.addDefault("debug", false);
|
||||
plugin.getConfig().options().copyDefaults(true);
|
||||
plugin.saveConfig();
|
||||
}
|
||||
|
|
|
@ -352,3 +352,4 @@ Storage:
|
|||
pass: ''
|
||||
db: minecraft
|
||||
user: root
|
||||
debug: false
|
|
@ -1,6 +1,6 @@
|
|||
name: ProjectKorra
|
||||
author: ProjectKorra
|
||||
version: 1.2.0 BETA 7
|
||||
version: 1.2.0 BETA 8
|
||||
main: com.projectkorra.ProjectKorra.ProjectKorra
|
||||
commands:
|
||||
projectkorra:
|
||||
|
|
Loading…
Reference in a new issue