// Update entity movement sounds
if (EntityRef.hasMovementSound(handle) && handle.vehicle == null) {
int bX = entity.loc.x.block();
int bY = MathUtil.floor(handle.locY - 0.2 - (double) handle.height);
int bZ = entity.loc.z.block();
Block block = handle.world.getType(bX, bY, bZ);
int j1 = handle.world.getType(bX, bY - 1, bZ).b();
// Magic values! *gasp* Bad, BAD Minecraft! Go sit in a corner!
if (j1 == 11 || j1 == 32 || j1 == 21) {
block = handle.world.getType(bX, bY - 1, bZ);
}
if (block != Blocks.LADDER) {
moveDy = 0.0;
}
handle.Q += MathUtil.length(moveDx, moveDz) * 0.6;
handle.O += MathUtil.length(moveDx, moveDy, moveDz) * 0.6;
if (handle.O > EntityRef.stepCounter.get(entity.getHandle()) && block != Blocks.AIR) {
EntityRef.stepCounter.set(entity.getHandle(), (int) handle.O + 1);
if (entity.isInWater(true)) {
float f = (float) Math.sqrt(entity.vel.y.squared() + 0.2 * entity.vel.xz.lengthSquared()) * 0.35f;
if (f > 1.0f) {
f = 1.0f;
}
entity.makeRandomSound(EntityRef.getSwimSound.invoke(handle), f, 1.0f);
}
entity.makeStepSound(bX, bY, bZ, CommonNMS.getMaterial(block));
block.b(handle.world, bX, bY, bZ, handle);
}
}
EntityRef.updateBlockCollision(handle);