Skip to content

Commit 01ed966

Browse files
committed
Add .locate command even if Baritone is not present but print an error if the structure requires Baritone to be located
1 parent 6f7a2f2 commit 01ed966

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/main/java/meteordevelopment/meteorclient/commands/Commands.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.mojang.brigadier.CommandDispatcher;
99
import com.mojang.brigadier.exceptions.CommandSyntaxException;
1010
import meteordevelopment.meteorclient.commands.commands.*;
11-
import meteordevelopment.meteorclient.pathing.BaritoneUtils;
1211
import meteordevelopment.meteorclient.pathing.PathManagers;
1312
import meteordevelopment.meteorclient.utils.PostInit;
1413
import net.minecraft.client.network.ClientCommandSource;
@@ -62,10 +61,7 @@ public static void init() {
6261
add(new RotationCommand());
6362
add(new WaypointCommand());
6463
add(new InputCommand());
65-
66-
if (BaritoneUtils.IS_AVAILABLE) {
67-
add(new LocateCommand());
68-
}
64+
add(new LocateCommand());
6965

7066
COMMANDS.sort(Comparator.comparing(Command::getName));
7167
}

src/main/java/meteordevelopment/meteorclient/commands/commands/LocateCommand.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import meteordevelopment.meteorclient.MeteorClient;
1111
import meteordevelopment.meteorclient.commands.Command;
1212
import meteordevelopment.meteorclient.events.packets.PacketEvent;
13+
import meteordevelopment.meteorclient.pathing.BaritoneUtils;
1314
import meteordevelopment.meteorclient.pathing.PathManagers;
1415
import meteordevelopment.meteorclient.utils.player.ChatUtils;
1516
import meteordevelopment.meteorclient.utils.player.InvUtils;
@@ -145,6 +146,11 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
145146
}));
146147

147148
builder.then(literal("stronghold").executes(s -> {
149+
if (!BaritoneUtils.IS_AVAILABLE) {
150+
error("Locating this structure requires Baritone.");
151+
return SINGLE_SUCCESS;
152+
}
153+
148154
boolean foundEye = InvUtils.testInHotbar(Items.ENDER_EYE);
149155

150156
if (foundEye) {
@@ -170,6 +176,11 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
170176
}));
171177

172178
builder.then(literal("nether_fortress").executes(s -> {
179+
if (!BaritoneUtils.IS_AVAILABLE) {
180+
error("Locating this structure requires Baritone.");
181+
return SINGLE_SUCCESS;
182+
}
183+
173184
Vec3d coords = findByBlockList(netherFortressBlocks);
174185
if (coords == null) {
175186
error("No nether fortress found.");
@@ -183,6 +194,11 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
183194
}));
184195

185196
builder.then(literal("monument").executes(s -> {
197+
if (!BaritoneUtils.IS_AVAILABLE) {
198+
error("Locating this structure requires Baritone.");
199+
return SINGLE_SUCCESS;
200+
}
201+
186202
ItemStack stack = mc.player.getInventory().getMainHandStack();
187203
if (stack.getItem() == Items.FILLED_MAP) {
188204
NbtCompound tag = stack.getNbt();

0 commit comments

Comments
 (0)