Compare commits

..

No commits in common. "461d3433625bae46dab7b63a644fab63ad01f7e0" and "f64139b6000994a33cab9e170a0029e0e7ac5d2e" have entirely different histories.

3 changed files with 1 additions and 43 deletions

View File

@ -5,7 +5,6 @@ import codes.som.hibiscus.api.command.CommandManager
fun allCommandClasses(): Array<() -> Command> = arrayOf(
::Reload,
::Vclip,
)
class CommandRegistry : CommandManager() {

View File

@ -1,41 +0,0 @@
package codes.som.hibiscus.commands
import codes.som.hibiscus.api.command.Command
import codes.som.hibiscus.player
import codes.som.hibiscus.world
class Vclip : Command("vclip") {
init {
branch { y: Double ->
player.updatePosition(player.x, player.y + y, player.z)
}
branch("up") {
val collisionTests = (2..10).map { n ->
world.getBlockCollisions(null, player.boundingBox.offset(0.0, n.toDouble(), 0.0)).all { it.isEmpty }
}
if (collisionTests.all { it }) {
player.updatePosition(player.x, player.y + 10, player.z)
} else {
val n = collisionTests.indexOf(true)
if (n != -1)
player.updatePosition(player.x, player.y + n + 2, player.z)
}
}
branch("down") {
val collisionTests = (2..10).map { n ->
world.getBlockCollisions(null, player.boundingBox.offset(0.0, -n.toDouble(), 0.0)).all { it.isEmpty }
}
if (collisionTests.all { it }) {
player.updatePosition(player.x, player.y - 10, player.z)
} else {
val n = collisionTests.indexOf(true)
if (n != -1)
player.updatePosition(player.x, player.y - n - 2, player.z)
}
}
}
}

2
vendor

@ -1 +1 @@
Subproject commit 023e12b313d17b8295d703a53667c790e808c778
Subproject commit 8df3c1cf900ad8550989d4c2492cb8982d261a4c