Create Fabric

Create Fabric

7M Downloads

Piston does not allow retract after placed block

extract opened this issue ยท 3 comments

commented

Describe the Bug

Hi,

NOTE: This is in Minecraft 1.20.1 using the dev branch (commit id: 74f8693 ...) build and not any official release.

I have a small example set up in a creative world with only Create and Fabric API. No other mods.

Example of contraption

This mechanical piston does extend but once it reaches a limit it "solidifies" the pushed block and the piston breaks. It refuses to go back or further forth.
Rebuilding the piston or adding another piston extender and extending the piston further temporarily makes it work until it collides with another block.

Reproduction Steps

  1. Build the contraption seen in the image.
  2. Extend piston until it's at the max or it collides.
  3. Piston is broken

Expected Result

After saw is done cutting I want to be able to retract the piston again.

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Arch Linux

Mod Version

0.5.1d

Minecraft Version

1.20.1

Other Mods

Fabric API
Create

Additional Context

No response

commented

After a brief debugging I found this state:
image
It seems that extension pole somehow passes isBrittle check
After debugging further, I found that block movement checks are not registered:
image
I'm not sure where exactly I should register them, further investigation needed

commented

Hi! I use commit d9c630d and I can reproduce the issue.
Further experiments show that a piston with only one extension pole works, but 2+ extension poles cause the bug to appear.
image

I managed to unlock the piston by adding one extension pole, pushing it forward and then pulling it back before it stops.

commented

After further investigation I found out that PistonContraption's initialExtensionProgress (int) field behaves weird:

  • writeNBT is called only in the start of the movement, not in the end
  • for some reason initialExtensionProgress resets to zero after full extension (still no clue how)