minor fixes

This commit is contained in:
Jesse Boyd 2015-01-16 21:34:05 -08:00
parent 68b3c1b95d
commit 101cd6b114
4 changed files with 10 additions and 4 deletions

View File

@ -22,6 +22,7 @@
package com.intellectualcrafters.plot.api;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;
import org.bukkit.Bukkit;
@ -460,7 +461,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
}
}
}
return (Plot[]) pPlots.toArray();
return pPlots.toArray(new Plot[pPlots.size()]);
}
/**

View File

@ -240,6 +240,7 @@ public class PlotMeConverter {
}
sendMessage("Creating plot DB");
Thread.sleep(1000);
DBFunc.createPlots(createdPlots);
sendMessage("Creating settings/helpers DB");
DBFunc.createAllSettingsAndHelpers(createdPlots);

View File

@ -88,7 +88,7 @@ public class SQLManager implements AbstractDB {
// schedule reconnect
if (PlotMain.getMySQL() != null) {
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable() {
Bukkit.getScheduler().runTaskTimer(PlotMain.getMain(), new Runnable() {
@Override
public void run() {
try {
@ -283,7 +283,6 @@ public class SQLManager implements AbstractDB {
stmt.executeUpdate();
stmt.close();
} catch (final Exception e) {
e.printStackTrace();
PlotMain.sendConsoleSenderMessage("&6[WARN] "+"Could not bulk save. Conversion may be slower...");
try {
for (Plot plot : plots) {

View File

@ -71,7 +71,9 @@ import com.intellectualcrafters.plot.object.PlotWorld;
*/
public static Flag getPlotFlag(Plot plot, String flag) {
ArrayList<Flag> flags = new ArrayList<>();
if (plot.settings.flags != null && plot.settings.flags.size() > 0) {
flags.addAll(plot.settings.flags);
}
PlotWorld plotworld = PlotMain.getWorldSettings(plot.world);
if (plotworld != null && plotworld.DEFAULT_FLAGS != null && plotworld.DEFAULT_FLAGS.length > 0) {
flags.addAll(Arrays.asList(plotworld.DEFAULT_FLAGS));
@ -91,6 +93,9 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* @return
*/
public static Flag getPlotFlagAbs(Plot plot, String flag) {
if (plot.settings.flags == null || plot.settings.flags.size() == 0) {
return null;
}
for (final Flag myflag : plot.settings.flags) {
if (myflag.getKey().equals(flag)) {
return myflag;