-
Notifications
You must be signed in to change notification settings - Fork 5
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
Shulker Boxes do not immediately open when placing and holding right-click #28
Comments
A quick test confirms this is an issue on singleplayer as well, unsure how it works for you in singleplayer. Will look into it alongside #19 as the behavior is similar. |
Reference for myself: The issue with L251 is that it doesn't take into account behavior where vanilla interaction is cancelled while sneaking, thus resulting in utterly inaccessible behavior, i.e. ABP active shulker boxes wont open when right click is held, sneaking to revert to vanilla behavior wont open them because vanilla behavior is to not open inventories/menus when sneaking. The relation to #19 is that scaffolding has the interesting property of being activate-able, but not having a menu, and only when the hand item is also scaffolding. The potential solution for #19 is to add a check if hand item and target block are both scaffolding and current and lastplaced are the same, then revert to vanilla behavior The potential solution for this issue (#28) is more complicated. Sneaking to revert to vanilla behavior is obviously a dumb idea because of how sneaking affects vanilla behavior, but there's also not a very good way to have an in-game modifier similar to sneaking, other than some sort of additional key or toggle that sets whether the mod should override vanilla behaviors for activate-able blocks. I suppose I could make the #19 check universal by checking if hand/target are the same and current/lastplaced are the same, reverting to vanilla behavior if all true, though I'm unsure how well that would work, and how many edge cases that would cover or introduce. Decisions, decisions... Edit 1: Using my above plan does work, however there are some side-effects:
Edit 2: |
Have you considered adding a keybind as a somewhat of a workaround to this? So you can disable the "accurate block placing" feature when you're not building and want the classic "held" behavior, as realistically you don't always need it. This is not really a fix but it may alleviate things until a proper fix can be found |
@VL4DST3R That feature exists, there's a section in Minecrafts controls for ABP where you can bind keys for toggling ABP and FBB. While that is technically a solution, I'd still prefer to fix this properly over relying on the toggle. I have a few ideas how to handle it, it's just a matter of testing them tonight. |
Ok, after more than 5 hours of trying to fix this, I think I've done it. Most of that time was spent trying every solution under the sun, and determining that the weird edge case where placing shulkers while moving and turning diagonally often opens them instead of placing more is actually just ABPs behavior regardless of whether of what solution I use. The solution that will be released soon is to check if the target block is a BlockWithEntity, and if the players position from the last known placement is within 0.6 blocks of the players current position, and if both are true, passing it back to Vanilla so that you can open it. // if the target block is a BlockWithEntity (i.e. storage container) and the player has moved less than 0.6 blocks, let vanilla take over
if((targetBlock instanceof BlockWithEntity) && (lastPlayerPlacedBlockPos != null && lastPlayerPlacedBlockPos.distanceTo(client.player.getPos()) <= 0.6)) {
return;
} Will close this issue when the commit is pushed. |
So could this be why I thought there was a difference between sp and mp? I just got lucky with my angle? Regardless, thank you for this, this kind of quality of life stuff makes using your mod a joy! |
@VL4DST3R Probably not, that's just something I discovered during testing, and initially believed to be related to the issue. It's quite hard to even intentionally reproduce, and I couldn't even give more precise instructions beyond "place shulkers while moving body and camera diagonally". It also only typically occurs when placing multiple shulkers (i.e. in creative mode), not placing one shulker and opening it in the same click. Not sure what specific differences you noticed in single vs multiplayer, but I reproduced the original issue here in singleplayer, and all my testing was done in singleplayer. I (possibly incorrectly) believe that any discrepancies in multiplayer are the result of some sort of serverside interference or modification |
I noticed that when you place shulker boxes in multiplayer, if you palce it and then keep holding right-click it does not automatically open the box the next tick after it gets placed, instead it does nothing and you have to release and press again to open it. In single player this works as intended (I can place and keep holding right-click to immediately open it)
This is a small nitpick but when you develop muscle memory for something you notice very fast when it changes XD.
The text was updated successfully, but these errors were encountered: