From 46fbc05040393926345a6358127c51f8b9180a4d Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Sat, 20 Feb 2021 19:41:58 +0100 Subject: [PATCH] Don't fail to load when moving components file --- .../core/components/ComponentPresetManager.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java index 35347b7c8..7419761d8 100644 --- a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java +++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java @@ -89,15 +89,14 @@ public class ComponentPresetManager { Path oldLoc = Paths.get(PlotSquared.platform().getDirectory() + "/components.yml"); Path newLoc = Paths.get(PlotSquared.platform().getDirectory() + "/config" + "/components.yml"); Files.move(oldLoc, newLoc); - } else { - try { - this.componentsFile = new File(folder, "components.yml"); - if (!this.componentsFile.exists() && !this.componentsFile.createNewFile()) { - logger.error("Could not create the components.yml file. Please create 'components.yml' manually."); - } - } catch (IOException e) { - e.printStackTrace(); + } + try { + this.componentsFile = new File(folder, "components.yml"); + if (!this.componentsFile.exists() && !this.componentsFile.createNewFile()) { + logger.error("Could not create the components.yml file. Please create 'components.yml' manually."); } + } catch (IOException e) { + e.printStackTrace(); } ConfigurationSerialization.registerClass(ComponentPreset.class, "ComponentPreset");