Skip to content

Commit b4ccee8

Browse files
committed
fixed placements and removed interaction checks
1 parent bf39de5 commit b4ccee8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

common/src/main/kotlin/com/lambda/interaction/material/container/containers/MainHandContainer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object MainHandContainer : MaterialContainer(Rank.MAIN_HAND) {
4343
override val name: String get() = "Depositing [$selection] to ${hand.name.lowercase().replace("_", " ")}"
4444

4545
override fun SafeContext.onStart() {
46-
val moveStack = matchingStacks(selection).firstOrNull() ?: run {
46+
val moveStack = InventoryContainer.matchingStacks(selection).firstOrNull() ?: run {
4747
failure("No matching stacks found in inventory")
4848
return
4949
}

common/src/main/kotlin/com/lambda/interaction/request/placing/PlaceManager.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ object PlaceManager : RequestHandler<PlaceRequest>() {
6161
listen<TickEvent.Pre>(Int.MIN_VALUE) {
6262
preEvent()
6363

64-
if (!updateRequest { true }) {
64+
if (!updateRequest { request ->
65+
pendingInteractions.none { pending -> pending.context.expectedPos == request.value.placeContext.expectedPos }
66+
}) {
6567
postEvent()
6668
return@listen
6769
}
@@ -178,9 +180,11 @@ object PlaceManager : RequestHandler<PlaceRequest>() {
178180
val itemStack = player.getStackInHand(hand)
179181
if (interaction.currentGameMode == GameMode.SPECTATOR) return ActionResult.SUCCESS
180182

181-
val handNotEmpty = !player.getStackInHand(hand).isEmpty
182-
val cantInteract = player.shouldCancelInteraction() && handNotEmpty
183-
if (!cantInteract) return ActionResult.PASS
183+
// checks if the player should be able to interact with the block for if its something
184+
// like a furnace or chest where an action would happen
185+
// val handNotEmpty = player.getStackInHand(hand).isEmpty.not()
186+
// val cantInteract = player.shouldCancelInteraction() && handNotEmpty
187+
// if (!cantInteract) return ActionResult.PASS
184188

185189
if (!itemStack.isEmpty && !player.itemCooldownManager.isCoolingDown(itemStack.item)) {
186190
val itemUsageContext = ItemUsageContext(player, hand, hitResult)

0 commit comments

Comments
 (0)