-
Bug
-
Resolution: Unresolved
-
None
-
1.15.2, 20w07a, 20w49a, 1.17.1, 1.18 Release Candidate 3, 24w39a
-
None
-
Confirmed
-
Input
The bug
When placing slabs very fast, it is possible to place double slabs even though that should not be possible based on the viewing angle of the player.
To reproduce
- Set your "Use Item/Place Block" controls setting to a keyboard key
- Look straight at a wall
- Sneak
- Place slabs
→ Sometimes, double slabs will be placed
Original description
When using a macro to place slabs really fast at eye level, i expected all the slabs to be placed as if i had placed them 1 by 1, creating a floor.
What actually happened was they all became double slabs, even though my cursor was never on the bottom or top of the slabs (this happens for both upper and lower slabs, as well as in the different game modes).
Steps to Reproduce:
1. Align your cursor to place slabs at eye level (top or bottom half works)
2. Click absurdly fast using a macro
3. Voila, a row of double slabs, rather than a row of normal slabs
Code analysis
Code analysis by mexiscool in this comment:
In the SlabBlock class, the getStateForPlacement(...) method does not check if the click location height matches that of the empty half before making it a double slab.