-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix MenuType builder locations clashing with existing blocks. #12055
base: main
Are you sure you want to change the base?
Conversation
Using the Zero coordinates may cause unnecessary chunk loading.
Perhaps you can set the block position outside the world height boundaries, which ensures that a virtual inventory is always returned, such as However, this may still have side effects, such as players no longer being able to hear the sounds emitted by the inventory. |
This is not the case when it comes to the code that menus run, I could technically provide any arbitrary coordinate with none issue, It only causes problems, when things are at location specified, your second comment seems helpful to this.
Hmmm I think sound side effect is no issue whatsoever for fake menus, I will take this idea into considerations. Thank you! |
I would refrain from using positions outside the world boundaries |
I understand your concern with outside the world positions, however it will be tested thoroughly as an option. Also if you were unable to reach the inventory within a a couple blocks you incorrectly set up your menu api. Distance only really matters for physical menus that are stored within the world. Virtual menus are virtual and thus disconnected from the world, even if they create a fake tile the tile is not actually in the world. I have also other things I wish to attempt to mitigate these issues, such as using the players upper body position instead, which is slightly more favorable if I can avoid these glitches with that. |
Why don't you just use |
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftBlockEntityInventoryViewBuilder.java
Outdated
Show resolved
Hide resolved
you pushed your test plugin |
yes, yes I did, if you looked at full diff it was removed, they will squash on merge. |
Sorry, wasn't quite sure if you noticed |
I addressed this bug by opening a fake tile if the provided location is null, this should prevent any issues, by just building the fake tile right away instead of delegating through the checks to see if it exists in the real world when the intent is to make a virtual menu. This bug is of no concern with the "CraftAccessLocationInventoryViewBuilder" and a more proper "fix" would be the same diff as #12013, so it would be redundant to include it here. Though as far as I'm aware at this current moment no ContainerAccess menus suffer from the same problem as the chest.
message