mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-27 12:45:59 +01:00
minor fixes
This commit is contained in:
parent
68b3c1b95d
commit
101cd6b114
@ -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()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -71,7 +71,9 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
*/
|
||||
public static Flag getPlotFlag(Plot plot, String flag) {
|
||||
ArrayList<Flag> flags = new ArrayList<>();
|
||||
flags.addAll(plot.settings.flags);
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user