fill1890 / FabSit

Fabric sit mod for Minecraft
MIT License
12 stars 7 forks source link

Failure to pose at the same XYZ position multiple times #12

Closed OoLunar closed 2 years ago

OoLunar commented 2 years ago

Description

Attempting to sit in the same block multiple times- as in sitting, shifting to leave, then sitting again -will lead to the incorrect error of "Someone is already sitting here!" when nobody is sitting there. Presumably, this is caused by the Shift event not actually removing the player from that pose in memory.

Solution

The simplest solution to fixing the bug is removing the player's pose on that XYZ block from how you store it in memory. Though, what I believe to be the correct solution to this issue is to have a dictionary/hashmap of the player's GUID and the XYZ position they're in. This way, the player can only be in one pose at a time preventing "ghost poses" of what we're experiencing now.

Notes

Possibly caused by #8? Depending on the complexity of your mod, I might submit an untested PR.

OoLunar commented 2 years ago

https://user-images.githubusercontent.com/46751150/184520642-0cbece65-ebfd-4dfb-a425-016ce50390f3.mp4

Here's a repro. It seems like this is only caused through right-clicking though, not through the /sit command.

fill1890 commented 2 years ago

Should be resolved as of 4b86f4355ec390cc3f01a3eaac48180bd7b57891 I'll release version 1.5.3 in a sec, let me know how it goes :)

OoLunar commented 2 years ago

Works as intended! Thank you for the quick fix.