File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
src/main/kotlin/com/lambda/interaction/construction Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,7 @@ sealed class PlaceResult : BuildResult() {
151151 * @property simulated The context of the simulated item placement attempt.
152152 */
153153 data class ScaffoldExceeded (
154- override val pos : BlockPos ,
155- val simulated : ItemPlacementContext ,
154+ override val pos : BlockPos
156155 ) : PlaceResult() {
157156 override val rank = Rank .PlaceScaffoldExceeded
158157 }
Original file line number Diff line number Diff line change @@ -154,13 +154,18 @@ class PlaceSim private constructor(simInfo: ISimInfo)
154154 buildConfig.pointSelection.select(validHits)?.let { checkedHit ->
155155 val hitResult = checkedHit.hit.blockResult ? : return
156156
157- var context = ItemPlacementContext (
158- world,
159- fakePlayer,
160- Hand .MAIN_HAND ,
161- swapStack,
162- hitResult,
163- )
157+ val context = swapStack.blockItem.getPlacementContext(
158+ ItemPlacementContext (
159+ world,
160+ fakePlayer,
161+ Hand .MAIN_HAND ,
162+ swapStack,
163+ hitResult,
164+ )
165+ ) ? : run {
166+ result(PlaceResult .ScaffoldExceeded (pos))
167+ return
168+ }
164169
165170 if (context.blockPos != pos) {
166171 result(PlaceResult .UnexpectedPosition (pos, context.blockPos))
@@ -178,11 +183,6 @@ class PlaceSim private constructor(simInfo: ISimInfo)
178183 return
179184 }
180185
181- context = swapStack.blockItem.getPlacementContext(context) ? : run {
182- result(PlaceResult .ScaffoldExceeded (pos, context))
183- return
184- }
185-
186186 val rotatePlaceTest = simRotatePlace(fakePlayer, checkedHit, context) ? : return
187187
188188 val rotationRequest = if (placeConfig.axisRotate) {
You can’t perform that action at this time.
0 commit comments