cobweb test

This commit is contained in:
Bixilon 2022-12-03 17:42:34 +01:00
parent 6ec512cf37
commit b1315f2682
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 75 additions and 0 deletions

View File

@ -75,6 +75,7 @@ This [pixlyzer](https://gitlab.bixilon.de/bixilon/pixlyzer) module runs physics
- fishing rod?
- precision loss (high coordinates 20M+)
- world border
- end of world
- abilities (flying, walk speed, fly speed)
## Additional entity physics

View File

@ -3,6 +3,7 @@ package de.bixilon.pixlyzer.physics
import de.bixilon.kutil.string.StringUtil.toSnakeCase
import de.bixilon.pixlyzer.PixLyzer
import de.bixilon.pixlyzer.physics.tests.*
import de.bixilon.pixlyzer.physics.tests.blocks.CobwebTest
import de.bixilon.pixlyzer.physics.tests.enchantments.NoEnchantmentTest
import de.bixilon.pixlyzer.physics.tests.enchantments.SoulSpeed2Test
import de.bixilon.pixlyzer.physics.tests.enchantments.SoulSpeedTest
@ -47,6 +48,7 @@ object PhysicsExtractor {
SoulSpeed2Test::class.java,
SwiftSneakTest::class.java,
ServerVelocityTest::class.java,
CobwebTest::class.java,
)

View File

@ -0,0 +1,72 @@
package de.bixilon.pixlyzer.physics.tests.blocks
import de.bixilon.pixlyzer.physics.tests.AbstractTest
import de.bixilon.pixlyzer.physics.tests.ExtractorMethod
import net.minecraft.block.Blocks
class CobwebTest : AbstractTest() {
@ExtractorMethod
fun cobwebLanding() {
player.teleport(5.0, 12.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
@ExtractorMethod
fun cobwebFalling() {
player.teleport(5.0, 11.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
@ExtractorMethod
fun cobwebForwardsMovement() {
player.teleport(5.0, 11.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.setKeys(forwards = true)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
@ExtractorMethod
fun cobwebSidewaysMovement1() {
player.teleport(5.0, 11.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.setKeys(left = true)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
@ExtractorMethod
fun cobwebSidewaysMovement2() {
player.teleport(5.0, 11.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.setKeys(right = true)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
@ExtractorMethod
fun cobwebCombinedMovement() {
player.teleport(5.0, 11.0, 5.0)
world.set(5, 10, 5, Blocks.COBWEB.defaultState)
player.setKeys(forwards = true, right = true)
player.tick(10)
storeMovement()
storeVelocity()
storeOnGround()
}
}