mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixed purge command
This commit is contained in:
parent
9775ad3dd2
commit
e1dea5a450
@ -43,8 +43,6 @@ import org.bukkit.entity.Player;
|
|||||||
final String world = split[0];
|
final String world = split[0];
|
||||||
final PlotId id = new PlotId(Integer.parseInt(split[1]), Integer.parseInt(split[2]));
|
final PlotId id = new PlotId(Integer.parseInt(split[1]), Integer.parseInt(split[2]));
|
||||||
|
|
||||||
System.out.print("VALID ID");
|
|
||||||
|
|
||||||
if (plr != null) {
|
if (plr != null) {
|
||||||
PlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
|
PlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
|
||||||
return false;
|
return false;
|
||||||
@ -54,11 +52,16 @@ import org.bukkit.entity.Player;
|
|||||||
PlayerFunctions.sendMessage(null, C.NOT_VALID_PLOT_WORLD);
|
PlayerFunctions.sendMessage(null, C.NOT_VALID_PLOT_WORLD);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlotMain.getPlots(world).remove(id);
|
PlotMain.getPlots(world).remove(id);
|
||||||
DBFunc.purge(world, id);
|
DBFunc.purge(world, id);
|
||||||
PlayerFunctions.sendMessage(null, "&aPurge of '" + args[0] + "' was successful!");
|
PlayerFunctions.sendMessage(null, "&aPurge of '" + args[0] + "' was successful!");
|
||||||
return true;
|
return true;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
|
if (args.length == 1) {
|
||||||
|
PlayerFunctions.sendMessage(plr, "This is a dangerous command, if you are sure, use /plot purge {world} -o");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -783,14 +783,14 @@ public class SQLManager implements AbstractDB {
|
|||||||
if (ids.size() > 0) {
|
if (ids.size() > 0) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String prefix = "";
|
String p = "";
|
||||||
final StringBuilder idstr = new StringBuilder("");
|
final StringBuilder idstr = new StringBuilder("");
|
||||||
|
|
||||||
for (final Integer id : ids) {
|
for (final Integer id : ids) {
|
||||||
idstr.append(prefix + id);
|
idstr.append(p + id);
|
||||||
prefix = " OR `plot_plot_id` = ";
|
p = " OR `plot_plot_id` = ";
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = SQLManager.this.connection.prepareStatement("DELETE FROM `" + prefix + "plot_helpers` WHERE `plot_plot_id` = " + idstr + "");
|
PreparedStatement stmt = SQLManager.this.connection.prepareStatement("DELETE FROM `" + prefix + "plot_helpers` WHERE `plot_plot_id` = " + idstr + "");
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
@ -185,7 +185,7 @@ import java.util.UUID;
|
|||||||
if (plot.settings.getFlag("weather") != null) {
|
if (plot.settings.getFlag("weather") != null) {
|
||||||
player.setPlayerWeather(getWeatherType(plot.settings.getFlag("weather").getValue()));
|
player.setPlayerWeather(getWeatherType(plot.settings.getFlag("weather").getValue()));
|
||||||
}
|
}
|
||||||
if (booleanFlag(plot, "titles") && Settings.TITLES && (C.TITLE_ENTERED_PLOT.s().length() > 2)) {
|
if ((booleanFlag(plot, "titles") || Settings.TITLES) && (C.TITLE_ENTERED_PLOT.s().length() > 2)) {
|
||||||
final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceFirst("%s", plot.getDisplayName());
|
final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceFirst("%s", plot.getDisplayName());
|
||||||
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
|
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
|
||||||
final ChatColor sTitleMainColor = ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s());
|
final ChatColor sTitleMainColor = ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s());
|
||||||
|
Loading…
Reference in New Issue
Block a user