/** Process the contents of this packet */ public void handle(Entity entity) { double x = this.x / 32.0D; double y = this.y / 32.0D + 0.015625D; double z = this.z / 32.0D; float yaw = this.yaw * 360 / 256.0F; float pitch = this.pitch * 360 / 256.0F; if (Math.abs(entity.x - x) < 0.03125D && Math.abs(entity.y - y) < 0.015625D && Math.abs(entity.z - z) < 0.03125D) { entity.setPositionAndRotation(entity.x, entity.y, entity.z, yaw, pitch, 3, true); } else { entity.setPositionAndRotation(x, y, z, yaw, pitch, 3, true); } entity.onGround = this.onGround; }
@Override public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) { entity.onGround = true; entity.fallDistance = 0; }