MinecraftForge
MinecraftForge copied to clipboard
[1.18.2] Size changes in `EntityEvent.Size` not respected in all calculations
Description of issue:
- Issue 1: The bounding box used to calculate if the player needs to sneak or crawl to fit in a space isn't resized.
- Issue 2: The bounding box used to calculate if the player can sneak isn't resized.
Both issues are caused by Entity#canEnterPose not using a modified version of the hitbox but a fresh one.

Steps to Reproduce:
- Add event listener for
EntityEvent.Sizeand filter if it is the player - Scale the hitbox by 0.5
- The 2 issues arise
- Issue 1: Expected behavior: The player can fit in a 1 or 1.5 block high space without crawling or sneaking. Actual behavior: The player instantly goes into crawl mode once walking in the 1 block high space and goes into sneak mode upon walking in the 1.5 high space
- Issue 2: Expected behavior: The player can sneak walking against a block. Actual behavior: The player exits sneaking mode upon colliding with the block (horizontally)
Versions:
Minecraft: 1.18.2 Forge: 40.1.0