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

[1.21.x] Added ShapeUpdateEvent #1914

Open
wants to merge 4 commits into
base: 1.21.x
Choose a base branch
from

Conversation

ZygZagGaming
Copy link

This PR adds a ShapeUpdateEvent called whenever a block's shape changes. This allows modders to detect updates that are caught by observers but not by BUDs, meaning they don't call NeighborNotifyEvent. For example, this event is called on trapdoor, door, and fence gate closing/opening, as well as fence, wall, and iron bar shape changes.

I made this PR because I need an event like this in my own mod, and I think it could be helpful for other modders to have.

@neoforged-automation neoforged-automation bot added the 1.21.4 Targeted at Minecraft 1.21.4 label Jan 24, 2025
@CLAassistant
Copy link

CLAassistant commented Jan 24, 2025

CLA assistant check
All committers have signed the CLA.

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

Copy link
Contributor

@marchermans marchermans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allthough I generally approve of the event, I am a bit confused about the events description.

Does this detect trapdoor toggling or not?

@Technici4n
Copy link
Member

Might want to be careful with performance here.

@ZygZagGaming
Copy link
Author

Allthough I generally approve of the event, I am a bit confused about the events description.

Does this detect trapdoor toggling or not?

Apologies for the confusion. Yes, this does. It essentially detects every change an observer would detect, versus NeighborNotifyEvent, which detects only changes a traditional BUD would detect.

@ZygZagGaming
Copy link
Author

Might want to be careful with performance here.

I thought about that when writing this PR; however, I don't see a way to optimize this without compromising the intent of the event.

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

Successfully merging this pull request may close these issues.

4 participants