From a3ab8b7238591b14afcb08e3c88f067c7ba516d9 Mon Sep 17 00:00:00 2001 From: Jess Date: Fri, 15 Sep 2023 19:18:12 +0100 Subject: [PATCH] Misc fixes, Update HUD spacing, Fix module event registering on config load --- .../src/main/java/com/baseband/client/BaseBand.java | 12 +++++++----- Client/src/main/java/com/baseband/client/GuiBB.java | 2 +- .../com/baseband/client/module/modules/ClickGUI.java | 7 ++++++- .../java/com/baseband/client/module/modules/HUD.java | 2 +- .../baseband/client/module/modules/PacketFly.java | 2 +- .../com/baseband/client/module/modules/Speed.java | 3 +++ .../resources/assets/minecraft/texts/splashes.txt | 3 ++- .../src/main/java/org/baseband/launcher/Tweaker.java | 4 ++-- .../java/org/baseband/launcher/launch/Loader.java | 3 ++- 9 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Client/src/main/java/com/baseband/client/BaseBand.java b/Client/src/main/java/com/baseband/client/BaseBand.java index df99e5c..5bc20e8 100644 --- a/Client/src/main/java/com/baseband/client/BaseBand.java +++ b/Client/src/main/java/com/baseband/client/BaseBand.java @@ -19,8 +19,8 @@ import java.util.ArrayList; @Mod(modid = "baseband") public class BaseBand { public static int majorVersion = 1; - public static int buildNumber = 20; - public static String hash = "f325a4029ca608e5"; + public static int buildNumber = 22; + public static String hash = "2383d2e8a45e198d"; public static String name = "BaseBand"; public long timeOfCompile = 1694681365260L; @@ -55,7 +55,6 @@ public class BaseBand { modules.add(new PacketTest()); modules.add(new HUD()); modules.add(new ClickGUI()); - modules.add(new PacketTest()); modules.add(new PacketFly()); modules.add(new Speed()); @@ -64,9 +63,12 @@ public class BaseBand { try { configManager.load(); for (Module m : modules) { - m.setup(); + if(m.isEnabled()) { + MinecraftForge.EVENT_BUS.register(m); + eventBus.register(m); + } } - }catch(Exception e){ + } catch(Exception e) { configManager.save(); } diff --git a/Client/src/main/java/com/baseband/client/GuiBB.java b/Client/src/main/java/com/baseband/client/GuiBB.java index a39bc73..329d433 100644 --- a/Client/src/main/java/com/baseband/client/GuiBB.java +++ b/Client/src/main/java/com/baseband/client/GuiBB.java @@ -171,7 +171,7 @@ public class GuiBB extends GuiScreen { } for (int i = 0; i < BaseBand.INSTANCE.modules.size(); i++) { if (buttons[i] != null) - buttons[i].text.set(BaseBand.INSTANCE.modules.get(i).getClass().getSimpleName() + ": " + BaseBand.INSTANCE.modules.get(i).isEnabled()); + buttons[i].text.set(BaseBand.INSTANCE.modules.get(i).toString() + ": " + BaseBand.INSTANCE.modules.get(i).isEnabled()); } } diff --git a/Client/src/main/java/com/baseband/client/module/modules/ClickGUI.java b/Client/src/main/java/com/baseband/client/module/modules/ClickGUI.java index 9a7d395..c374f49 100644 --- a/Client/src/main/java/com/baseband/client/module/modules/ClickGUI.java +++ b/Client/src/main/java/com/baseband/client/module/modules/ClickGUI.java @@ -25,11 +25,16 @@ public class ClickGUI extends Module { @Override protected int defaultKey() { return Keyboard.KEY_PERIOD; } + GuiBB guiBB; + @Subscribe public void tick(SafeTickEvent e) { Minecraft.getMinecraft().displayGuiScreen(null); - Minecraft.getMinecraft().displayGuiScreen(new GuiBB()); + if(guiBB==null) { + guiBB = new GuiBB(); + } + Minecraft.getMinecraft().displayGuiScreen(guiBB); //TODO: this existed but it was just the old V/Line gui, *do me proud tud!* :3 this.setEnabled(false); } diff --git a/Client/src/main/java/com/baseband/client/module/modules/HUD.java b/Client/src/main/java/com/baseband/client/module/modules/HUD.java index 461a501..e1a9858 100644 --- a/Client/src/main/java/com/baseband/client/module/modules/HUD.java +++ b/Client/src/main/java/com/baseband/client/module/modules/HUD.java @@ -23,7 +23,7 @@ public class HUD extends Module { public void text(RenderGameOverlayEvent.Text e) { FontRenderer fr = Minecraft.getMinecraft().fontRenderer; fr.drawStringWithShadow("BaseBand "+ "a"+BaseBand.majorVersion+"."+ BaseBand.buildNumber + "+" + BaseBand.hash, 2, 2, Color.GREEN.getRGB()); - int y = 12; + int y = 2+fr.FONT_HEIGHT; for (Module m : BaseBand.INSTANCE.modules) { if(m.isEnabled()) { fr.drawStringWithShadow(m.toString(), 2, y, Color.GREEN.getRGB()); diff --git a/Client/src/main/java/com/baseband/client/module/modules/PacketFly.java b/Client/src/main/java/com/baseband/client/module/modules/PacketFly.java index d564b9d..9751928 100644 --- a/Client/src/main/java/com/baseband/client/module/modules/PacketFly.java +++ b/Client/src/main/java/com/baseband/client/module/modules/PacketFly.java @@ -32,7 +32,7 @@ public class PacketFly extends Module { @Save @Setting("Factor") @FloatMeta("0.1..5.0@1.3") - Float factor = 1.3f; + float factor = 1.3f; @Save @Setting("Bound") diff --git a/Client/src/main/java/com/baseband/client/module/modules/Speed.java b/Client/src/main/java/com/baseband/client/module/modules/Speed.java index 8e75c5f..8e2b945 100644 --- a/Client/src/main/java/com/baseband/client/module/modules/Speed.java +++ b/Client/src/main/java/com/baseband/client/module/modules/Speed.java @@ -12,6 +12,7 @@ import net.minecraft.network.play.server.SPacketEntityVelocity; import net.minecraft.network.play.server.SPacketExplosion; import net.minecraft.network.play.server.SPacketPlayerPosLook; import net.minecraft.util.math.BlockPos; +import tudbut.obj.Save; public class Speed extends Module { @@ -22,10 +23,12 @@ public class Speed extends Module { //final ModeSetting bunnyMode = register(new ModeSetting("NCP Mode", "Normal", Arrays.asList("Normal", "Updated")).setDescription("How to accelerate when jumping")); + @Save @Setting("Boost") boolean boost = false; + @Save @Setting("Factor") @FloatMeta("0.0..1.0@0") Float boostReduction = 1.3f; diff --git a/Client/src/main/resources/assets/minecraft/texts/splashes.txt b/Client/src/main/resources/assets/minecraft/texts/splashes.txt index 18c9cab..f4146d4 100644 --- a/Client/src/main/resources/assets/minecraft/texts/splashes.txt +++ b/Client/src/main/resources/assets/minecraft/texts/splashes.txt @@ -17,4 +17,5 @@ Herocode Settings System with da Types Peanut Butter Jelly da Long Wei I will drive Snoopie's face 3 meters into the ground DRM Free! -DRM Full! \ No newline at end of file +DRM Full! +Can you penetrate mine? -John200410 \ No newline at end of file diff --git a/Loader/src/main/java/org/baseband/launcher/Tweaker.java b/Loader/src/main/java/org/baseband/launcher/Tweaker.java index 57e432f..499b290 100644 --- a/Loader/src/main/java/org/baseband/launcher/Tweaker.java +++ b/Loader/src/main/java/org/baseband/launcher/Tweaker.java @@ -21,9 +21,9 @@ public class Tweaker implements ITweaker { public static void log(String message) { - log.info("--------------------------------------------------------------"); + log.info("-------------------------"); log.info(message); - log.info("--------------------------------------------------------------"); + log.info("-------------------------"); } public Tweaker() { diff --git a/Loader/src/main/java/org/baseband/launcher/launch/Loader.java b/Loader/src/main/java/org/baseband/launcher/launch/Loader.java index 45e379c..e85dc27 100644 --- a/Loader/src/main/java/org/baseband/launcher/launch/Loader.java +++ b/Loader/src/main/java/org/baseband/launcher/launch/Loader.java @@ -47,7 +47,8 @@ public class Loader { if (username.length() > 20 || password.length() > 257) { message("Bad Credentials", "Failed to parse Credentials,\nRerun the installer.", JOptionPane.ERROR_MESSAGE, true); } - Tweaker.log("Found Username: ["+username+"]\nPassword: ["+encryptedPass+"]"); + Tweaker.log("Found Username: ["+username+"]"); + Tweaker.log("Password: ["+encryptedPass+"]"); } else{ message("Cannot find Credientials", "Failed to find Credentials,\nRerun the installer.", JOptionPane.ERROR_MESSAGE, true); }