Bugfixes / Copy over plugins to mod folder

This commit is contained in:
Anuken
2019-10-24 18:04:39 -04:00
parent cbfcb5de2c
commit 955dc5f48d
7 changed files with 51 additions and 9 deletions

View File

@@ -68,6 +68,25 @@ public class Schematics implements Loadable{
});
}
public void overwrite(Schematic target, Schematic newSchematic){
if(previews.containsKey(target)){
previews.get(target).dispose();
previews.remove(target);
}
target.tiles.clear();
target.tiles.addAll(newSchematic.tiles);
newSchematic.tags.putAll(target.tags);
newSchematic.file = target.file;
try{
write(newSchematic, target.file);
}catch(Exception e){
Log.err(e);
ui.showException(e);
}
}
private void loadFile(FileHandle file){
if(!file.extension().equals(schematicExtension)) return;