mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 11:45:19 +01:00
Disable destructive operations for plot world plots
This commit is contained in:
parent
cc90127af9
commit
f13f7ce129
@ -137,6 +137,8 @@ public final class Backup extends Command {
|
||||
TranslatableCaption.of("backup_impossible"),
|
||||
Template.of("plot", "generic.generic_unowned")
|
||||
);
|
||||
} else if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||
} else if (plot.isMerged()) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("backup_impossible"),
|
||||
|
@ -65,6 +65,10 @@ public class Biome extends SetCommand {
|
||||
player.sendMessage(TranslatableCaption.of("errors.wait_for_timer"));
|
||||
return false;
|
||||
}
|
||||
if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||
return false;
|
||||
}
|
||||
plot.addRunning();
|
||||
plot.getPlotModificationManager().setBiome(biome, () -> {
|
||||
plot.removeRunning();
|
||||
|
@ -82,6 +82,10 @@ public class Clear extends Command {
|
||||
Template.of("value", "Clear"));
|
||||
return CompletableFuture.completedFuture(true);
|
||||
}
|
||||
if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||
return CompletableFuture.completedFuture(true);
|
||||
}
|
||||
boolean force = eventResult == Result.FORCE;
|
||||
checkTrue(force || plot.isOwner(player.getUUID()) || Permissions
|
||||
.hasPermission(player, "plots.admin.command.clear"),
|
||||
|
@ -74,6 +74,10 @@ public class Delete extends SubCommand {
|
||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||
return false;
|
||||
}
|
||||
if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||
return false;
|
||||
}
|
||||
Result eventResult = this.eventDispatcher.callDelete(plot).getEventResult();
|
||||
if (eventResult == Result.DENY) {
|
||||
player.sendMessage(
|
||||
|
Loading…
Reference in New Issue
Block a user