mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
minor fixes
This commit is contained in:
parent
68b3c1b95d
commit
101cd6b114
@ -22,6 +22,7 @@
|
|||||||
package com.intellectualcrafters.plot.api;
|
package com.intellectualcrafters.plot.api;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
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");
|
sendMessage("Creating plot DB");
|
||||||
|
Thread.sleep(1000);
|
||||||
DBFunc.createPlots(createdPlots);
|
DBFunc.createPlots(createdPlots);
|
||||||
sendMessage("Creating settings/helpers DB");
|
sendMessage("Creating settings/helpers DB");
|
||||||
DBFunc.createAllSettingsAndHelpers(createdPlots);
|
DBFunc.createAllSettingsAndHelpers(createdPlots);
|
||||||
|
@ -88,7 +88,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
|
|
||||||
// schedule reconnect
|
// schedule reconnect
|
||||||
if (PlotMain.getMySQL() != null) {
|
if (PlotMain.getMySQL() != null) {
|
||||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable() {
|
Bukkit.getScheduler().runTaskTimer(PlotMain.getMain(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@ -283,7 +283,6 @@ public class SQLManager implements AbstractDB {
|
|||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
PlotMain.sendConsoleSenderMessage("&6[WARN] "+"Could not bulk save. Conversion may be slower...");
|
PlotMain.sendConsoleSenderMessage("&6[WARN] "+"Could not bulk save. Conversion may be slower...");
|
||||||
try {
|
try {
|
||||||
for (Plot plot : plots) {
|
for (Plot plot : plots) {
|
||||||
|
@ -71,7 +71,9 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
|||||||
*/
|
*/
|
||||||
public static Flag getPlotFlag(Plot plot, String flag) {
|
public static Flag getPlotFlag(Plot plot, String flag) {
|
||||||
ArrayList<Flag> flags = new ArrayList<>();
|
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);
|
PlotWorld plotworld = PlotMain.getWorldSettings(plot.world);
|
||||||
if (plotworld != null && plotworld.DEFAULT_FLAGS != null && plotworld.DEFAULT_FLAGS.length > 0) {
|
if (plotworld != null && plotworld.DEFAULT_FLAGS != null && plotworld.DEFAULT_FLAGS.length > 0) {
|
||||||
flags.addAll(Arrays.asList(plotworld.DEFAULT_FLAGS));
|
flags.addAll(Arrays.asList(plotworld.DEFAULT_FLAGS));
|
||||||
@ -91,6 +93,9 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Flag getPlotFlagAbs(Plot plot, String flag) {
|
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) {
|
for (final Flag myflag : plot.settings.flags) {
|
||||||
if (myflag.getKey().equals(flag)) {
|
if (myflag.getKey().equals(flag)) {
|
||||||
return myflag;
|
return myflag;
|
||||||
|
Loading…
Reference in New Issue
Block a user