-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
base: 1.21.x
Are you sure you want to change the base?
[1.21.x] Added ShapeUpdateEvent #1914
Conversation
|
There was a problem hiding this 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?
Might want to be careful with performance here. |
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. |
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. |
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.