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) {
|
public static StockAbilities getAbility(int index) {
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return null;
|
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[] addaliases = {"add", "a"};
|
||||||
String[] whoaliases = {"who", "w"};
|
String[] whoaliases = {"who", "w"};
|
||||||
String[] importaliases = {"import", "i"};
|
String[] importaliases = {"import", "i"};
|
||||||
|
|
||||||
|
public static boolean debug = ProjectKorra.plugin.getConfig().getBoolean("debug");
|
||||||
|
|
||||||
private static BukkitTask importTask;
|
private static BukkitTask importTask;
|
||||||
private void init() {
|
private void init() {
|
||||||
|
@ -266,6 +268,9 @@ public class Commands {
|
||||||
final int total = bPlayers.size();
|
final int total = bPlayers.size();
|
||||||
final CommandSender sender = s;
|
final CommandSender sender = s;
|
||||||
s.sendMessage(ChatColor.GREEN + "Import of data started. Do NOT stop / reload your server.");
|
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() {
|
importTask = Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -276,7 +281,7 @@ public class Commands {
|
||||||
|
|
||||||
while (i < 10) {
|
while (i < 10) {
|
||||||
if (bPlayers.isEmpty()) {
|
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());
|
Bukkit.getServer().getScheduler().cancelTask(importTask.getTaskId());
|
||||||
for (Player player: Bukkit.getOnlinePlayers()) {
|
for (Player player: Bukkit.getOnlinePlayers()) {
|
||||||
Methods.createBendingPlayer(player.getUniqueId(), player.getName());
|
Methods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||||
|
@ -310,6 +315,9 @@ public class Commands {
|
||||||
// ex.printStackTrace();
|
// ex.printStackTrace();
|
||||||
// }
|
// }
|
||||||
i++;
|
i++;
|
||||||
|
if (debug) {
|
||||||
|
System.out.println("[ProjectKorra] Successfully imported " + bPlayer.player + ". " + bPlayers.size() + " players left to import.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 0, 40);
|
}, 0, 40);
|
||||||
|
|
|
@ -474,6 +474,7 @@ public class ConfigManager {
|
||||||
plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft");
|
plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft");
|
||||||
plugin.getConfig().addDefault("Storage.MySQL.user", "root");
|
plugin.getConfig().addDefault("Storage.MySQL.user", "root");
|
||||||
|
|
||||||
|
config.addDefault("debug", false);
|
||||||
plugin.getConfig().options().copyDefaults(true);
|
plugin.getConfig().options().copyDefaults(true);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,4 +351,5 @@ Storage:
|
||||||
port: 3306
|
port: 3306
|
||||||
pass: ''
|
pass: ''
|
||||||
db: minecraft
|
db: minecraft
|
||||||
user: root
|
user: root
|
||||||
|
debug: false
|
|
@ -1,6 +1,6 @@
|
||||||
name: ProjectKorra
|
name: ProjectKorra
|
||||||
author: ProjectKorra
|
author: ProjectKorra
|
||||||
version: 1.2.0 BETA 7
|
version: 1.2.0 BETA 8
|
||||||
main: com.projectkorra.ProjectKorra.ProjectKorra
|
main: com.projectkorra.ProjectKorra.ProjectKorra
|
||||||
commands:
|
commands:
|
||||||
projectkorra:
|
projectkorra:
|
||||||
|
|
Loading…
Reference in a new issue