Merge pull request #416 from Bloepiloepi/knockback-fix

Air drag fix
This commit is contained in:
TheMode 2021-08-21 09:34:32 +02:00 committed by GitHub
commit 9ec257ed3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -556,8 +556,9 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
// Stop player velocity
this.velocity = Vec.ZERO;
} else {
final double airDrag = this instanceof LivingEntity ? 0.91 : 0.98;
final double drag = this.onGround ?
finalChunk.getBlock(position).registry().friction() : 0.91;
finalChunk.getBlock(position).registry().friction() : airDrag;
this.velocity = newVelocity
// Convert from block/tick to block/sec
.mul(tps)