mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Removed the auto file delete feature, it wasn't working too well, sorry :(
This commit is contained in:
1 parent
db04b6b2fa
commit
b4c32d6bca
2 files changed
+4
-7
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in new issue
Block a user