diff --git a/MODSRC/vazkii/botania/common/core/version/ThreadDownloadMod.java b/MODSRC/vazkii/botania/common/core/version/ThreadDownloadMod.java index a60ef89af..99e60212e 100644 --- a/MODSRC/vazkii/botania/common/core/version/ThreadDownloadMod.java +++ b/MODSRC/vazkii/botania/common/core/version/ThreadDownloadMod.java @@ -11,6 +11,7 @@ */ package vazkii.botania.common.core.version; +import java.awt.Desktop; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -51,7 +52,7 @@ public class ThreadDownloadMod extends Thread { VersionChecker.startedDownload = true; - String domain = "vazkii.us"; // "localhost/xampp"; + String domain = "localhost/xampp"; String base = "http://" + domain + "/mod/Botania/"; String file = fileName.replaceAll(" ", "%20"); URL url = new URL(base + "dl.php?file=" + file); @@ -63,15 +64,10 @@ public class ThreadDownloadMod extends Thread { url = new URL(base + "files/" + file); webReader = url.openStream(); - File dir = new File(".", "mods"); File f = new File(dir, fileName); f.createNewFile(); - File botaniaFile = FMLCommonHandler.instance().findContainerFor(Botania.instance).getSource(); - if(!botaniaFile.isDirectory()) - botaniaFile.deleteOnExit(); - FileOutputStream outputStream = new FileOutputStream(f.getAbsolutePath()); while((bytesJustDownloaded = webReader.read(buffer)) > 0) { @@ -83,6 +79,7 @@ public class ThreadDownloadMod extends Thread { if(Minecraft.getMinecraft().thePlayer != null) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN))); + Desktop.getDesktop().open(dir); VersionChecker.downloadedFile = true; outputStream.close(); diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 667b34ead..d5b28d8b2 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -74,7 +74,7 @@ botania.versioning.outdated=You are running Botania build %s, the latest is buil botania.versioning.updateMessage=["Click for... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to automatically download the latest version","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the mod's website","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the version's Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] botania.versioning.startingDownload=Starting download of %s. Please do not remove your hard disk. botania.versioning.doneDownloading=Finished downloading %s. Reload your game to update. -botania.versioning.downloadedAlready=You already downloaded the latest version. Reload your game to update. +botania.versioning.downloadedAlready=You already downloaded the latest version. Close your game, delete the old version from your mods folder and load it again to update! botania.versioning.downloadingAlready=The update is already downloading, give it some time, will you? botania.versioning.error=Woah! It seems like something went wrong while trying to download the Botania update. Check your FML log for more info.