Added baritone hud and .kick (#58)

This commit is contained in:
C10udburst
2021-09-13 21:37:17 +02:00
parent 4e5ea69fa7
commit aad771751a
3 changed files with 66 additions and 4 deletions

View File

@@ -1,10 +1,7 @@
package cloudburst.rejects; package cloudburst.rejects;
import cloudburst.rejects.commands.*; import cloudburst.rejects.commands.*;
import cloudburst.rejects.gui.hud.AppleHud; import cloudburst.rejects.gui.hud.*;
import cloudburst.rejects.gui.hud.CpsHud;
import cloudburst.rejects.gui.hud.CrystalHud;
import cloudburst.rejects.gui.hud.ExpHud;
import cloudburst.rejects.gui.themes.rounded.MeteorRoundedGuiTheme; import cloudburst.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
import cloudburst.rejects.modules.*; import cloudburst.rejects.modules.*;
import cloudburst.rejects.modules.modifier.NoRenderModifier; import cloudburst.rejects.modules.modifier.NoRenderModifier;
@@ -80,6 +77,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
commands.add(new SaveSkinCommand()); commands.add(new SaveSkinCommand());
commands.add(new SeedCommand()); commands.add(new SeedCommand());
commands.add(new HeadsCommand()); commands.add(new HeadsCommand());
commands.add(new KickCommand());
// commands.add(new LocateCommand()); I wish it was that simple -_- // commands.add(new LocateCommand()); I wish it was that simple -_-
commands.add(new ServerCommand()); commands.add(new ServerCommand());
commands.add(new SetBlockCommand()); commands.add(new SetBlockCommand());
@@ -89,6 +87,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
// HUD // HUD
HUD hud = modules.get(HUD.class); HUD hud = modules.get(HUD.class);
hud.elements.add(new AppleHud(hud)); hud.elements.add(new AppleHud(hud));
hud.elements.add(new BaritoneHud(hud));
hud.elements.add(new CrystalHud(hud)); hud.elements.add(new CrystalHud(hud));
hud.elements.add(new ExpHud(hud)); hud.elements.add(new ExpHud(hud));
hud.elements.add(new CpsHud(hud)); hud.elements.add(new CpsHud(hud));

View File

@@ -0,0 +1,40 @@
package cloudburst.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
import net.minecraft.text.LiteralText;
import meteordevelopment.meteorclient.systems.commands.Command;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public class KickCommand extends Command {
public KickCommand() {
super("kick", "Kick or disconnect yourself from the server", "disconnect");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("disconnect").executes(ctx -> {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("Disconnected via .kick command")));
return SINGLE_SUCCESS;
}));
builder.then(literal("pos").executes(ctx -> {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, !mc.player.isOnGround()));
return SINGLE_SUCCESS;
}));
builder.then(literal("hurt").executes(ctx -> {
mc.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.attack(mc.player, mc.player.isSneaking()));
return SINGLE_SUCCESS;
}));
builder.then(literal("chat").executes(ctx -> {
mc.player.sendChatMessage("§0§1§");
return SINGLE_SUCCESS;
}));
}
}

View File

@@ -0,0 +1,23 @@
package cloudburst.rejects.gui.hud;
import baritone.api.BaritoneAPI;
import baritone.api.process.IBaritoneProcess;
import meteordevelopment.meteorclient.systems.modules.render.hud.HUD;
import meteordevelopment.meteorclient.systems.modules.render.hud.modules.DoubleTextHudElement;
public class BaritoneHud extends DoubleTextHudElement {
public BaritoneHud(HUD hud) {
super(hud, "Baritone", "Displays what baritone is doing.", "Baritone: ");
}
@Override
protected String getRight() {
IBaritoneProcess process = BaritoneAPI.getProvider().getPrimaryBaritone().getPathingControlManager().mostRecentInControl().orElse(null);
if (process == null) return "-";
return process.displayName();
}
}