mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 04:29:05 +00:00
Bugfixes & Performance Improvements
This commit is contained in:
@@ -81,7 +81,17 @@ public class ProjectManager
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Found " + type + " dimension in " + ProjectManager.workspaceName + " folder. Repackaging");
|
||||
ZipUtil.unpack(Iris.proj.compilePackage(sender, type, true, true), iris);
|
||||
File f = new IrisProject(new File(getWorkspaceFolder(), type)).getPath();
|
||||
|
||||
try
|
||||
{
|
||||
FileUtils.copyDirectory(f, iris);
|
||||
}
|
||||
|
||||
catch(IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
File dimf = new File(iris, "dimensions/" + type + ".json");
|
||||
@@ -145,6 +155,11 @@ public class ProjectManager
|
||||
}
|
||||
|
||||
public void downloadSearch(MortarSender sender, String key, boolean trim)
|
||||
{
|
||||
downloadSearch(sender, key, trim, false);
|
||||
}
|
||||
|
||||
public void downloadSearch(MortarSender sender, String key, boolean trim, boolean forceOverwrite)
|
||||
{
|
||||
String repo = getListing(false).get(key);
|
||||
|
||||
@@ -157,7 +172,7 @@ public class ProjectManager
|
||||
sender.sendMessage("Found '" + key + "' in the Iris Listing as " + repo);
|
||||
try
|
||||
{
|
||||
download(sender, repo, trim);
|
||||
download(sender, repo, trim, forceOverwrite);
|
||||
}
|
||||
catch(JsonSyntaxException | IOException e)
|
||||
{
|
||||
@@ -166,6 +181,11 @@ public class ProjectManager
|
||||
}
|
||||
|
||||
public void download(MortarSender sender, String repo, boolean trim) throws JsonSyntaxException, IOException
|
||||
{
|
||||
download(sender, repo, trim, false);
|
||||
}
|
||||
|
||||
public void download(MortarSender sender, String repo, boolean trim, boolean forceOverwrite) throws JsonSyntaxException, IOException
|
||||
{
|
||||
String url = "https://codeload.github.com/" + repo + "/zip/master";
|
||||
sender.sendMessage("Downloading " + url);
|
||||
@@ -208,6 +228,13 @@ public class ProjectManager
|
||||
String key = dim.getName().split("\\Q.\\E")[0];
|
||||
IrisDimension d = new Gson().fromJson(IO.readAll(dim), IrisDimension.class);
|
||||
sender.sendMessage("Importing " + d.getName() + " (" + key + ")");
|
||||
File packEntry = new File(packs, key);
|
||||
|
||||
if(forceOverwrite)
|
||||
{
|
||||
IO.delete(packEntry);
|
||||
}
|
||||
|
||||
Iris.globaldata.dump();
|
||||
Iris.globaldata.preferFolder(null);
|
||||
|
||||
@@ -217,8 +244,6 @@ public class ProjectManager
|
||||
return;
|
||||
}
|
||||
|
||||
File packEntry = new File(packs, key);
|
||||
|
||||
if(packEntry.exists() && packEntry.listFiles().length > 0)
|
||||
{
|
||||
sender.sendMessage("Another pack is using the key " + key + ". IMPORT FAILED!");
|
||||
|
||||
Reference in New Issue
Block a user