Skip to content

Commit 48db547

Browse files
committed
fix supporting block checks? And add setting to toggle it
1 parent e19e5af commit 48db547

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

common/src/main/kotlin/com/lambda/config/groups/BreakSettings.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class BreakSettings(
4646
override val breaksPerTick by c.setting("Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick") { vis() && page == Page.General }
4747
override val suitableToolsOnly by c.setting("Suitable Tools Only", false, "Places a restriction to only use tools suitable for the given block") { vis() && page == Page.General }
4848
override val avoidLiquids by c.setting("Avoid Liquids", true, "Avoids breaking blocks that would cause liquid to spill") { vis() && page == Page.General }
49+
override val avoidSupporting by c.setting("Avoid Supporting", true, "Avoids breaking the block supporting the player") { vis() && page == Page.General }
4950
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)") { vis() && page == Page.General }
5051
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks") { vis() && page == Page.General }
5152
override val forceFortunePickaxe by c.setting("Force Fortune Pickaxe", false, "Force fortune pickaxe when breaking blocks") { vis() && page == Page.General }

common/src/main/kotlin/com/lambda/interaction/construction/simulation/BuildSimulator.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,8 @@ object BuildSimulator {
597597
}
598598

599599
/* player is standing on top of the block */
600-
val pBox = player.boundingBox
601-
val aabb = pBox.withMinY(pBox.minY - 1.0E-6)
602-
world.findSupportingBlockPos(player, aabb).orElse(null)?.let { support ->
600+
if (breaking.avoidSupporting) player.supportingBlockPos.orElse(null)?.let { support ->
603601
if (support != pos) return@let
604-
val belowSupport = blockState(support.down())
605-
if (belowSupport.isSolidSurface(world, support, player, Direction.UP)) return@let
606602
acc.add(BreakResult.PlayerOnTop(pos, state))
607603
return acc
608604
}

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ abstract class BreakConfig : RequestConfig<BreakRequest>() {
4444
abstract val breaksPerTick: Int
4545
abstract val suitableToolsOnly: Boolean
4646
abstract val avoidLiquids: Boolean
47+
abstract val avoidSupporting: Boolean
4748
abstract val breakWeakBlocks: Boolean
4849
abstract val forceSilkTouch: Boolean
4950
abstract val forceFortunePickaxe: Boolean

0 commit comments

Comments
 (0)