From 554e3981fd7a0f8dbcad39d1b8889b8c1565b8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 23 Feb 2020 22:57:24 +0100 Subject: [PATCH] Prevent pasting schematics onto merged plots. --- .../plotsquared/plot/commands/SchematicCmd.java | 4 ++++ .../intellectualsites/plotsquared/plot/config/Captions.java | 1 + 2 files changed, 5 insertions(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java index 130f2ad1d..70b03afcc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java @@ -65,6 +65,10 @@ public class SchematicCmd extends SubCommand { MainUtil.sendMessage(player, Captions.TASK_IN_PROCESS); return false; } + if (plot.isMerged()) { + MainUtil.sendMessage(player, Captions.SCHEMATIC_PASTE_MERGED); + return false; + } final String location = args[1]; this.running = true; TaskManager.runTaskAsync(() -> { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index 3c5064e70..8c490bf6e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -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_INVALID("$2That is not a valid schematic. Reason: $2%s", "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_SUCCESS("$4The schematic pasted successfully", "Schematics"), SCHEMATIC_LIST("$4Saved Schematics: $1%s", "Schematics"),