Prevent pasting schematics onto merged plots.

This commit is contained in:
Alexander Söderberg 2020-02-23 22:57:24 +01:00
parent 4ba1ae9aee
commit 554e3981fd
2 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,10 @@ public class SchematicCmd extends SubCommand {
MainUtil.sendMessage(player, Captions.TASK_IN_PROCESS); MainUtil.sendMessage(player, Captions.TASK_IN_PROCESS);
return false; return false;
} }
if (plot.isMerged()) {
MainUtil.sendMessage(player, Captions.SCHEMATIC_PASTE_MERGED);
return false;
}
final String location = args[1]; final String location = args[1];
this.running = true; this.running = true;
TaskManager.runTaskAsync(() -> { TaskManager.runTaskAsync(() -> {

View File

@ -322,6 +322,7 @@ public enum Captions {
SCHEMATIC_MISSING_ARG("$2You need to specify an argument. Possible values: $1save$2, $1paste $2, $1exportall$2, $1list", "Schematics"), SCHEMATIC_MISSING_ARG("$2You need to specify an argument. Possible values: $1save$2, $1paste $2, $1exportall$2, $1list", "Schematics"),
SCHEMATIC_INVALID("$2That is not a valid schematic. Reason: $2%s", "Schematics"), SCHEMATIC_INVALID("$2That is not a valid schematic. Reason: $2%s", "Schematics"),
SCHEMATIC_VALID("$2That is a valid schematic", "Schematics"), SCHEMATIC_VALID("$2That is a valid schematic", "Schematics"),
SCHEMATIC_PASTE_MERGED("$2Schematics cannot be pasted onto merged plots. Please unmerge the plot before performing the paste.", "Schematics"),
SCHEMATIC_PASTE_FAILED("$2Failed to paste the schematic", "Schematics"), SCHEMATIC_PASTE_FAILED("$2Failed to paste the schematic", "Schematics"),
SCHEMATIC_PASTE_SUCCESS("$4The schematic pasted successfully", "Schematics"), SCHEMATIC_PASTE_SUCCESS("$4The schematic pasted successfully", "Schematics"),
SCHEMATIC_LIST("$4Saved Schematics: $1%s", "Schematics"), SCHEMATIC_LIST("$4Saved Schematics: $1%s", "Schematics"),