-
Bug
-
Resolution: Fixed
-
20w48a
-
None
-
Plausible
-
Entities
-
Important
Code analysis:
Since the minecraft team is adding support for changing the world height there are more methods calling for the minimum (and maximum) world height. At net.minecraft.world.entity.Entity.resetPos(), a 'for' is asking if a number 'y' is lower and higher than the minimum world height, that number increases:
protected void resetPos() { if (this.level == null) { return; } for (double y = this.getY(); y > (double)this.level.getMinBuildHeight() && y < (double)this.level.getMinBuildHeight(); y += 1.0) { this.setPos(this.getX(), y, this.getZ()); if (this.level.noCollision(this)) { break; } } this.setDeltaMovement(Vec3.ZERO); this.xRot = 0.0f; }
>This causes client-side bugs at the player's Y when logging in or respawning.
The solution is easy, just change the 'less than' conditional to 'y < (double)this.level.getMaxBuildHeight()'
After fixing, it would look like this:
protected void resetPos() { if (this.level == null) { return; } for (double y = this.getY(); y > (double)this.level.getMinBuildHeight() && y < (double)this.level.getMaxBuildHeight(); y += 1.0) { this.setPos(this.getX(), y, this.getZ()); if (this.level.noCollision(this)) { break; } } this.setDeltaMovement(Vec3.ZERO); this.xRot = 0.0f; }