From c8f98efb4d771f2c98f62199992898ef92badc74 Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Wed, 24 Mar 2021 13:08:16 -0400 Subject: [PATCH 1/3] [new] Add Parkour --- .../client/module/modules/movement/Parkour.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt new file mode 100644 index 0000000000..a656cefc72 --- /dev/null +++ b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt @@ -0,0 +1,21 @@ +package org.kamiblue.client.module.modules.movement + +import net.minecraftforge.fml.common.gameevent.TickEvent +import org.kamiblue.client.module.Category +import org.kamiblue.client.module.Module +import org.kamiblue.client.util.threads.safeListener + + +internal object Parkour : Module( + name = "Parkour", + description = "Jump at the edge of blocks", + category = Category.MOVEMENT +) { + init { + safeListener { + if(Companion.mc.player.onGround && + !Companion.mc.player.isSneaking && + Companion.mc.world.getCollisionBoxes(Companion.mc.player, Companion.mc.player.entityBoundingBox.offset(0.0, -0.5, 0.0).expand(-0.001, 0.0, -0.001)).isEmpty()) + Companion.mc.player.jump() } + } + } \ No newline at end of file From f1d0434e721daf10d673a3f8509105bc267ecaae Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Thu, 25 Mar 2021 10:04:30 -0400 Subject: [PATCH 2/3] Remove redundant calls to Companion --- .../kamiblue/client/module/modules/movement/Parkour.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt index a656cefc72..1475d4b7b9 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt @@ -13,9 +13,9 @@ internal object Parkour : Module( ) { init { safeListener { - if(Companion.mc.player.onGround && - !Companion.mc.player.isSneaking && - Companion.mc.world.getCollisionBoxes(Companion.mc.player, Companion.mc.player.entityBoundingBox.offset(0.0, -0.5, 0.0).expand(-0.001, 0.0, -0.001)).isEmpty()) - Companion.mc.player.jump() } + if(player.onGround && + !player.isSneaking && + world.getCollisionBoxes(player, player.entityBoundingBox.offset(0.0, -0.5, 0.0).expand(-0.001, 0.0, -0.001)).isEmpty()) + player.jump() } } } \ No newline at end of file From c4877cfa5af6fa8458678da4bffb35a6449de80e Mon Sep 17 00:00:00 2001 From: liv Date: Thu, 25 Mar 2021 13:56:59 -0400 Subject: [PATCH 3/3] Apply suggestions from code review --- .../client/module/modules/movement/Parkour.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt index 1475d4b7b9..320252e97e 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/movement/Parkour.kt @@ -5,17 +5,21 @@ import org.kamiblue.client.module.Category import org.kamiblue.client.module.Module import org.kamiblue.client.util.threads.safeListener - internal object Parkour : Module( name = "Parkour", - description = "Jump at the edge of blocks", + description = "Automatically jump at the edge of blocks", category = Category.MOVEMENT ) { init { safeListener { - if(player.onGround && - !player.isSneaking && - world.getCollisionBoxes(player, player.entityBoundingBox.offset(0.0, -0.5, 0.0).expand(-0.001, 0.0, -0.001)).isEmpty()) - player.jump() } + if ( + player.onGround && !player.isSneaking && + world.getCollisionBoxes(player, player.entityBoundingBox + .offset(0.0, -0.5, 0.0) + .expand(-0.001, 0.0, -0.001)).isEmpty() + ) { + player.jump() + } } - } \ No newline at end of file + } +}