make the left click workaround optional

This commit is contained in:
Leijurv 2018-09-14 09:05:29 -07:00
parent d7a646789e
commit a38da64c49
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 19 additions and 10 deletions

View File

@ -314,6 +314,14 @@ public class Settings {
*/
public Setting<Boolean> prefix = new Setting<>(false);
/**
* true: can mine blocks when in inventory, chat, or tabbed away in ESC menu
* false: works on cosmic prisons
* <p>
* LOL
*/
public Setting<Boolean> leftClickWorkaround = new Setting<>(true);
public final Map<String, Setting<?>> byLowerName;
public final List<Setting<?>> allSettings;

View File

@ -119,6 +119,7 @@ public abstract class Movement implements Helper, MovementHelper {
this.didBreakLastTick = false;
latestState.getInputStates().forEach((input, forced) -> {
if (Baritone.settings().leftClickWorkaround.get()) {
RayTraceResult trace = mc.objectMouseOver;
boolean isBlockTrace = trace != null && trace.typeOfHit == RayTraceResult.Type.BLOCK;
boolean isLeftClick = forced && input == Input.CLICK_LEFT;
@ -130,7 +131,7 @@ public abstract class Movement implements Helper, MovementHelper {
this.didBreakLastTick = true;
return;
}
}
Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(input, forced);
});
latestState.getInputStates().replaceAll((input, forced) -> false);