make the left click workaround optional
This commit is contained in:
parent
d7a646789e
commit
a38da64c49
@ -314,6 +314,14 @@ public class Settings {
|
|||||||
*/
|
*/
|
||||||
public Setting<Boolean> prefix = new Setting<>(false);
|
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 Map<String, Setting<?>> byLowerName;
|
||||||
public final List<Setting<?>> allSettings;
|
public final List<Setting<?>> allSettings;
|
||||||
|
|
||||||
|
@ -119,18 +119,19 @@ public abstract class Movement implements Helper, MovementHelper {
|
|||||||
this.didBreakLastTick = false;
|
this.didBreakLastTick = false;
|
||||||
|
|
||||||
latestState.getInputStates().forEach((input, forced) -> {
|
latestState.getInputStates().forEach((input, forced) -> {
|
||||||
RayTraceResult trace = mc.objectMouseOver;
|
if (Baritone.settings().leftClickWorkaround.get()) {
|
||||||
boolean isBlockTrace = trace != null && trace.typeOfHit == RayTraceResult.Type.BLOCK;
|
RayTraceResult trace = mc.objectMouseOver;
|
||||||
boolean isLeftClick = forced && input == Input.CLICK_LEFT;
|
boolean isBlockTrace = trace != null && trace.typeOfHit == RayTraceResult.Type.BLOCK;
|
||||||
|
boolean isLeftClick = forced && input == Input.CLICK_LEFT;
|
||||||
|
|
||||||
// If we're forcing left click, we're in a gui screen, and we're looking
|
// If we're forcing left click, we're in a gui screen, and we're looking
|
||||||
// at a block, break the block without a direct game input manipulation.
|
// at a block, break the block without a direct game input manipulation.
|
||||||
if (mc.currentScreen != null && isLeftClick && isBlockTrace) {
|
if (mc.currentScreen != null && isLeftClick && isBlockTrace) {
|
||||||
BlockBreakHelper.tryBreakBlock(trace.getBlockPos(), trace.sideHit);
|
BlockBreakHelper.tryBreakBlock(trace.getBlockPos(), trace.sideHit);
|
||||||
this.didBreakLastTick = true;
|
this.didBreakLastTick = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(input, forced);
|
Baritone.INSTANCE.getInputOverrideHandler().setInputForceState(input, forced);
|
||||||
});
|
});
|
||||||
latestState.getInputStates().replaceAll((input, forced) -> false);
|
latestState.getInputStates().replaceAll((input, forced) -> false);
|
||||||
|
Loading…
Reference in New Issue
Block a user