File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/kotlin/com/lambda/interaction
construction/simulation/checks Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1818package com.lambda.interaction.construction.simulation.checks
1919
2020import com.lambda.context.AutomatedSafeContext
21+ import com.lambda.interaction.construction.simulation.BreakSimInfo
2122import com.lambda.interaction.construction.simulation.Results
2223import com.lambda.interaction.construction.simulation.SimDsl
2324import com.lambda.interaction.construction.simulation.SimInfo
@@ -47,7 +48,7 @@ object BasicChecker : Results<PreSimResult> {
4748 }
4849
4950 // block should be ignored
50- if (state.block in breakConfig.ignoredBlocks && targetState.isEmpty() ) {
51+ if (state.block in breakConfig.ignoredBlocks && this @hasBasicRequirements is BreakSimInfo ) {
5152 result(GenericResult .Ignored (pos))
5253 return false
5354 }
@@ -70,7 +71,7 @@ object BasicChecker : Results<PreSimResult> {
7071 return false
7172 }
7273
73- // block is unbreakable, so it cant be broken or replaced
74+ // block is unbreakable, so it can't be broken or replaced
7475 if (state.getHardness(world, pos) < 0 && ! gamemode.isCreative) {
7576 result(PreSimResult .Unbreakable (pos, state))
7677 return false
Original file line number Diff line number Diff line change @@ -425,10 +425,9 @@ object BreakManager : Manager<BreakRequest>(
425425 private fun SafeContext.canAccept (newCtx : BreakContext ): Boolean {
426426 if (activeInfos.none { it.context.blockPos == newCtx.blockPos } && isPosBlocked(newCtx.blockPos)) return false
427427
428- val blockState = blockState(newCtx.blockPos)
429428 val hardness = newCtx.cachedState.getHardness(world, newCtx.blockPos)
430429
431- return blockState. isNotEmpty && hardness != 600f && hardness != - 1f
430+ return newCtx.cachedState. isNotEmpty && ( hardness != - 1f || player.isCreative)
432431 }
433432
434433 /* *
You can’t perform that action at this time.
0 commit comments