Misc fixes, Update HUD spacing, Fix module event registering on config load

This commit is contained in:
Jess 2023-09-15 19:18:12 +01:00
parent 0314638e06
commit a3ab8b7238
9 changed files with 25 additions and 13 deletions

View file

@ -19,8 +19,8 @@ import java.util.ArrayList;
@Mod(modid = "baseband") @Mod(modid = "baseband")
public class BaseBand { public class BaseBand {
public static int majorVersion = 1; public static int majorVersion = 1;
public static int buildNumber = 20; public static int buildNumber = 22;
public static String hash = "f325a4029ca608e5"; public static String hash = "2383d2e8a45e198d";
public static String name = "BaseBand"; public static String name = "BaseBand";
public long timeOfCompile = 1694681365260L; public long timeOfCompile = 1694681365260L;
@ -55,7 +55,6 @@ public class BaseBand {
modules.add(new PacketTest()); modules.add(new PacketTest());
modules.add(new HUD()); modules.add(new HUD());
modules.add(new ClickGUI()); modules.add(new ClickGUI());
modules.add(new PacketTest());
modules.add(new PacketFly()); modules.add(new PacketFly());
modules.add(new Speed()); modules.add(new Speed());
@ -64,7 +63,10 @@ public class BaseBand {
try { try {
configManager.load(); configManager.load();
for (Module m : modules) { 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(); configManager.save();

View file

@ -171,7 +171,7 @@ public class GuiBB extends GuiScreen {
} }
for (int i = 0; i < BaseBand.INSTANCE.modules.size(); i++) { for (int i = 0; i < BaseBand.INSTANCE.modules.size(); i++) {
if (buttons[i] != null) 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());
} }
} }

View file

@ -25,11 +25,16 @@ public class ClickGUI extends Module {
@Override @Override
protected int defaultKey() { return Keyboard.KEY_PERIOD; } protected int defaultKey() { return Keyboard.KEY_PERIOD; }
GuiBB guiBB;
@Subscribe @Subscribe
public void tick(SafeTickEvent e) { public void tick(SafeTickEvent e) {
Minecraft.getMinecraft().displayGuiScreen(null); 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 //TODO: this existed but it was just the old V/Line gui, *do me proud tud!* :3
this.setEnabled(false); this.setEnabled(false);
} }

View file

@ -23,7 +23,7 @@ public class HUD extends Module {
public void text(RenderGameOverlayEvent.Text e) { public void text(RenderGameOverlayEvent.Text e) {
FontRenderer fr = Minecraft.getMinecraft().fontRenderer; FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
fr.drawStringWithShadow("BaseBand "+ "a"+BaseBand.majorVersion+"."+ BaseBand.buildNumber + "+" + BaseBand.hash, 2, 2, Color.GREEN.getRGB()); 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) { for (Module m : BaseBand.INSTANCE.modules) {
if(m.isEnabled()) { if(m.isEnabled()) {
fr.drawStringWithShadow(m.toString(), 2, y, Color.GREEN.getRGB()); fr.drawStringWithShadow(m.toString(), 2, y, Color.GREEN.getRGB());

View file

@ -32,7 +32,7 @@ public class PacketFly extends Module {
@Save @Save
@Setting("Factor") @Setting("Factor")
@FloatMeta("0.1..5.0@1.3") @FloatMeta("0.1..5.0@1.3")
Float factor = 1.3f; float factor = 1.3f;
@Save @Save
@Setting("Bound") @Setting("Bound")

View file

@ -12,6 +12,7 @@ import net.minecraft.network.play.server.SPacketEntityVelocity;
import net.minecraft.network.play.server.SPacketExplosion; import net.minecraft.network.play.server.SPacketExplosion;
import net.minecraft.network.play.server.SPacketPlayerPosLook; import net.minecraft.network.play.server.SPacketPlayerPosLook;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import tudbut.obj.Save;
public class Speed extends Module { 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")); //final ModeSetting bunnyMode = register(new ModeSetting("NCP Mode", "Normal", Arrays.asList("Normal", "Updated")).setDescription("How to accelerate when jumping"));
@Save
@Setting("Boost") @Setting("Boost")
boolean boost = false; boolean boost = false;
@Save
@Setting("Factor") @Setting("Factor")
@FloatMeta("0.0..1.0@0") @FloatMeta("0.0..1.0@0")
Float boostReduction = 1.3f; Float boostReduction = 1.3f;

View file

@ -18,3 +18,4 @@ Peanut Butter Jelly da Long Wei
I will drive Snoopie's face 3 meters into the ground I will drive Snoopie's face 3 meters into the ground
DRM Free! DRM Free!
DRM Full! DRM Full!
Can you penetrate mine? -John200410

View file

@ -21,9 +21,9 @@ public class Tweaker implements ITweaker {
public static void log(String message) { public static void log(String message) {
log.info("--------------------------------------------------------------"); log.info("-------------------------");
log.info(message); log.info(message);
log.info("--------------------------------------------------------------"); log.info("-------------------------");
} }
public Tweaker() { public Tweaker() {

View file

@ -47,7 +47,8 @@ public class Loader {
if (username.length() > 20 || password.length() > 257) { if (username.length() > 20 || password.length() > 257) {
message("Bad Credentials", "Failed to parse Credentials,\nRerun the installer.", JOptionPane.ERROR_MESSAGE, true); 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{ } else{
message("Cannot find Credientials", "Failed to find Credentials,\nRerun the installer.", JOptionPane.ERROR_MESSAGE, true); message("Cannot find Credientials", "Failed to find Credentials,\nRerun the installer.", JOptionPane.ERROR_MESSAGE, true);
} }