From b21b12f6a59efcfaf584680ed33eec33af5d545c Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Mon, 13 Aug 2018 02:57:54 +0200 Subject: [PATCH] Added hardcoded default values for config to avoid Exceptions --- plugin.yml | 2 +- src/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index a8cbbaf..90aab00 100644 --- a/plugin.yml +++ b/plugin.yml @@ -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 diff --git a/src/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java b/src/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java index b41d460..83dd968 100644 --- a/src/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java +++ b/src/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java @@ -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) {