Merge branch 'main' of ssh://tudbut.de:222/BaseBand/BaseBandRewrite

This commit is contained in:
Jess H 2024-06-03 22:54:47 +01:00
commit ed3622a4e4
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19
3 changed files with 15 additions and 9 deletions

View file

@ -2,6 +2,7 @@ package com.baseband.client.feature.command;
import com.baseband.client.feature.Feature;
import com.baseband.client.feature.category.Command;
import com.baseband.client.util.misc.GlobalUtil;
import net.minecraft.client.multiplayer.GuiConnecting;
@Command
@ -13,8 +14,13 @@ public class Connect extends Feature {
@Override
public void onCommand(String[] args) {
if(args.length == 1 && notIngame()) {
mc.displayGuiScreen(new GuiConnecting(mc.currentScreen, mc, args[0], 25565));
if((args.length == 1 || args.length == 2) && notIngame()) {
assert mc.currentScreen != null; // notIngame => in a menu => gui is not null
try {
mc.displayGuiScreen(new GuiConnecting(mc.currentScreen, mc, args[0], args.length == 2 ? Integer.parseInt(args[1]) : 25565));
} catch (NumberFormatException e) {
GlobalUtil.LOGGER.warn("Port invalid");
}
}
}
}

View file

@ -13,18 +13,16 @@ public class Bright extends Feature {
return "Bright";
}
@Config("Mode")
public Mode mode = Mode.Gamma;
public Mode mode = Mode.Effect;
public enum Mode {
Potion,
Gamma
Effect,
Gamma,
}
@Override
public void onEveryTick() {
//Hot
if (enabled && !notIngame()) {
text = this + "§7 [" + mode.toString() + "]";
} else {
@ -37,8 +35,10 @@ public class Bright extends Feature {
switch (mode) {
case Gamma:
mc.gameSettings.gammaSetting = 100f;
case Potion:
break;
case Effect:
mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 20 * 60, 0, true, false));
break;
}
}

View file

@ -63,7 +63,7 @@ public class HUD extends Feature {
}
public static void notify(String text) {
notify(text, 5000);
notify(text, 10000);
}
public static void notify(String text, int time) {