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

This commit is contained in:
Daniella / Tove 2024-06-25 12:07:12 +02:00
parent 9c90c4a536
commit 08acee40cd
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 47 additions and 6 deletions

View file

@ -16,7 +16,6 @@ import de.com.baseband.client.util.net.WebServiceClient;
import de.com.baseband.client.util.render.NotificationRender; import de.com.baseband.client.util.render.NotificationRender;
import de.com.baseband.prod.LoadHandler; import de.com.baseband.prod.LoadHandler;
import de.tudbut.tools.Lock; import de.tudbut.tools.Lock;
import de.tudbut.tools.Tools;
import hint.Mobf; import hint.Mobf;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -50,8 +49,6 @@ public class BaseBand {
} }
public static void onInit() { public static void onInit() {
if(!Tools.firstNonNull(LoadHandler.data.getBoolean("loadBaseBand"), true))
return;
LOGGER.info("Initializing..."); LOGGER.info("Initializing...");
String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"}; String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"};

View file

@ -1,6 +1,8 @@
package de.com.baseband.client.mixin.mixins; package de.com.baseband.client.mixin.mixins;
import de.com.baseband.client.mixin.MixinProxy; 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.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.toasts.GuiToast; import net.minecraft.client.gui.toasts.GuiToast;
@ -14,6 +16,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class MixinMinecraft { public class MixinMinecraft {
@Inject(method = "init", at = @At("RETURN")) @Inject(method = "init", at = @At("RETURN"))
private void onInit(CallbackInfo ci) { private void onInit(CallbackInfo ci) {
if(!Tools.firstNonNull(LoadHandler.data.getBoolean("loadBaseBand"), true))
return;
MixinProxy.minecraftOnInit(); MixinProxy.minecraftOnInit();
} }

View file

@ -28,11 +28,16 @@ import oshi.SystemInfo;
import oshi.hardware.Processor; import oshi.hardware.Processor;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.io.*; import java.io.*;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.Socket; import java.net.Socket;
import java.nio.charset.StandardCharsets; 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.Arrays;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -89,11 +94,21 @@ public class Loader implements Util {
}) })
.option("Run in recovery mode", x -> { .option("Run in recovery mode", x -> {
x.data.set("configFile", "baseband.db.tmp"); 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(); x.finish();
}) })
.option("Redownload", x -> { .option("Run in read-only mode", x -> {
x.data.set("redownload", true); 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(); x.finish();
}) })
.option("Run in debug mode", x -> { .option("Run in debug mode", x -> {
@ -108,6 +123,31 @@ public class Loader implements Util {
x.focus(); 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() .spacer()
.label("Configuration:") .label("Configuration:")
.option("Configure BaseBand", x -> { .option("Configure BaseBand", x -> {