Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard Vanilla behaviour changed on piston changing a block on which a sign is placed #1699

Closed
bitberlin opened this issue Nov 24, 2024 · 2 comments · Fixed by #1752
Closed
Labels
1.21.1 Targeted at Minecraft 1.21.1 1.21.4 Targeted at Minecraft 1.21.4 bug A bug or error

Comments

@bitberlin
Copy link

bitberlin commented Nov 24, 2024

Minecraft Version: 1.21.1

NeoForge Version: 21.1.80

Logs: -

Steps to Reproduce:

  1. Place a moss block
  2. Place a stone block next to the moss block
  3. Place a piston next to the stone block pushing in direction to the stone block (and the moss block)
  4. Place a sign on the side of the moss block (so that it will after piston action be beside the stone block)
  5. Let the piston push (with a lever or button next to it)
  6. The sign breaks and falls off

The issue here is that the sign stays in place in Vanilla Minecraft, in Neoforge it breaks.

The issue occurs with no mods installed.

EDIT:
Here some screenshots to understand it.
NeoForge 21.1.80:
Image
Image

Vanilla:
Image
Image

@bitberlin bitberlin added the triage Needs triaging and confirmation label Nov 24, 2024
@sciwhiz12 sciwhiz12 added bug A bug or error 1.21.4 Targeted at Minecraft 1.21.4 labels Dec 9, 2024
@sciwhiz12
Copy link
Member

Confirmed on 21.4.12-beta. Debugging reveals this to be caused by an outdated code, which is trivially fixable.

The Block & BlockState extensions has the method onDestroyedByPushReaction, which is called when that block is destroyed by a piston. That method is called from PistonBaseBlock, and the original code handling the block destruction is moved to the extension method.

However, as can be seen in the two links, the code originally in PistonBaseBlock slightly differs from the code in onDestroyedByPushReaction: the flag used in the call to Level#setBlock is a constant in the original PistonBaseBlock code, but the code in onDestroyedByPushReaction uses different flags (depending too on the logical side).

Synchronizing the code in onDestroyedByPushReaction to match the original code from PistonBaseBlock fixes the issue, with the sign attached to the moss block remaining unbroken when the moss block is destroyed (then replaced with the stone block).

@sciwhiz12 sciwhiz12 added 1.21.1 Targeted at Minecraft 1.21.1 and removed triage Needs triaging and confirmation labels Dec 9, 2024
sciwhiz12 added a commit to sciwhiz12/NeoForge that referenced this issue Dec 9, 2024
@neoforged-releases
Copy link

🚀 This issue has been resolved in NeoForge version 21.4.16-beta, as part of #1752.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 1.21.4 Targeted at Minecraft 1.21.4 bug A bug or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants