@@ -31,7 +31,6 @@ import com.lambda.interaction.material.container.ContainerManager.findBestAvaila
3131import com.lambda.interaction.request.rotation.Rotation.Companion.rotation
3232import com.lambda.interaction.request.rotation.Rotation.Companion.rotationTo
3333import com.lambda.interaction.request.rotation.RotationRequest
34- import com.lambda.interaction.request.rotation.visibilty.RequestedHit
3534import com.lambda.interaction.request.rotation.visibilty.VisibilityChecker.CheckedHit
3635import com.lambda.interaction.request.rotation.visibilty.VisibilityChecker.getVisibleSurfaces
3736import com.lambda.interaction.request.rotation.visibilty.VisibilityChecker.scanSurfaces
@@ -55,7 +54,6 @@ import net.minecraft.item.ItemUsageContext
5554import net.minecraft.registry.RegistryKeys
5655import net.minecraft.state.property.Properties
5756import net.minecraft.util.Hand
58- import net.minecraft.util.hit.HitResult
5957import net.minecraft.util.math.BlockPos
6058import net.minecraft.util.math.Box
6159import net.minecraft.util.math.Direction
@@ -152,7 +150,7 @@ object BuildSimulator {
152150 hit.blockResult?.blockPos == hitPos && hit.blockResult?.side == hitSide
153151 }
154152
155- val checkedHits = mutableListOf<CheckedHit >()
153+ val validHits = mutableListOf<CheckedHit >()
156154 val misses = mutableSetOf<Vec3d >()
157155 val reachSq = reach.pow(2 )
158156
@@ -175,11 +173,11 @@ object BuildSimulator {
175173 val checked = CheckedHit (hit, newRotation, reach)
176174 if (! checked.verify()) return @scanSurfaces
177175
178- checkedHits .add(checked)
176+ validHits .add(checked)
179177 }
180178 }
181179
182- if (checkedHits .isEmpty()) {
180+ if (validHits .isEmpty()) {
183181 if (misses.isNotEmpty()) {
184182 acc.add(BuildResult .OutOfReach (pos, eye, misses))
185183 return @forEach
@@ -189,7 +187,7 @@ object BuildSimulator {
189187 return @forEach
190188 }
191189
192- interact.pointSelection.select(checkedHits )?.let { checkedHit ->
190+ interact.pointSelection.select(validHits )?.let { checkedHit ->
193191 val optimalStack = target.getStack(world, pos)
194192
195193 // ToDo: For each hand and sneak or not?
@@ -379,7 +377,6 @@ object BuildSimulator {
379377 hit.blockResult?.blockPos == pos
380378 }
381379
382- val checkedHits = mutableListOf<CheckedHit >()
383380 /* the player is buried inside the block */
384381 if (boxes.any { it.contains(eye) }) {
385382 currentCast?.blockResult?.let { blockHit ->
@@ -400,7 +397,7 @@ object BuildSimulator {
400397 }
401398 }
402399
403- val validHits = mutableMapOf< Vec3d , HitResult >()
400+ val validHits = mutableListOf< CheckedHit >()
404401 val misses = mutableSetOf<Vec3d >()
405402 val reachSq = reach.pow(2 )
406403
@@ -417,7 +414,7 @@ object BuildSimulator {
417414 val checked = CheckedHit (hit, newRotation, reach)
418415 if (! checked.verify()) return @scanSurfaces
419416
420- checkedHits .add(checked)
417+ validHits .add(checked)
421418 }
422419 }
423420
@@ -427,7 +424,7 @@ object BuildSimulator {
427424 return acc
428425 }
429426
430- interact.pointSelection.select(checkedHits )?.let { checkedHit ->
427+ interact.pointSelection.select(validHits )?.let { checkedHit ->
431428 val blockHit = checkedHit.hit.blockResult ? : return @let
432429
433430 val breakContext = BreakContext (
0 commit comments