jess-refactor #11
3 changed files with 15 additions and 9 deletions
|
@ -2,6 +2,7 @@ package com.baseband.client.feature.command;
|
||||||
|
|
||||||
import com.baseband.client.feature.Feature;
|
import com.baseband.client.feature.Feature;
|
||||||
import com.baseband.client.feature.category.Command;
|
import com.baseband.client.feature.category.Command;
|
||||||
|
import com.baseband.client.util.misc.GlobalUtil;
|
||||||
import net.minecraft.client.multiplayer.GuiConnecting;
|
import net.minecraft.client.multiplayer.GuiConnecting;
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
|
@ -13,8 +14,13 @@ public class Connect extends Feature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCommand(String[] args) {
|
public void onCommand(String[] args) {
|
||||||
if(args.length == 1 && notIngame()) {
|
if((args.length == 1 || args.length == 2) && notIngame()) {
|
||||||
mc.displayGuiScreen(new GuiConnecting(mc.currentScreen, mc, args[0], 25565));
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,18 +13,16 @@ public class Bright extends Feature {
|
||||||
return "Bright";
|
return "Bright";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Config("Mode")
|
@Config("Mode")
|
||||||
public Mode mode = Mode.Gamma;
|
public Mode mode = Mode.Effect;
|
||||||
|
|
||||||
public enum Mode {
|
public enum Mode {
|
||||||
Potion,
|
Effect,
|
||||||
Gamma
|
Gamma,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEveryTick() {
|
public void onEveryTick() {
|
||||||
//Hot
|
|
||||||
if (enabled && !notIngame()) {
|
if (enabled && !notIngame()) {
|
||||||
text = this + "§7 [" + mode.toString() + "]";
|
text = this + "§7 [" + mode.toString() + "]";
|
||||||
} else {
|
} else {
|
||||||
|
@ -37,8 +35,10 @@ public class Bright extends Feature {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Gamma:
|
case Gamma:
|
||||||
mc.gameSettings.gammaSetting = 100f;
|
mc.gameSettings.gammaSetting = 100f;
|
||||||
case Potion:
|
break;
|
||||||
|
case Effect:
|
||||||
mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 20 * 60, 0, true, false));
|
mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 20 * 60, 0, true, false));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class HUD extends Feature {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void notify(String text) {
|
public static void notify(String text) {
|
||||||
notify(text, 5000);
|
notify(text, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void notify(String text, int time) {
|
public static void notify(String text, int time) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue