mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 03:30:10 +00:00
General cleanup from BETA 3
This commit is contained in:
parent
6b8da55145
commit
e7c6ed70f6
6 changed files with 7 additions and 10 deletions
|
@ -254,7 +254,7 @@ public class BendingPlayer {
|
|||
public void setAbilities(HashMap<Integer, String> abilities) {
|
||||
this.abilities = abilities;
|
||||
for (int i = 1; i <= 9; i++) {
|
||||
DBConnection.sql.modifyQuery("UPDATE pk_players SET slot" + i + " = '" + (abilities.get(i) == null ? null : abilities.get(i)) + "' WHERE uuid = '" + uuid + "'");
|
||||
DBConnection.sql.modifyQuery("UPDATE pk_players SET slot" + i + " = '" + abilities.get(i) + "' WHERE uuid = '" + uuid + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ import com.projectkorra.projectkorra.firebending.FireBlast;
|
|||
import com.projectkorra.projectkorra.firebending.FireCombo;
|
||||
import com.projectkorra.projectkorra.firebending.FireMethods;
|
||||
import com.projectkorra.projectkorra.firebending.FireShield;
|
||||
import com.projectkorra.projectkorra.object.Preset;
|
||||
import com.projectkorra.projectkorra.storage.DBConnection;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
|
@ -448,7 +447,7 @@ public class GeneralMethods {
|
|||
for (int i = 1; i <= 9; i++) {
|
||||
String slot = rs2.getString("slot" + i);
|
||||
|
||||
if (slot != null) {
|
||||
if (slot != null && !slot.equalsIgnoreCase("null")) {
|
||||
abilities.put(i, slot);
|
||||
}
|
||||
}
|
||||
|
@ -1642,7 +1641,6 @@ public class GeneralMethods {
|
|||
}
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||
Preset.loadPresets(player);
|
||||
}
|
||||
plugin.updater.checkUpdate();
|
||||
ProjectKorra.log.info("Reload complete");
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.projectkorra.projectkorra.command.Commands;
|
|||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||
import com.projectkorra.projectkorra.earthbending.EarthbendingManager;
|
||||
import com.projectkorra.projectkorra.firebending.FirebendingManager;
|
||||
import com.projectkorra.projectkorra.object.Preset;
|
||||
import com.projectkorra.projectkorra.storage.DBConnection;
|
||||
import com.projectkorra.projectkorra.util.MetricsLite;
|
||||
import com.projectkorra.projectkorra.util.RevertChecker;
|
||||
|
@ -82,7 +81,6 @@ public class ProjectKorra extends JavaPlugin {
|
|||
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||
Preset.loadPresets(player);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -82,6 +82,7 @@ public class ImportCommand extends PKCommand {
|
|||
bPlayers.add(bPlayer);
|
||||
}
|
||||
|
||||
final CommandSender s = sender;
|
||||
final int total = bPlayers.size();
|
||||
sender.sendMessage(ChatColor.GREEN + "Import of data started. Do NOT stop / reload your server.");
|
||||
if (debugEnabled) {
|
||||
|
@ -91,13 +92,13 @@ public class ImportCommand extends PKCommand {
|
|||
public void run() {
|
||||
int i = 0;
|
||||
if (i >= 10) {
|
||||
sender.sendMessage(ChatColor.GREEN + "10 / " + total + " players converted thus far!");
|
||||
s.sendMessage(ChatColor.GREEN + "10 / " + total + " players converted thus far!");
|
||||
return;
|
||||
}
|
||||
|
||||
while (i < 10) {
|
||||
if (bPlayers.isEmpty()) {
|
||||
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.");
|
||||
s.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());
|
||||
ProjectKorra.plugin.getConfig().set("Properties.ImportEnabled", false);
|
||||
ProjectKorra.plugin.saveConfig();
|
||||
|
|
|
@ -122,7 +122,7 @@ public class WhoCommand extends PKCommand {
|
|||
* @param sender The CommandSender to display the information to
|
||||
* @param playerName The Player to look up
|
||||
*/
|
||||
private void whoPlayer(CommandSender sender, String playerName) {
|
||||
private void whoPlayer(final CommandSender sender, final String playerName) {
|
||||
Player player = Bukkit.getPlayer(playerName);
|
||||
if (player != null) {
|
||||
sender.sendMessage(playerName + " - ");
|
||||
|
|
|
@ -240,7 +240,7 @@ public class Preset {
|
|||
catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (Integer i : abilities.keySet()) {
|
||||
for (final Integer i : abilities.keySet()) {
|
||||
new BukkitRunnable() {
|
||||
PreparedStatement ps;
|
||||
|
||||
|
|
Loading…
Reference in a new issue