This commit is contained in:
kirillsaint 2023-07-07 20:23:21 +06:00
parent b3b0e35f09
commit 9958b2d166
2 changed files with 24 additions and 9 deletions

View File

@ -56,7 +56,7 @@ public class Client {
} }
private BuildData buildData = new BuildData(); private BuildData buildData = new BuildData();
private UserData userData = new UserData(SilentClientTweaker.TOKEN); private UserData userData = new UserData();
public File dir; public File dir;
private SettingsManager settingsManager; private SettingsManager settingsManager;
public ConfigManager configManager; public ConfigManager configManager;
@ -111,6 +111,29 @@ public class Client {
in.close(); in.close();
} catch (Exception e1) { } catch (Exception e1) {
Client.logger.catching(e1); Client.logger.catching(e1);
}
try {
InputStream in = new FileInputStream(new File(Minecraft.getMinecraft().mcDataDir, "silent_account.json"));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuffer content = new StringBuffer();
String inputLine;
while ((inputLine = reader.readLine()) != null) {
content.append(inputLine);
}
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
userData = gson.fromJson(content.toString(), UserData.class);
in.close();
if(!ClientUtils.isDevelopment()) {
try {
new File(Minecraft.getMinecraft().mcDataDir, "silent_account.json").delete();
} catch (Exception err) {
}
}
} catch (Exception err) {
} }
logger.info("---------[ Silent Client Initialising ]---------"); logger.info("---------[ Silent Client Initialising ]---------");
logger.info("MC Version: 1.8.9"); logger.info("MC Version: 1.8.9");

View File

@ -13,19 +13,11 @@ import java.util.List;
public class SilentClientTweaker implements ITweaker { public class SilentClientTweaker implements ITweaker {
private List<String> launchArgs = new ArrayList<>(); private List<String> launchArgs = new ArrayList<>();
public static boolean hasOptifine = false; public static boolean hasOptifine = false;
public static String TOKEN = "";
@Override @Override
public final void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) public final void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile)
{ {
Client.logger.info("Silent Client Tweak Loader: Options"); Client.logger.info("Silent Client Tweak Loader: Options");
if (args.contains("--sctoken")) {
final int index = args.indexOf("--sctoken");
try {
SilentClientTweaker.TOKEN = (String)args.get(index + 1);
}
catch (final Exception ex) {}
}
try { try {
Class.forName("optifine.OptiFineTweaker"); Class.forName("optifine.OptiFineTweaker");
hasOptifine = true; hasOptifine = true;