PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Sneak-Left Click with Pneumatic Jackhammer doesn't break blocks

HipHopHuman opened this issue ยท 6 comments

commented

Describe the bug

When holding shift and left click to break a block, the block does not get broken. The block breaking animation reaches about halfway and then resets.

How to reproduce the bug

In survival mode with cheats enabled, cheat in a pressurized jackhammer with any drillbit and sneak while you attempt to break a block.

Expected behavior

the block should be broken

Additional details

No response

Which Minecraft version are you using?

1.19

Which version of PneumaticCraft: Repressurized are you using?

4.3.7-30

Crash log

No response

commented

This is weird. For some reason the code explicitly prevents digging if the shift key is held, and I've no idea why I ever added that. Doing a spot of testing just to be sure, but I think that check can simply be removed.

    @Override
    public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, Player player) {
        MutableBoolean didWork = new MutableBoolean(false);

        if (player instanceof ServerPlayer serverPlayer && !player.isShiftKeyDown()) {
commented

Update: I think the intention was to have holding Shift prevent extra blocks from being broken, while still allowing the targeted block to break. A way of temporarily suppressing any extended dig patterns, but something got lost during porting, most likely.

That makes more sense, and I'm inclined to change the behaviour (back) to that.

commented

Haha, I can relate. Programming really is just a balancing act of "Why did I do this?" and "Why didn't I do this?" ๐Ÿ˜‚ I have fuzzy memories of it doing the supression thing back in 1.12, but it is a rather common mechanic among mods with AoE mining modes, so I could just be remembering the wrong mod.

commented

Very fuzzy since the Jackhammer only appeared in 1.16 ๐Ÿ˜€

commented

I meant 1.16, don't know why I said 1.12 ๐Ÿ˜‚

commented

Fixed in current release