mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +01:00
Fixed purge command
This commit is contained in:
parent
bcd113146b
commit
a3c8ba84ab
@ -1253,6 +1253,10 @@ import java.util.concurrent.TimeUnit;
|
||||
managers.remove(world);
|
||||
worlds.remove(world);
|
||||
}
|
||||
|
||||
public static void removePlots(final String world) {
|
||||
plots.put(world, new HashMap<PlotId, Plot>());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all plots
|
||||
|
@ -59,7 +59,8 @@ import org.bukkit.entity.Player;
|
||||
return true;
|
||||
} 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");
|
||||
PlayerFunctions.sendMessage(plr, "Use /plots purge <world>;<x>;<z>");
|
||||
PlayerFunctions.sendMessage(plr, "To purge all plots use /plots purge <world> -o");
|
||||
return false;
|
||||
}
|
||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
||||
@ -73,12 +74,13 @@ import org.bukkit.entity.Player;
|
||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_WORLD);
|
||||
return false;
|
||||
}
|
||||
PlotMain.removePlotWorld(args[0]);
|
||||
PlotMain.removePlots(args[0]);
|
||||
DBFunc.purge(args[0]);
|
||||
PlayerFunctions.sendMessage(plr, (C.PURGE_SUCCESS));
|
||||
return true;
|
||||
} else {
|
||||
PlayerFunctions.sendMessage(plr, "This is a dangerous command, if you are sure, use /plot purge {world} -o");
|
||||
PlayerFunctions.sendMessage(plr, "Use /plots purge <world>;<x>;<z>");
|
||||
PlayerFunctions.sendMessage(plr, "To purge all plots use /plots purge <world> -o");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -866,7 +866,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
|
||||
stmt = SQLManager.this.connection.prepareStatement("DELETE FROM `" + prefix + "plot` WHERE `plot_plot_id` = " + idstr + "");
|
||||
stmt = SQLManager.this.connection.prepareStatement("DELETE FROM `" + prefix + "plot` WHERE `id` = " + idstr + "");
|
||||
stmt.setString(1, world);
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
|
Loading…
Reference in New Issue
Block a user