diff --git a/src/main/java/de/fanta/challenges/Challenges.java b/src/main/java/de/fanta/challenges/Challenges.java index a8ab1cf..3bb57c1 100644 --- a/src/main/java/de/fanta/challenges/Challenges.java +++ b/src/main/java/de/fanta/challenges/Challenges.java @@ -339,10 +339,11 @@ public FileConfiguration getItemConfig() { return ItemConfig; } + private void createItemConfig() { ItemConfigFile = new File(getDataFolder(), "items.yml"); - ItemConfigFile.getParentFile().mkdirs(); - saveResource("items.yml", true); + ItemConfigFile.getParentFile().mkdirs(); + saveResource("items.yml", true); this.ItemConfig = new YamlConfiguration(); try { ItemConfig.load(ItemConfigFile); @@ -426,16 +427,19 @@ } public void delteTexturePack() { - File texturepackdownload = new File("/home/web/fanta/AdventureMap-TexturePacks/" + texturepackid.toString()); - if (texturepackdownload.isDirectory()) { - try { - FileUtils.deleteDirectory(texturepackdownload); - getLogger().info("Adventure TexturePack deleted. " + texturepackdownload.getAbsolutePath()); - } catch (IOException e) { - throw new RuntimeException(e); - } + if (texturepackid != null) { + File texturepackdownload = new File("/home/web/fanta/AdventureMap-TexturePacks/" + texturepackid.toString()); + if (texturepackdownload.isDirectory()) { + try { + FileUtils.deleteDirectory(texturepackdownload); + getLogger().info("Adventure TexturePack deleted. " + texturepackdownload.getAbsolutePath()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } + } public void setPvP(Boolean value) { @@ -474,6 +478,7 @@ public boolean getKeepInventory() { return Bukkit.getWorld("world").getGameRuleValue(GameRule.KEEP_INVENTORY); } + public void setNaturalRegeneration(Boolean value) { for (World w : plugin.getServer().getWorlds()) { if (w != null) { @@ -545,6 +550,7 @@ public ArrayList getMaterials() { return materials; } + public ArrayList getAdvancements() { return advancements; }