mirror of https://github.com/cabaletta/baritone
Merge pull request #4292 from rfresh2/place-delay-patch
align rightClickSpeed setting with actual delay
This commit is contained in:
commit
a8119366a1
|
@ -25,6 +25,8 @@ import net.minecraft.world.phys.BlockHitResult;
|
|||
import net.minecraft.world.phys.HitResult;
|
||||
|
||||
public class BlockPlaceHelper {
|
||||
// base ticks between places caused by tick logic
|
||||
private static final int BASE_PLACE_DELAY = 1;
|
||||
|
||||
private final IPlayerContext ctx;
|
||||
private int rightClickTimer;
|
||||
|
@ -42,7 +44,7 @@ public class BlockPlaceHelper {
|
|||
if (!rightClickRequested || ctx.player().isHandsBusy() || mouseOver == null || mouseOver.getType() != HitResult.Type.BLOCK) {
|
||||
return;
|
||||
}
|
||||
rightClickTimer = Baritone.settings().rightClickSpeed.value;
|
||||
rightClickTimer = Baritone.settings().rightClickSpeed.value - BASE_PLACE_DELAY;
|
||||
for (InteractionHand hand : InteractionHand.values()) {
|
||||
if (ctx.playerController().processRightClickBlock(ctx.player(), ctx.world(), hand, (BlockHitResult) mouseOver) == InteractionResult.SUCCESS) {
|
||||
ctx.player().swing(hand);
|
||||
|
|
Loading…
Reference in New Issue