mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +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"),
|
TranslatableCaption.of("backup_impossible"),
|
||||||
Template.of("plot", "generic.generic_unowned")
|
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()) {
|
} else if (plot.isMerged()) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("backup_impossible"),
|
TranslatableCaption.of("backup_impossible"),
|
||||||
|
@ -65,6 +65,10 @@ public class Biome extends SetCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.wait_for_timer"));
|
player.sendMessage(TranslatableCaption.of("errors.wait_for_timer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||||
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
plot.addRunning();
|
plot.addRunning();
|
||||||
plot.getPlotModificationManager().setBiome(biome, () -> {
|
plot.getPlotModificationManager().setBiome(biome, () -> {
|
||||||
plot.removeRunning();
|
plot.removeRunning();
|
||||||
|
@ -82,6 +82,10 @@ public class Clear extends Command {
|
|||||||
Template.of("value", "Clear"));
|
Template.of("value", "Clear"));
|
||||||
return CompletableFuture.completedFuture(true);
|
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;
|
boolean force = eventResult == Result.FORCE;
|
||||||
checkTrue(force || plot.isOwner(player.getUUID()) || Permissions
|
checkTrue(force || plot.isOwner(player.getUUID()) || Permissions
|
||||||
.hasPermission(player, "plots.admin.command.clear"),
|
.hasPermission(player, "plots.admin.command.clear"),
|
||||||
|
@ -74,6 +74,10 @@ public class Delete extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
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();
|
Result eventResult = this.eventDispatcher.callDelete(plot).getEventResult();
|
||||||
if (eventResult == Result.DENY) {
|
if (eventResult == Result.DENY) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
|
Loading…
Reference in New Issue
Block a user