Use ConfirmableCommand#askConfirmation(User, String, Runnable) in AdminSchemSaveCommand

This commit is contained in:
Florian CUNY 2018-09-03 15:55:00 +02:00
parent a7d001d578
commit cf11c1b9c1

View File

@ -33,8 +33,7 @@ public class AdminSchemSaveCommand extends ConfirmableCommand {
// Check if file exists
File newFile = new File(parent.getSchemsFolder(), args.get(0) + ".schem");
if (newFile.exists()) {
user.sendMessage("commands.admin.schem.file-exists");
this.askConfirmation(user, () -> clipboard.save(user, args.get(0)));
this.askConfirmation(user, user.getTranslation("commands.admin.schem.file-exists"), () -> clipboard.save(user, args.get(0)));
return false;
} else {
return clipboard.save(user, args.get(0));