mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -04:00
tests: physics: check correct submersion state
This commit is contained in:
parent
a4e0d5a023
commit
a07b62857f
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* 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.
|
* 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.physics.PhysicsTestUtil.assertVelocity
|
||||||
import de.bixilon.minosoft.data.registries.fluid.fluids.WaterFluid
|
import de.bixilon.minosoft.data.registries.fluid.fluids.WaterFluid
|
||||||
import de.bixilon.minosoft.test.IT
|
import de.bixilon.minosoft.test.IT
|
||||||
|
import org.testng.Assert.assertTrue
|
||||||
import org.testng.annotations.Test
|
import org.testng.annotations.Test
|
||||||
|
|
||||||
@Test(groups = ["physics"], dependsOnGroups = ["block"])
|
@Test(groups = ["physics"], dependsOnGroups = ["block"])
|
||||||
@ -140,5 +141,16 @@ class WaterStillIT : StillFluidIT() {
|
|||||||
player.assertVelocity(0.0, -0.005, 0.0)
|
player.assertVelocity(0.0, -0.005, 0.0)
|
||||||
player.assertGround()
|
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]
|
// TODO: water[FALLING=true]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user