initializing modpack coding process

This commit is contained in:
huangyuhui
2016-01-23 12:23:56 +08:00
parent 0da589374a
commit 102205de40
151 changed files with 621 additions and 354 deletions

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft;
package org.jackhuang.hellominecraft.utils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft;
package org.jackhuang.hellominecraft.utils;
import org.jackhuang.hellominecraft.logging.logger.Logger;
import org.jackhuang.hellominecraft.utils.logging.logger.Logger;
/**
*

View File

@@ -17,9 +17,8 @@
*/
package org.jackhuang.hellominecraft.utils;
import org.jackhuang.hellominecraft.views.SwingUtils;
import org.jackhuang.hellominecraft.utils.views.SwingUtils;
import javax.swing.JOptionPane;
import org.jackhuang.hellominecraft.C;
/**
* @author huangyuhui

View File

@@ -27,7 +27,6 @@ import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.Map;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.system.IOUtils;
import rx.Observable;

View File

@@ -18,8 +18,6 @@
package org.jackhuang.hellominecraft.utils;
import java.util.Map;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import rx.Observable;
/**

View File

@@ -31,7 +31,6 @@ import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.util.Random;
import javax.swing.ImageIcon;
import org.jackhuang.hellominecraft.HMCLog;
/**
* @author huangyuhui

View File

@@ -17,8 +17,6 @@
*/
package org.jackhuang.hellominecraft.utils;
import org.jackhuang.hellominecraft.HMCLog;
/**
*
* @author huangyuhui

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging;
package org.jackhuang.hellominecraft.utils.logging;
import org.jackhuang.hellominecraft.logging.appender.IAppender;
import org.jackhuang.hellominecraft.utils.logging.appender.IAppender;
public class AppenderControl {

View File

@@ -15,12 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging;
package org.jackhuang.hellominecraft.utils.logging;
import java.util.ArrayList;
import org.jackhuang.hellominecraft.logging.appender.ConsoleAppender;
import org.jackhuang.hellominecraft.logging.appender.IAppender;
import org.jackhuang.hellominecraft.logging.layout.DefaultLayout;
import org.jackhuang.hellominecraft.utils.logging.appender.ConsoleAppender;
import org.jackhuang.hellominecraft.utils.logging.appender.IAppender;
import org.jackhuang.hellominecraft.utils.logging.layout.DefaultLayout;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging;
package org.jackhuang.hellominecraft.utils.logging;
import java.awt.Color;
import java.util.regex.Matcher;

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging;
package org.jackhuang.hellominecraft.utils.logging;
import org.jackhuang.hellominecraft.logging.message.IMessage;
import org.jackhuang.hellominecraft.utils.logging.message.IMessage;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging;
package org.jackhuang.hellominecraft.utils.logging;
/**
*

View File

@@ -15,10 +15,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.appender;
package org.jackhuang.hellominecraft.utils.logging.appender;
import java.io.Serializable;
import org.jackhuang.hellominecraft.logging.layout.ILayout;
import org.jackhuang.hellominecraft.utils.logging.layout.ILayout;
/**
*

View File

@@ -15,12 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.appender;
package org.jackhuang.hellominecraft.utils.logging.appender;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import org.jackhuang.hellominecraft.logging.layout.ILayout;
import org.jackhuang.hellominecraft.utils.logging.layout.ILayout;
/**
*

View File

@@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.appender;
package org.jackhuang.hellominecraft.utils.logging.appender;
import java.io.Serializable;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.logging.layout.ILayout;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.layout.ILayout;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.appender;
package org.jackhuang.hellominecraft.utils.logging.appender;
import java.io.IOException;
import java.io.OutputStream;
@@ -23,9 +23,9 @@ import java.io.PrintStream;
import java.io.Serializable;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.logging.LoggingException;
import org.jackhuang.hellominecraft.logging.layout.ILayout;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.LoggingException;
import org.jackhuang.hellominecraft.utils.logging.layout.ILayout;
/**
*

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.layout;
package org.jackhuang.hellominecraft.utils.logging.layout;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
/**
*

View File

@@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.layout;
package org.jackhuang.hellominecraft.utils.logging.layout;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
/**
*

View File

@@ -15,10 +15,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.layout;
package org.jackhuang.hellominecraft.utils.logging.layout;
import java.io.Serializable;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
/**
*

View File

@@ -15,13 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.logger;
package org.jackhuang.hellominecraft.utils.logging.logger;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.logging.message.IMessage;
import org.jackhuang.hellominecraft.logging.message.IMessageFactory;
import org.jackhuang.hellominecraft.logging.message.ParameterizedMessageFactory;
import org.jackhuang.hellominecraft.logging.message.StringFormattedMessage;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.logging.message.IMessage;
import org.jackhuang.hellominecraft.utils.logging.message.IMessageFactory;
import org.jackhuang.hellominecraft.utils.logging.message.ParameterizedMessageFactory;
import org.jackhuang.hellominecraft.utils.logging.message.StringFormattedMessage;
public abstract class AbstractLogger
implements ILogger {

View File

@@ -15,10 +15,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.logger;
package org.jackhuang.hellominecraft.utils.logging.logger;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.logging.message.IMessage;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.logging.message.IMessage;
/**
*

View File

@@ -15,18 +15,18 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.logger;
package org.jackhuang.hellominecraft.utils.logging.logger;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jackhuang.hellominecraft.logging.AppenderControl;
import org.jackhuang.hellominecraft.logging.Configuration;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.logging.LogEvent;
import org.jackhuang.hellominecraft.logging.appender.IAppender;
import org.jackhuang.hellominecraft.logging.message.IMessage;
import org.jackhuang.hellominecraft.logging.message.IMessageFactory;
import org.jackhuang.hellominecraft.utils.logging.AppenderControl;
import org.jackhuang.hellominecraft.utils.logging.Configuration;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.logging.LogEvent;
import org.jackhuang.hellominecraft.utils.logging.appender.IAppender;
import org.jackhuang.hellominecraft.utils.logging.message.IMessage;
import org.jackhuang.hellominecraft.utils.logging.message.IMessageFactory;
public class Logger extends AbstractLogger {

View File

@@ -15,16 +15,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.logger;
package org.jackhuang.hellominecraft.utils.logging.logger;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.logging.message.IMessage;
import org.jackhuang.hellominecraft.logging.message.IMessageFactory;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.logging.message.IMessage;
import org.jackhuang.hellominecraft.utils.logging.message.IMessageFactory;
public class SimpleLogger extends AbstractLogger {

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
import java.io.Serializable;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
public class ObjectMessage
implements IMessage {

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
import java.text.SimpleDateFormat;
import java.util.Arrays;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.logging.message;
package org.jackhuang.hellominecraft.utils.logging.message;
import java.util.Arrays;
import java.util.IllegalFormatException;

View File

@@ -25,9 +25,9 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.functions.Predicate;
import java.util.zip.ZipInputStream;
/**
* 文件压缩/解压类
@@ -69,6 +69,8 @@ public class Compressor {
* @param source zip文件路径
* @param basePath 待压缩文件根目录
* @param zos zip文件的os
*
* @param callback if the file is allowed to be zipped.
*/
private static void zipFile(File source, String basePath,
ZipOutputStream zos) throws IOException {
@@ -86,8 +88,6 @@ public class Compressor {
if (file.isDirectory()) {
pathName = file.getPath().substring(basePath.length() + 1)
+ "/";
if (file.getName().toLowerCase().contains("meta-inf"))
continue;
zos.putNextEntry(new ZipEntry(pathName));
zipFile(file, basePath, zos);
} else {
@@ -106,7 +106,7 @@ public class Compressor {
}
public static void unzip(File zipFileName, File extPlace) throws IOException {
unzip(zipFileName, extPlace, new String[0]);
unzip(zipFileName, extPlace, null);
}
/**
@@ -114,30 +114,29 @@ public class Compressor {
*
* @param zipFileName zip文件路径
* @param extPlace 待压缩文件根目录
* @param without 带前缀的不解压
* @param callback will be called for every entry in the zip file,
* returns false if you dont want this file unzipped.
*
* @throws java.io.IOException 解压失败或无法写入
*/
public static void unzip(File zipFileName, File extPlace, String[] without) throws IOException {
public static void unzip(File zipFileName, File extPlace, Predicate<String> callback) throws IOException {
extPlace.mkdirs();
try (ZipFile zipFile = new ZipFile(zipFileName)) {
try (ZipInputStream zipFile = new ZipInputStream(new FileInputStream(zipFileName))) {
if (zipFileName.exists()) {
String strPath, gbkPath, strtemp;
strPath = extPlace.getAbsolutePath();
java.util.Enumeration e = zipFile.entries();
while (e.hasMoreElements()) {
ZipEntry zipEnt = (ZipEntry) e.nextElement();
ZipEntry zipEnt;
while ((zipEnt = zipFile.getNextEntry()) != null) {
gbkPath = zipEnt.getName();
if (StrUtils.startsWithOne(without, gbkPath))
continue;
if (callback != null)
if (!callback.apply(gbkPath))
continue;
if (zipEnt.isDirectory()) {
strtemp = strPath + File.separator + gbkPath;
File dir = new File(strtemp);
dir.mkdirs();
} else {
//读写文件
InputStream is = zipFile.getInputStream(zipEnt);
BufferedInputStream bis = new BufferedInputStream(is);
gbkPath = zipEnt.getName();
strtemp = strPath + File.separator + gbkPath;
//建目录
@@ -151,7 +150,7 @@ public class Compressor {
}
try (FileOutputStream fos = new FileOutputStream(strtemp); BufferedOutputStream bos = new BufferedOutputStream(fos)) {
int c;
while ((c = bis.read()) != -1)
while ((c = zipFile.read()) != -1)
bos.write((byte) c);
}
}
@@ -167,32 +166,35 @@ public class Compressor {
* @param srcFile zip2
*
* @throws java.io.IOException 无法写入或读取
*//*
* public static void merge(File destFile, File srcFile) throws IOException
* {
* try (ZipOutputStream os = new ZipOutputStream(new
* FileOutputStream(destFile))) {
* if (destFile.exists()) {
* File extPlace = new File(IOUtils.currentDir(), "HMCL-MERGE-TEMP");
* unzip(srcFile, extPlace);
* ZipFile zipFile = new ZipFile(srcFile);
* if (srcFile.exists()) {
* String gbkPath;//, strtemp, strPath;
* //strPath = extPlace.getAbsolutePath();
* java.util.Enumeration e = zipFile.entries();
* while (e.hasMoreElements()) {
* ZipEntry zipEnt = (ZipEntry) e.nextElement();
* //gbkPath = zipEnt.getName();
* if (zipEnt.isDirectory()) {
* //strtemp = strPath + File.separator + gbkPath;
* } else {
* gbkPath = zipEnt.getName();
* //strtemp = strPath + File.separator + gbkPath;
* os.putNextEntry(zipEnt);
* os.write(gbkPath.getBytes("UTF-8"));
* }
* }
* }
* }
* os.closeEntry();
* }
* }
*/
public static void merge(File destFile, File srcFile) throws IOException {
try (ZipOutputStream os = new ZipOutputStream(new FileOutputStream(destFile))) {
if (destFile.exists()) {
File extPlace = new File(IOUtils.currentDir(), "HMCL-MERGE-TEMP");
unzip(srcFile, extPlace);
ZipFile zipFile = new ZipFile(srcFile);
if (srcFile.exists()) {
String gbkPath;//, strtemp, strPath;
//strPath = extPlace.getAbsolutePath();
java.util.Enumeration e = zipFile.entries();
while (e.hasMoreElements()) {
ZipEntry zipEnt = (ZipEntry) e.nextElement();
//gbkPath = zipEnt.getName();
if (zipEnt.isDirectory()) {
//strtemp = strPath + File.separator + gbkPath;
} else {
gbkPath = zipEnt.getName();
//strtemp = strPath + File.separator + gbkPath;
os.putNextEntry(zipEnt);
os.write(gbkPath.getBytes("UTF-8"));
}
}
}
}
os.closeEntry();
}
}
}

View File

@@ -27,7 +27,7 @@ import java.io.OutputStream;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.List;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.NetUtils;
/**

View File

@@ -37,7 +37,7 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
/**
*

View File

@@ -22,8 +22,8 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
/**
*

View File

@@ -21,7 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.StrUtils;
/**

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.management.ManagementFactory;
import java.util.StringTokenizer;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.StrUtils;
/**

View File

@@ -20,7 +20,7 @@ package org.jackhuang.hellominecraft.utils.system;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.EventHandler;
/**

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.io.File;
import org.jackhuang.hellominecraft.utils.system.Compressor;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.util.Collection;
import java.util.HashSet;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
/**
*

View File

@@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.util.ArrayList;
import java.util.Collection;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.util.ArrayList;
import java.util.Collection;
@@ -24,7 +24,7 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.HMCLog;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import rx.Observable;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
/**
*

View File

@@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.util.ArrayList;
import org.jackhuang.hellominecraft.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.tasks.communication.PreviousResultRegistrar;
import org.jackhuang.hellominecraft.utils.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.utils.tasks.communication.PreviousResultRegistrar;
import org.jackhuang.hellominecraft.utils.functions.Consumer;
/**

View File

@@ -15,16 +15,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks;
package org.jackhuang.hellominecraft.utils.tasks;
import java.util.ArrayList;
import java.util.LinkedList;
import javax.swing.SwingUtilities;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.MessageBox;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.views.SwingUtils;
import org.jackhuang.hellominecraft.utils.views.SwingUtils;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.communication;
package org.jackhuang.hellominecraft.utils.tasks.communication;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.communication;
package org.jackhuang.hellominecraft.utils.tasks.communication;
/**
*

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.communication;
package org.jackhuang.hellominecraft.utils.tasks.communication;
import org.jackhuang.hellominecraft.tasks.Task;
import org.jackhuang.hellominecraft.utils.tasks.Task;
/**
*

View File

@@ -15,10 +15,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.download;
package org.jackhuang.hellominecraft.utils.tasks.download;
import org.jackhuang.hellominecraft.utils.Event;
import org.jackhuang.hellominecraft.views.LogWindow;
import org.jackhuang.hellominecraft.utils.views.LogWindow;
/**
*

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.download;
package org.jackhuang.hellominecraft.utils.tasks.download;
import org.jackhuang.hellominecraft.tasks.ProgressProviderListener;
import org.jackhuang.hellominecraft.utils.tasks.ProgressProviderListener;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.download;
package org.jackhuang.hellominecraft.utils.tasks.download;
import java.io.File;
import java.io.IOException;
@@ -24,11 +24,11 @@ import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.tasks.Task;
import org.jackhuang.hellominecraft.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.tasks.communication.PreviousResultRegistrar;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.tasks.Task;
import org.jackhuang.hellominecraft.utils.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.utils.tasks.communication.PreviousResultRegistrar;
import org.jackhuang.hellominecraft.utils.system.IOUtils;
/**
@@ -132,6 +132,7 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
stream = connection.getInputStream();
int lastDownloaded = 0;
downloaded = 0;
long lastTime = System.currentTimeMillis();
while (true) {
// Size buffer according to how much of the file is left to download.

View File

@@ -15,15 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.download;
package org.jackhuang.hellominecraft.utils.tasks.download;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.tasks.TaskInfo;
import org.jackhuang.hellominecraft.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.tasks.TaskInfo;
import org.jackhuang.hellominecraft.utils.tasks.communication.PreviousResult;
import org.jackhuang.hellominecraft.utils.EventHandler;
/**

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.tasks.download;
package org.jackhuang.hellominecraft.utils.tasks.download;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.version;
package org.jackhuang.hellominecraft.utils.version;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.version;
package org.jackhuang.hellominecraft.utils.version;
/**
*

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.version;
package org.jackhuang.hellominecraft.utils.version;
import java.util.ArrayList;

View File

@@ -15,14 +15,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.version;
package org.jackhuang.hellominecraft.utils.version;
import java.io.File;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.ArrayUtils;
import org.jackhuang.hellominecraft.utils.NetUtils;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.Rectangle;
import java.awt.RenderingHints;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.Color;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.AlphaComposite;
import java.awt.Color;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.image.BufferedImage;

View File

@@ -15,16 +15,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.Frame;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.functions.NonFunction;
import org.jackhuang.hellominecraft.utils.DoubleOutputStream;
import org.jackhuang.hellominecraft.utils.LauncherPrintStream;

View File

@@ -15,13 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.io.OutputStream;
import java.util.Timer;
import javax.swing.SwingUtilities;
import org.jackhuang.hellominecraft.logging.Level;
import org.jackhuang.hellominecraft.views.LogWindow;
import org.jackhuang.hellominecraft.utils.logging.Level;
import org.jackhuang.hellominecraft.utils.views.LogWindow;
/**
*

View File

@@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.utils.C;
/**
* The frame given to choose things.

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
import java.awt.EventQueue;
import java.awt.FontMetrics;
@@ -33,8 +33,8 @@ import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.HMCLog;
import org.jackhuang.hellominecraft.utils.MessageBox;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.functions.NonFunction;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.views;
package org.jackhuang.hellominecraft.utils.views;
/**
*

View File

@@ -17,7 +17,7 @@ package rx.util.functions;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import org.jackhuang.hellominecraft.logging.logger.Logger;
import org.jackhuang.hellominecraft.utils.logging.logger.Logger;
/**
* Allows execution of functions from multiple different languages.