mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 03:30:10 +00:00
1.2.0 BETA 8
This commit is contained in:
parent
96c649bbe1
commit
71aee98c29
6 changed files with 15 additions and 4 deletions
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public class Commands {
|
|||
String[] addaliases = {"add", "a"};
|
||||
String[] whoaliases = {"who", "w"};
|
||||
String[] importaliases = {"import", "i"};
|
||||
|
||||
public static boolean debug = ProjectKorra.plugin.getConfig().getBoolean("debug");
|
||||
|
||||
private static BukkitTask importTask;
|
||||
private void init() {
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -351,4 +351,5 @@ Storage:
|
|||
port: 3306
|
||||
pass: ''
|
||||
db: minecraft
|
||||
user: root
|
||||
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