fix actual underlying sneak issue

This commit is contained in:
Leijurv 2020-03-14 11:50:16 -07:00
parent bcd3fd3266
commit f4842aa512
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 8 additions and 3 deletions

View File

@ -19,13 +19,13 @@ package baritone.command.defaults;
import baritone.Baritone; import baritone.Baritone;
import baritone.api.IBaritone; import baritone.api.IBaritone;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command; import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.RelativeBlockPos; import baritone.api.command.datatypes.RelativeBlockPos;
import baritone.api.command.datatypes.RelativeFile; import baritone.api.command.datatypes.RelativeFile;
import baritone.api.command.exception.CommandException; import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException; import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer; import baritone.api.utils.BetterBlockPos;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
@ -59,7 +59,7 @@ public class BuildCommand extends Command {
} }
boolean success = baritone.getBuilderProcess().build(file.getName(), file, buildOrigin); boolean success = baritone.getBuilderProcess().build(file.getName(), file, buildOrigin);
if (!success) { if (!success) {
throw new CommandInvalidStateException("Couldn't load the schematic"); throw new CommandInvalidStateException("Couldn't load the schematic. Make sure to use the FULL file name, including the extension (e.g. blah.schematic).");
} }
logDirect(String.format("Successfully loaded schematic for building\nOrigin: %s", buildOrigin)); logDirect(String.format("Successfully loaded schematic for building\nOrigin: %s", buildOrigin));
} }

View File

@ -108,6 +108,11 @@ public final class InputOverrideHandler extends Behavior implements IInputOverri
} }
private boolean inControl() { private boolean inControl() {
for (Input input : new Input[]{Input.MOVE_FORWARD, Input.MOVE_BACK, Input.MOVE_LEFT, Input.MOVE_RIGHT, Input.SNEAK}) {
if (isInputForcedDown(input)) {
return true;
}
}
// if we are not primary (a bot) we should set the movementinput even when idle (not pathing) // if we are not primary (a bot) we should set the movementinput even when idle (not pathing)
return baritone.getPathingBehavior().isPathing() || baritone != BaritoneAPI.getProvider().getPrimaryBaritone(); return baritone.getPathingBehavior().isPathing() || baritone != BaritoneAPI.getProvider().getPrimaryBaritone();
} }