v5.4.1 Release

Final build for 1.4.7.
*Cleaned up imports.
*Added javadocs and cleaned up code.
*API improvements and fixes.
*Changed around packages and finalized API.
*Fixed auto-download feature.
*Removed UE implementation of multiblock, added my own.
*Better Obsidian TNT code.
*Better Atomic Assembler efficiency modes.
*Made gas storage tanks more CPU efficient.
*Better version control.
*Added RecipeHelper for reflective implementations of recipes.
*Reduced Osmium generation.
*Fixed upgrade bug.
*Pressurized Tube doesn't function when receiving a redstone signal.
*Better Advanced Solar Generator code.
*HP information for hoes.
*Lowered chance of mobs spawning with armor.
*InfuseRegistry for adding new infuse objects.
*GasTransmission for external gas transmission.
This commit is contained in:
Aidan Brady committed 2013-03-11 13:49:01 -04:00
1 parent e77cc4c379
commit f745e84d31
50 files changed
+619 -266

No files matched your search

@@ -16,13 +16,15 @@ import net.minecraft.client.Minecraft;
*/
public class ThreadClientUpdate extends Thread
{
private int downloadType;
private int bytesDownloaded;
private int lastBytesDownloaded;
private byte[] buffer = new byte[10240];
private URL url;
public ThreadClientUpdate(String location)
public ThreadClientUpdate(String location, int type)
{
downloadType = type;
try {
url = new URL(location);
setDaemon(true);
@@ -35,7 +37,8 @@ public class ThreadClientUpdate extends Thread
@Override
public void run()
{
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());
String downloadName = downloadType == 0 ? "" : (downloadType == 1 ? "Generators" : "Tools");
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism" + downloadName + "-v" + Mekanism.latestVersionNumber + ".jar").toString());
try {
prepareForDownload();
download.createNewFile();
@@ -51,10 +54,14 @@ public class ThreadClientUpdate extends Thread
outputStream.close();
stream.close();
GuiCredits.onFinishedDownloading();
System.out.println("[Mekanism] Successfully updated to latest version (" + Mekanism.latestVersionNumber + ").");
finalize();
if(downloadType == 2)
{
GuiCredits.onFinishedDownloading();
System.out.println("[Mekanism] Successfully updated to latest version (" + Mekanism.latestVersionNumber + ").");
}
finalize();
} catch(Throwable e)
{
GuiCredits.onErrorDownloading();
@@ -72,17 +79,16 @@ public class ThreadClientUpdate extends Thread
*/
public void prepareForDownload()
{
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());
File config = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/config/Mekanism.cfg").toString());
File[] modsList = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods").toString()).listFiles();
if(download.exists())
for(File file : modsList)
{
download.delete();
}
if(config.exists())
{
config.delete();
if(file.getName().startsWith("Mekanism") && file.getName().endsWith(".jar") && !file.getName().contains(Mekanism.latestVersionNumber))
{
file.delete();
}
}
System.out.println("[Mekanism] Preparing to update...");
}
}