KnightMiner / Inspirations

Mod adding various smaller features to Minecraft
MIT License
44 stars 18 forks source link

Client Desync When Placing Block Against Front Of Bookshelf #16

Closed ChloeDawn closed 6 years ago

ChloeDawn commented 6 years ago

You are always returning true for the client in BlockBookshelf#onBlockActivated, then returning false on the server if tile entity interaction returns false (i.e not clicking on a designated item slot). So the client never gets told if a block is going to be placed, which results in a desync between the blockstate on the client and server until a block update is triggered. This issue is most noticeable with bookshelves placed against bookshelves, due to the tile entity dependent models.

Mod version: 0.1.1b

Recording of issue:

recording gif

KnightMiner commented 6 years ago

Huh, I thought I always had true on both sides. I'll fix that sometime soon.

ChloeDawn commented 6 years ago

I'd personally handle the front of the interaction in the block and not the tile entity. You can check the hitvec and return false if it's not over a valid slot position. Then just always return true if it is over a valid slot position regardless of if the tile entity exists.

KnightMiner commented 6 years ago

Fixed in 0.1.2