improved .heads

This commit is contained in:
Cloudburst
2021-06-12 16:36:52 +02:00
parent aa40213b24
commit 527cf827ba
3 changed files with 14 additions and 8 deletions

View File

@@ -61,7 +61,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
commands.add(new AntiAntiXrayCommand());
commands.add(new GiveCommand());
commands.add(new SaveSkinCommand());
commands.add(new ScreenCommand());
commands.add(new HeadsCommand());
commands.add(new ServerCommand());
commands.add(new SetBlockCommand());
commands.add(new TeleportCommand());

View File

@@ -9,19 +9,20 @@ import minegame159.meteorclient.MeteorClient;
import minegame159.meteorclient.gui.GuiThemes;
import minegame159.meteorclient.systems.commands.Command;
public class ScreenCommand extends Command {
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public ScreenCommand() {
super("screen", "Displays different screens", "gui");
public class HeadsCommand extends Command {
public HeadsCommand() {
super("heads", "Display heads gui");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("heads").executes(ctx -> {
builder.executes(ctx -> {
MeteorClient.INSTANCE.screenToOpen = new HeadScreen(GuiThemes.get());
return 1;
}));
return SINGLE_SUCCESS;
});
}

View File

@@ -98,6 +98,11 @@ public class HeadScreen extends WindowScreen {
give.action = () -> {
addItem(head);
};
WButton equip = t.add(theme.button("Equip")).widget();
equip.tooltip = "Equip client-side.";
equip.action = () -> {
mc.player.getInventory().armor.set(3, head);
};
t.row();
}
set();