mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Fixed purge command
This commit is contained in:
parent
bcd113146b
commit
a3c8ba84ab
@ -1254,6 +1254,10 @@ import java.util.concurrent.TimeUnit;
|
|||||||
worlds.remove(world);
|
worlds.remove(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void removePlots(final String world) {
|
||||||
|
plots.put(world, new HashMap<PlotId, Plot>());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all plots
|
* Get all plots
|
||||||
*
|
*
|
||||||
|
@ -59,7 +59,8 @@ import org.bukkit.entity.Player;
|
|||||||
return true;
|
return true;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
if (args.length == 1) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_WORLD);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PlotMain.removePlotWorld(args[0]);
|
PlotMain.removePlots(args[0]);
|
||||||
DBFunc.purge(args[0]);
|
DBFunc.purge(args[0]);
|
||||||
PlayerFunctions.sendMessage(plr, (C.PURGE_SUCCESS));
|
PlayerFunctions.sendMessage(plr, (C.PURGE_SUCCESS));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} 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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -866,7 +866,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
stmt.close();
|
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.setString(1, world);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user