From a07b62857f3f04e82abbee68f75b4583e9af3c81 Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Fri, 4 Apr 2025 19:56:14 +0200 Subject: [PATCH] tests: physics: check correct submersion state --- .../data/physics/fluid/still/WaterStillIT.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/data/physics/fluid/still/WaterStillIT.kt b/src/integration-test/kotlin/de/bixilon/minosoft/data/physics/fluid/still/WaterStillIT.kt index 07d0e45c6..12d822643 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/data/physics/fluid/still/WaterStillIT.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/data/physics/fluid/still/WaterStillIT.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -19,6 +19,7 @@ import de.bixilon.minosoft.data.physics.PhysicsTestUtil.assertPosition import de.bixilon.minosoft.data.physics.PhysicsTestUtil.assertVelocity import de.bixilon.minosoft.data.registries.fluid.fluids.WaterFluid import de.bixilon.minosoft.test.IT +import org.testng.Assert.assertTrue import org.testng.annotations.Test @Test(groups = ["physics"], dependsOnGroups = ["block"]) @@ -140,5 +141,16 @@ class WaterStillIT : StillFluidIT() { player.assertVelocity(0.0, -0.005, 0.0) player.assertGround() } + + fun `water height correctly`() { + val player = super.sinking2() + val height = player.physics.submersion[WaterFluid] + assertTrue(height > 2.0) + } + + fun `eye submersion is water`() { + val player = super.sinking2() + assertTrue(player.physics.submersion.eye is WaterFluid) + } // TODO: water[FALLING=true] }