Address Lectern spawning while utilizing MenuType API #13439
+107
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #13438 as a potential fix
As somewhat stated in the issue the issue trickles down to these two methods below in BlockLectern
In each of these methods setBlock is called acting on the world. As the MenuType API acts upon fake BlockEntities utilizing the player's position in order to invoke functionality on the fake block entities thus moving them from "fake and virtual" into the real world as tangible blocks.
My proposed fix (Which is by no means clean or ready for merger). Is to add a simple boolean toggle to the BlockEntity that my InventoryViewBuilder can activate when required. While this fix isn't ideal I found no "top-level" way to avoid this besides a boolean switch that didn't involve strenuous rewrites and large diff.
If this approach seems satisfactory I'll clean up this PR to align with merger requirements.