Merge pull request #4292 from rfresh2/place-delay-patch

align rightClickSpeed setting with actual delay
This commit is contained in:
leijurv 2024-03-28 16:53:33 -07:00 committed by GitHub
commit a8119366a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -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);