[Bugfix] Open command help
[Bugfix] Backups failing on save because of missing backups folder
This commit is contained in:
GeorgH93 2019-03-12 18:23:11 +01:00
parent dde3e77b7e
commit e618eca69a
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
2 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 GeorgH93
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -122,11 +122,11 @@ public List<String> tabComplete(@NotNull CommandSender commandSender, @NotNull S
public List<HelpData> getHelp(@NotNull CommandSender requester)
{
List<HelpData> help = new LinkedList<>();
help.add(new HelpData("", null, getDescription(), MessageClickEvent.ClickEventAction.RUN_COMMAND));
help.add(new HelpData(getTranslatedName(), null, getDescription(), MessageClickEvent.ClickEventAction.RUN_COMMAND));
if(requester.hasPermission("backpack.open.other"))
{
//noinspection ConstantConditions
help.add(new HelpData("", helpParam, descriptionOpenOthers));
help.add(new HelpData(getTranslatedName(), helpParam, descriptionOpenOthers));
}
return help;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016-2018 GeorgH93
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -66,6 +66,7 @@ public Database(Minepacks mp)
maxAge = plugin.getConfiguration().getAutoCleanupMaxInactiveDays();
unCacheStrategie = bungeeCordMode ? new OnDisconnect(this) : UnCacheStrategie.getUnCacheStrategie(this);
backupFolder = new File(this.plugin.getDataFolder(), "backups");
if(!backupFolder.exists()) backupFolder.mkdirs();
}
public void init()
@ -134,7 +135,7 @@ protected void writeBackup(@Nullable String userName, @NotNull String userIdenti
}
catch(Exception e)
{
plugin.getLogger().warning("Failed to write backup! Error: " + e.getMessage());
plugin.getLogger().warning(ConsoleColor.RED + "Failed to write backup! Error: " + e.getMessage() + ConsoleColor.RESET);
}
}