This commit is contained in:
boy0001 2015-04-11 14:07:19 +10:00
parent 6ec4668177
commit 09424c30b4
5 changed files with 13 additions and 6 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>2.9.9</version>
<version>2.9.11</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -146,6 +146,14 @@ public class PlotSquared {
return new LinkedHashSet<>(newplots);
}
public static Set<Plot> getPlotsRaw() {
final ArrayList<Plot> newplots = new ArrayList<>();
for (final Entry<String, HashMap<PlotId, Plot>> entry : plots.entrySet()) {
newplots.addAll(entry.getValue().values());
}
return new LinkedHashSet<>(newplots);
}
public static ArrayList<Plot> sortPlots(Collection<Plot> plots) {
ArrayList<Plot> newPlots = new ArrayList<>();
newPlots.addAll(plots);

View File

@ -90,7 +90,7 @@ public class Denied extends SubCommand {
}
final PlotPlayer player = UUIDHandler.getPlayer(uuid);
if (!uuid.equals(DBFunc.everyone) && (player != null) && player.isOnline()) {
final Plot pl = MainUtil.getPlot(loc);
final Plot pl = MainUtil.getPlot(player.getLocation());
if ((pl != null) && pl.id.equals(plot.id)) {
MainUtil.sendMessage(player, C.YOU_BE_DENIED);
player.teleport(BlockManager.manager.getSpawn(loc.getWorld()));

View File

@ -584,7 +584,7 @@ public class SQLManager implements AbstractDB {
public void updateTables() {
try {
final DatabaseMetaData data = this.connection.getMetaData();
ResultSet rs = data.getColumns(null, null, this.prefix + "plot_comments", "plot");
ResultSet rs = data.getColumns(null, null, this.prefix + "plot_comments", "plot_plot_id");
if (rs.next()) {
rs = data.getColumns(null, null, this.prefix + "plot_comments", "hashcode");
if (!rs.next()) {

View File

@ -67,7 +67,7 @@ public class FlagManager {
}
}
if (PlotSquared.getAllPlotsRaw() != null) {
for (final Plot plot : PlotSquared.getPlots()) {
for (final Plot plot : PlotSquared.getPlotsRaw()) {
for (final Flag flag : plot.settings.flags) {
if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
flag.setKey(af);
@ -319,7 +319,6 @@ public class FlagManager {
public static AbstractFlag getFlag(final String string, final boolean create) {
if ((getFlag(string) == null) && create) {
final AbstractFlag flag = new AbstractFlag(string);
addFlag(flag);
return flag;
}
return getFlag(string);