Added hardcoded default values for config to avoid Exceptions

This commit is contained in:
mfnalex 2018-08-13 02:57:54 +02:00
parent 87bb4231a3
commit b21b12f6a5
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,6 @@
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
name: ChestSort
version: 1.3.9
version: 1.3.10
api-version: 1.13
description: Allows automatic chest sorting
author: mfnalex

View File

@ -42,6 +42,16 @@ public class JeffChestSortPlugin extends JavaPlugin {
File playerDataFolder = new File(getDataFolder().getPath() + File.separator + "playerdata");
if (!playerDataFolder.exists())
playerDataFolder.mkdir();
getConfig().addDefault("sorting-enabled-by-default", false);
getConfig().addDefault("show-message-when-using-chest", true);
getConfig().addDefault("show-message-when-using-chest-and-sorting-is-enabled", false);
getConfig().addDefault("show-message-again-after-logout", true);
getConfig().addDefault("message-when-using-chest","&7Hint: Type &6/chestsort&7 to enable automatic chest sorting.");
getConfig().addDefault("message-when-using-chest2","&7Hint: Type &6/chestsort&7 to disable automatic chest sorting.");
getConfig().addDefault("message-sorting-disabled","&7Automatic chest sorting has been &cdisabled&7.&r");
getConfig().addDefault("message-sorting-enabled","&7Automatic chest sorting has been &aenabled&7.&r");
getConfig().addDefault("message-error-players-only","&cError: This command can only be run by players.&r");
}
String getSortableString(ItemStack item) {