From 01ed966690b8ba3000c14a8d36953b7e1ae3514c Mon Sep 17 00:00:00 2001 From: MineGame159 Date: Sat, 21 Oct 2023 15:02:10 +0200 Subject: [PATCH] Add .locate command even if Baritone is not present but print an error if the structure requires Baritone to be located --- .../meteorclient/commands/Commands.java | 6 +----- .../commands/commands/LocateCommand.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/commands/Commands.java b/src/main/java/meteordevelopment/meteorclient/commands/Commands.java index 8885f8a2ad..6550ce95d9 100644 --- a/src/main/java/meteordevelopment/meteorclient/commands/Commands.java +++ b/src/main/java/meteordevelopment/meteorclient/commands/Commands.java @@ -8,7 +8,6 @@ import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.exceptions.CommandSyntaxException; import meteordevelopment.meteorclient.commands.commands.*; -import meteordevelopment.meteorclient.pathing.BaritoneUtils; import meteordevelopment.meteorclient.pathing.PathManagers; import meteordevelopment.meteorclient.utils.PostInit; import net.minecraft.client.network.ClientCommandSource; @@ -62,10 +61,7 @@ public static void init() { add(new RotationCommand()); add(new WaypointCommand()); add(new InputCommand()); - - if (BaritoneUtils.IS_AVAILABLE) { - add(new LocateCommand()); - } + add(new LocateCommand()); COMMANDS.sort(Comparator.comparing(Command::getName)); } diff --git a/src/main/java/meteordevelopment/meteorclient/commands/commands/LocateCommand.java b/src/main/java/meteordevelopment/meteorclient/commands/commands/LocateCommand.java index 8df324ea38..fbddc68791 100644 --- a/src/main/java/meteordevelopment/meteorclient/commands/commands/LocateCommand.java +++ b/src/main/java/meteordevelopment/meteorclient/commands/commands/LocateCommand.java @@ -10,6 +10,7 @@ import meteordevelopment.meteorclient.MeteorClient; import meteordevelopment.meteorclient.commands.Command; import meteordevelopment.meteorclient.events.packets.PacketEvent; +import meteordevelopment.meteorclient.pathing.BaritoneUtils; import meteordevelopment.meteorclient.pathing.PathManagers; import meteordevelopment.meteorclient.utils.player.ChatUtils; import meteordevelopment.meteorclient.utils.player.InvUtils; @@ -145,6 +146,11 @@ public void build(LiteralArgumentBuilder builder) { })); builder.then(literal("stronghold").executes(s -> { + if (!BaritoneUtils.IS_AVAILABLE) { + error("Locating this structure requires Baritone."); + return SINGLE_SUCCESS; + } + boolean foundEye = InvUtils.testInHotbar(Items.ENDER_EYE); if (foundEye) { @@ -170,6 +176,11 @@ public void build(LiteralArgumentBuilder builder) { })); builder.then(literal("nether_fortress").executes(s -> { + if (!BaritoneUtils.IS_AVAILABLE) { + error("Locating this structure requires Baritone."); + return SINGLE_SUCCESS; + } + Vec3d coords = findByBlockList(netherFortressBlocks); if (coords == null) { error("No nether fortress found."); @@ -183,6 +194,11 @@ public void build(LiteralArgumentBuilder builder) { })); builder.then(literal("monument").executes(s -> { + if (!BaritoneUtils.IS_AVAILABLE) { + error("Locating this structure requires Baritone."); + return SINGLE_SUCCESS; + } + ItemStack stack = mc.player.getInventory().getMainHandStack(); if (stack.getItem() == Items.FILLED_MAP) { NbtCompound tag = stack.getNbt();