Attempt to fix fall-damage issue with dealdamage=false (Ticket 548).

This commit is contained in:
asofold 2013-05-30 20:41:48 +02:00
parent 18e18fae5f
commit 90f110146f

View File

@ -65,8 +65,13 @@ public class NoFall extends Check {
}
private final void adjustFallDistance(final Player player, final double minY, final boolean reallyOnGround, final MovingData data, final MovingConfig cc) {
// TODO: Only set for big differences.
player.setFallDistance(Math.max(player.getFallDistance(), Math.max(data.noFallFallDistance, (float) (data.noFallMaxY - minY))));
final float noFallFallDistance = Math.max(data.noFallFallDistance, (float) (data.noFallMaxY - minY));
if (noFallFallDistance >= 3.0){
final float fallDistance = player.getFallDistance();
if (noFallFallDistance - fallDistance >= 0.5f || noFallFallDistance >= 3.5f && noFallFallDistance < 3.5f){
player.setFallDistance(noFallFallDistance);
}
}
data.clearNoFallData();
}