reconstruct codes

This commit is contained in:
huangyuhui
2016-01-19 22:28:50 +08:00
parent f32ce42af3
commit d207fa3dfb
34 changed files with 452 additions and 345 deletions

View File

@@ -18,9 +18,9 @@
package org.jackhuang.hellominecraft.launcher.servers;
import org.jackhuang.hellominecraft.launcher.api.IPlugin;
import org.jackhuang.hellominecraft.launcher.launch.IMinecraftProvider;
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.CheckModsMinecraftProvider;
import org.jackhuang.hellominecraft.launcher.launch.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftAuthenticator;
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftMinecraftService;
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.Servers;
import org.jackhuang.hellominecraft.launcher.settings.Profile;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
@@ -44,8 +44,8 @@ public class ServerPlugin implements IPlugin {
protected static MFCraftAuthenticator MFCRAFT_LOGIN;
@Override
public IMinecraftProvider provideMinecraftProvider(Profile profile) {
return new CheckModsMinecraftProvider(profile);
public IMinecraftService provideMinecraftService(Profile profile) {
return new MFCraftMinecraftService(profile);
}
@Override

View File

@@ -19,6 +19,7 @@ package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
import java.io.IOException;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.launcher.launch.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.servers.ServerPlugin;
import org.jackhuang.hellominecraft.launcher.settings.Profile;
import org.jackhuang.hellominecraft.launcher.version.MinecraftModService;
@@ -31,7 +32,7 @@ import org.jackhuang.hellominecraft.utils.ArrayUtils;
*/
public class CheckModsMinecraftProvider extends MinecraftVersionManager {
public CheckModsMinecraftProvider(Profile p) {
public CheckModsMinecraftProvider(IMinecraftService p) {
super(p);
}
@@ -39,7 +40,7 @@ public class CheckModsMinecraftProvider extends MinecraftVersionManager {
public boolean onLaunch() {
try {
super.onLaunch();
String[] md5s = ((MinecraftModService) getModService()).checkMd5s();
String[] md5s = ((MinecraftModService) service.mod()).checkMd5s();
String[] md5 = ServerPlugin.lastServerInfo.md5;
return ArrayUtils.equals(md5s, md5);
} catch (IOException ex) {