stop baseband from even loading the main class if loadBaseBand is false, add some more options to ClientBoot
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m28s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m28s
This commit is contained in:
parent
9c90c4a536
commit
08acee40cd
3 changed files with 47 additions and 6 deletions
|
@ -16,7 +16,6 @@ import de.com.baseband.client.util.net.WebServiceClient;
|
|||
import de.com.baseband.client.util.render.NotificationRender;
|
||||
import de.com.baseband.prod.LoadHandler;
|
||||
import de.tudbut.tools.Lock;
|
||||
import de.tudbut.tools.Tools;
|
||||
import hint.Mobf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -50,8 +49,6 @@ public class BaseBand {
|
|||
}
|
||||
|
||||
public static void onInit() {
|
||||
if(!Tools.firstNonNull(LoadHandler.data.getBoolean("loadBaseBand"), true))
|
||||
return;
|
||||
LOGGER.info("Initializing...");
|
||||
String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"};
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package de.com.baseband.client.mixin.mixins;
|
||||
|
||||
import de.com.baseband.client.mixin.MixinProxy;
|
||||
import de.com.baseband.prod.LoadHandler;
|
||||
import de.tudbut.tools.Tools;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.toasts.GuiToast;
|
||||
|
@ -14,6 +16,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
public class MixinMinecraft {
|
||||
@Inject(method = "init", at = @At("RETURN"))
|
||||
private void onInit(CallbackInfo ci) {
|
||||
if(!Tools.firstNonNull(LoadHandler.data.getBoolean("loadBaseBand"), true))
|
||||
return;
|
||||
MixinProxy.minecraftOnInit();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,11 +28,16 @@ import oshi.SystemInfo;
|
|||
import oshi.hardware.Processor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -89,11 +94,21 @@ public class Loader implements Util {
|
|||
})
|
||||
.option("Run in recovery mode", x -> {
|
||||
x.data.set("configFile", "baseband.db.tmp");
|
||||
new File("baseband.db.tmp").deleteOnExit();
|
||||
File file = new File("baseband.db.tmp");
|
||||
file.delete();
|
||||
file.deleteOnExit();
|
||||
x.finish();
|
||||
})
|
||||
.option("Redownload", x -> {
|
||||
x.data.set("redownload", true);
|
||||
.option("Run in read-only mode", x -> {
|
||||
x.data.set("configFile", "baseband.db.tmp");
|
||||
File file = new File("baseband.db.tmp");
|
||||
file.delete();
|
||||
try {
|
||||
Files.copy(Paths.get("baseband.db"), file.toPath());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
file.deleteOnExit();
|
||||
x.finish();
|
||||
})
|
||||
.option("Run in debug mode", x -> {
|
||||
|
@ -108,6 +123,31 @@ public class Loader implements Util {
|
|||
x.focus();
|
||||
}
|
||||
})
|
||||
.option("Redownload", x -> {
|
||||
x.data.set("redownload", true);
|
||||
x.finish();
|
||||
})
|
||||
.spacer()
|
||||
.label("Utils:")
|
||||
.option("Backup config", x -> {
|
||||
String name = new SimpleDateFormat("yyyy-MM-dd_HH-mm").format(new Date());
|
||||
if(new File("baseband.db").exists()) {
|
||||
new File(name + "__baseband.db.bak").delete();
|
||||
try {
|
||||
Files.copy(Paths.get("baseband.db"), Paths.get(name + "__baseband.db.bak"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
LOGGER.info("Saved config as {}__baseband.db.bak", name);
|
||||
}
|
||||
})
|
||||
.option("Open .minecraft", x -> new Thread(() -> {
|
||||
try {
|
||||
Desktop.getDesktop().open(new File("."));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).start())
|
||||
.spacer()
|
||||
.label("Configuration:")
|
||||
.option("Configure BaseBand", x -> {
|
||||
|
|
Loading…
Add table
Reference in a new issue