mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 05:36:45 +01:00
fixes #251
This commit is contained in:
parent
6ec4668177
commit
09424c30b4
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>2.9.11</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -146,6 +146,14 @@ public class PlotSquared {
|
|||||||
return new LinkedHashSet<>(newplots);
|
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) {
|
public static ArrayList<Plot> sortPlots(Collection<Plot> plots) {
|
||||||
ArrayList<Plot> newPlots = new ArrayList<>();
|
ArrayList<Plot> newPlots = new ArrayList<>();
|
||||||
newPlots.addAll(plots);
|
newPlots.addAll(plots);
|
||||||
|
@ -90,7 +90,7 @@ public class Denied extends SubCommand {
|
|||||||
}
|
}
|
||||||
final PlotPlayer player = UUIDHandler.getPlayer(uuid);
|
final PlotPlayer player = UUIDHandler.getPlayer(uuid);
|
||||||
if (!uuid.equals(DBFunc.everyone) && (player != null) && player.isOnline()) {
|
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)) {
|
if ((pl != null) && pl.id.equals(plot.id)) {
|
||||||
MainUtil.sendMessage(player, C.YOU_BE_DENIED);
|
MainUtil.sendMessage(player, C.YOU_BE_DENIED);
|
||||||
player.teleport(BlockManager.manager.getSpawn(loc.getWorld()));
|
player.teleport(BlockManager.manager.getSpawn(loc.getWorld()));
|
||||||
|
@ -584,9 +584,9 @@ public class SQLManager implements AbstractDB {
|
|||||||
public void updateTables() {
|
public void updateTables() {
|
||||||
try {
|
try {
|
||||||
final DatabaseMetaData data = this.connection.getMetaData();
|
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()) {
|
if (rs.next()) {
|
||||||
rs = data.getColumns(null, null, this.prefix + "plot_comments", "hashcode");
|
rs = data.getColumns(null, null, this.prefix + "plot_comments", "hashcode");
|
||||||
if (!rs.next()) {
|
if (!rs.next()) {
|
||||||
rs.close();
|
rs.close();
|
||||||
final Statement statement = this.connection.createStatement();
|
final Statement statement = this.connection.createStatement();
|
||||||
|
@ -67,7 +67,7 @@ public class FlagManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PlotSquared.getAllPlotsRaw() != null) {
|
if (PlotSquared.getAllPlotsRaw() != null) {
|
||||||
for (final Plot plot : PlotSquared.getPlots()) {
|
for (final Plot plot : PlotSquared.getPlotsRaw()) {
|
||||||
for (final Flag flag : plot.settings.flags) {
|
for (final Flag flag : plot.settings.flags) {
|
||||||
if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
|
if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
|
||||||
flag.setKey(af);
|
flag.setKey(af);
|
||||||
@ -319,7 +319,6 @@ public class FlagManager {
|
|||||||
public static AbstractFlag getFlag(final String string, final boolean create) {
|
public static AbstractFlag getFlag(final String string, final boolean create) {
|
||||||
if ((getFlag(string) == null) && create) {
|
if ((getFlag(string) == null) && create) {
|
||||||
final AbstractFlag flag = new AbstractFlag(string);
|
final AbstractFlag flag = new AbstractFlag(string);
|
||||||
addFlag(flag);
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
return getFlag(string);
|
return getFlag(string);
|
||||||
|
Loading…
Reference in New Issue
Block a user