diff --git a/Core/src/main/java/com/plotsquared/core/command/Backup.java b/Core/src/main/java/com/plotsquared/core/command/Backup.java index f9f45756e..861b1b3d9 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Backup.java +++ b/Core/src/main/java/com/plotsquared/core/command/Backup.java @@ -115,15 +115,15 @@ public final class Backup extends Command { if (plot == null) { sendMessage(player, Captions.NOT_IN_PLOT); } else if (!plot.hasOwner()) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "unowned"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_UNOWNED); } else if (plot.isMerged()) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "merged"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_MERGED.getTranslated()); } else if (!plot.isOwner(player.getUUID()) && !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_BACKUP_OTHER)) { sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_ADMIN_BACKUP_OTHER); } else { final BackupProfile backupProfile = Objects.requireNonNull(PlotSquared.imp()).getBackupManager().getProfile(plot); if (backupProfile instanceof NullBackupProfile) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "other"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_OTHER.getTranslated()); } else { backupProfile.createBackup().whenComplete((backup, throwable) -> { if (throwable != null) { @@ -149,15 +149,15 @@ public final class Backup extends Command { if (plot == null) { sendMessage(player, Captions.NOT_IN_PLOT); } else if (!plot.hasOwner()) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "unowned"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_UNOWNED); } else if (plot.isMerged()) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "merged"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_MERGED.getTranslated()); } else if (!plot.isOwner(player.getUUID()) && !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_BACKUP_OTHER)) { sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_ADMIN_BACKUP_OTHER); } else { final BackupProfile backupProfile = Objects.requireNonNull(PlotSquared.imp()).getBackupManager().getProfile(plot); if (backupProfile instanceof NullBackupProfile) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "other"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_OTHER.getTranslated()); } else { backupProfile.listBackups().whenComplete((backups, throwable) -> { // TODO: List backups @@ -179,8 +179,9 @@ public final class Backup extends Command { if (plot == null) { sendMessage(player, Captions.NOT_IN_PLOT); } else if (!plot.hasOwner()) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "unowned"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_UNOWNED); } else if (plot.isMerged()) { + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_MERGED.getTranslated()); sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "merged"); } else if (!plot.isOwner(player.getUUID()) && !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_BACKUP_OTHER)) { sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_ADMIN_BACKUP_OTHER); @@ -196,7 +197,7 @@ public final class Backup extends Command { } final BackupProfile backupProfile = Objects.requireNonNull(PlotSquared.imp()).getBackupManager().getProfile(plot); if (backupProfile instanceof NullBackupProfile) { - sendMessage(player, Captions.BACKUP_IMPOSSIBLE, "other"); + sendMessage(player, Captions.BACKUP_IMPOSSIBLE, Captions.GENERIC_OTHER.getTranslated()); } else { backupProfile.listBackups().whenComplete((backups, throwable) -> { // TODO: Load backups diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java index 7773d006c..20d6193ea 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java @@ -770,6 +770,12 @@ public enum Captions implements Caption { BACKUP_LOAD_USAGE("$1Usage: $2/plot backup load [#]", "Backups"), // + // + GENERIC_OTHER("other", "Generic"), + GENERIC_MERGED("merged", "Generic"), + GENERIC_UNOWNED("unowned", "Generic"), + // + /** * Legacy Configuration Conversion */