@@ -91,19 +91,17 @@ public void onEnable() {
9191 Settings .FAWE = false ;
9292 }
9393
94- final Map data ;
94+ String schemDirName ;
9595 try {
96- File weConfig = new File (getWorldEditPlugin ().getDataFolder (), (Settings .FAWE ? "worldedit-" : "" ) + "config" + ".yml" );
97- Yaml yaml = new Yaml ();
98- data = yaml .load (new FileInputStream (weConfig ));
99- } catch (IOException e ){
100- getLogger ().severe (I18nSupport .getInternationalisedString ("Startup - Error reading WE config" ));
96+ // Try loading from API
97+ schemDirName = worldEditPlugin .getLocalConfiguration ().saveDir ;
98+ } catch (Exception e ) {
10199 e .printStackTrace ();
100+ getLogger ().severe (I18nSupport .getInternationalisedString ("Startup - Error reading WE config" ));
102101 getServer ().getPluginManager ().disablePlugin (this );
103102 return ;
104103 }
105-
106- File schemDir = new File (worldEditPlugin .getDataFolder (), (String ) ((Map ) data .get ("saving" )).get ("dir" ));
104+ File schemDir = new File (worldEditPlugin .getDataFolder (), schemDirName );
107105 worldEditHandler = new WorldEditHandler (schemDir , this );
108106
109107 boolean foundRegionProvider = false ;
@@ -135,7 +133,7 @@ public void onEnable() {
135133 getLogger ().info (I18nSupport .getInternationalisedString ("Startup - Restrict to regions set to false" ));
136134 }
137135
138- getCommand ("structurebox" ).setExecutor (new StructureBoxCommand ());
136+ getCommand ("structurebox" ).setExecutor (new StructureBoxCommand (schemDirName ));
139137
140138 getServer ().getPluginManager ().registerEvents (new BlockListener (), this );
141139 getServer ().getPluginManager ().registerEvents (new InventoryListener (), this );
0 commit comments