fix wrong water speed

This commit is contained in:
Bixilon 2021-06-28 22:01:23 +02:00
parent 9ba0610e8e
commit 5a9acd3c3e
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,6 @@ import de.bixilon.minosoft.gui.rendering.chunk.models.AABB
import de.bixilon.minosoft.gui.rendering.input.camera.MovementInput
import de.bixilon.minosoft.gui.rendering.util.VecUtil
import de.bixilon.minosoft.gui.rendering.util.VecUtil.EMPTY
import de.bixilon.minosoft.gui.rendering.util.VecUtil.assign
import de.bixilon.minosoft.gui.rendering.util.VecUtil.blockPosition
import de.bixilon.minosoft.gui.rendering.util.VecUtil.chunkPosition
import de.bixilon.minosoft.gui.rendering.util.VecUtil.clearZero
@ -597,11 +596,13 @@ class LocalPlayerEntity(
}
if (abs(this.velocity.x) < 0.003 && abs(this.velocity.z) < 0.003 && velocity.length() < 0.0045000000000000005) {
velocity assign (velocity.normalize() * 0.0045000000000000005)
velocity.normalizeAssign()
velocity *= 0.0045000000000000005
}
this.velocity assign (this.velocity + velocity)
this.velocity = (this.velocity + velocity)
}
if (height > 0.0) {
fluidHeights[fluid] = height
}

View File

@ -67,7 +67,7 @@ class WaterFluid(
override fun travel(entity: LocalPlayerEntity, sidewaysSpeed: Float, forwardSpeed: Float, gravity: Double, falling: Boolean) {
val y = entity.position.y
var speedMultiplier = entity.isSprinting.decide(0.9, entity.walkingSpeed)
var speedMultiplier = entity.isSprinting.decide(0.9, 0.8)
var depthStriderLevel = min(entity.getEquipmentEnchant(depthStriderEnchantment), 3).toDouble()