Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ object ScaffoldBreezilyTechnique : ScaffoldTechnique("Breezily") {
),
FaceHandlingOptions(CenterTargetPositionFactory),
stackToPlaceWith = bestStack,
PlayerLocationOnPlacement(position = predictedPos, pose = predictedPose),
PlayerLocationOnPlacement(position = predictedPos, pose = predictedPose)
)

return findBestBlockPlacementTarget(getTargetedPosition(predictedPos.toBlockPos()), searchOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ object ScaffoldGodBridgeTechnique : ScaffoldTechnique("GodBridge"), ScaffoldLedg
),
FaceHandlingOptions(CenterTargetPositionFactory),
stackToPlaceWith = bestStack,
PlayerLocationOnPlacement(position = predictedPos, pose = predictedPose),
PlayerLocationOnPlacement(position = predictedPos, pose = predictedPose)
)

return findBestBlockPlacementTarget(getTargetedPosition(predictedPos.toBlockPos()), searchOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.world.scaffold.techniques

import net.ccbluex.liquidbounce.config.types.NamedChoice
import net.ccbluex.liquidbounce.event.events.PlayerAfterJumpEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.modules.movement.ModuleFreeze
Expand Down Expand Up @@ -50,8 +51,15 @@ import kotlin.random.Random
*/
object ScaffoldNormalTechnique : ScaffoldTechnique("Normal") {

private val aimMode by enumChoice("RotationMode", AimMode.STABILIZED)
private val requiresSight by boolean("RequiresSight", false)
private val rotationMode by enumChoice("RotationMode", AimMode.STABILIZED)
private val visibilityMode by enumChoice("VisibilityMode", VisibilityMode.VISIBLE)

@Suppress("unused")
private enum class VisibilityMode(override val choiceName: String) : NamedChoice {
VISIBLE_AND_RAYTRACED("VisibleAndRaytraced"),
VISIBLE("Visible"),
ALLOW_NOT_VISIBLE("AllowNotVisible")
}

init {
tree(ScaffoldEagleFeature)
Expand Down Expand Up @@ -95,7 +103,8 @@ object ScaffoldNormalTechnique : ScaffoldTechnique("Normal") {
),
FaceHandlingOptions(
facePositionFactory,
considerFacingAwayFaces = ScaffoldDownFeature.shouldGoDown
considerFacingAwayFaces = visibilityMode == VisibilityMode.ALLOW_NOT_VISIBLE
|| ScaffoldDownFeature.shouldGoDown
),
stackToPlaceWith = bestStack,
PlayerLocationOnPlacement(position = predictedPos, pose = predictedPose),
Expand All @@ -115,12 +124,12 @@ object ScaffoldNormalTechnique : ScaffoldTechnique("Normal") {
}
}

if (requiresSight) {
if (visibilityMode == VisibilityMode.VISIBLE_AND_RAYTRACED) {
val target = target ?: return null
val raycast = raycast(rotation = target.rotation)

if (raycast.type == HitResult.Type.BLOCK && raycast.blockPos == target.interactedBlockPos) {
return target.rotation
if (raycast.type != HitResult.Type.BLOCK || raycast.blockPos != target.interactedBlockPos) {
return null
}
}

Expand All @@ -136,7 +145,7 @@ object ScaffoldNormalTechnique : ScaffoldTechnique("Normal") {
}

// Allow a non-visible hit result
if (ScaffoldDownFeature.shouldGoDown) {
if (visibilityMode == VisibilityMode.ALLOW_NOT_VISIBLE || ScaffoldDownFeature.shouldGoDown) {
return target.blockHitResult
}

Expand All @@ -150,7 +159,7 @@ object ScaffoldNormalTechnique : ScaffoldTechnique("Normal") {
randomization,
)

return when (aimMode) {
return when (rotationMode) {
AimMode.CENTER -> CenterTargetPositionFactory
AimMode.RANDOM -> RandomTargetPositionFactory
AimMode.STABILIZED -> StabilizedRotationTargetPositionFactory(config, optimalLine)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ object ScaffoldEagleFeature : ToggleableConfigurable(ScaffoldNormalTechnique, "E
// Makes you sneak until first block placed, so with eagle enabled you won't fall off, when enabled
private var placedBlocks = 0

val stateUpdateHandler =
handler<MovementInputEvent>(priority = EventPriorityConvention.SAFETY_FEATURE) {
if (mode == EagleMode.INPUT && shouldEagle(it.directionalInput)) {
it.sneak = true
}
@Suppress("unused")
val stateUpdateHandler = handler<MovementInputEvent>(priority = EventPriorityConvention.SAFETY_FEATURE) { event ->
if (mode == EagleMode.INPUT && shouldEagle(event.directionalInput)) {
event.sneak = true
}
}

fun shouldEagle(input: DirectionalInput): Boolean {
if (ScaffoldDownFeature.shouldFallOffBlock()) {
Expand Down
Loading