Attempt to fix stairs issues.

This commit is contained in:
asofold 2012-08-12 08:10:04 +02:00
parent 37970d829f
commit b8102f2f6d

View File

@ -119,6 +119,11 @@ public class NoFall extends Check {
} else
// Reward the player by lowering his violation level.
data.noFallVL *= 0.95D;
if (data.noFallOnGroundServer){
data.noFallY = to.getY();
data.noFallFallDistance = 0.0;
}
}
/* (non-Javadoc)
@ -156,11 +161,14 @@ public class NoFall extends Check {
packet.y - player.locY - 0.001D, packet.z - player.locZ);
data.noFallOnGroundServer = player.world.getCubes(player, boundingBoxGround).size() > 0;
// make use of data.noFallY (absolute reference for falling height).
if (packet.hasPos && data.noFallWasOnGroundServer && !data.noFallOnGroundServer){
data.noFallFallDistance = 0D;
data.noFallY = player.locY;
if (packet.hasPos){
if (data.noFallWasOnGroundServer && !data.noFallOnGroundServer){
data.noFallFallDistance = 0D;
data.noFallY = player.locY;
}
else if (player.locY - packet.y > 0D)
data.noFallFallDistance = Math.max(0.0, data.noFallY - player.locY); //+= player.locY - packet.y;
else if (data.noFallY < player.locY) data.noFallY = player.locY;
}
else if (packet.hasPos && player.locY - packet.y > 0D)
data.noFallFallDistance = Math.max(0.0, data.noFallY - player.locY); //+= player.locY - packet.y;
}
}