Skip to content

Commit

Permalink
fix(trigger): can't get children of CraftingMenu
Browse files Browse the repository at this point in the history
SpongePowered/Sponge#3705
Signed-off-by: SettingDust <[email protected]>
  • Loading branch information
SettingDust committed Jun 6, 2022
1 parent 250e3fc commit b267885
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import org.spongepowered.api.event.filter.type.Exclude;
import org.spongepowered.api.event.item.inventory.TransferInventoryEvent;
import org.spongepowered.api.event.item.inventory.container.ClickContainerEvent;
import org.spongepowered.api.item.inventory.Container;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
import org.spongepowered.api.item.inventory.Slot;
import org.spongepowered.api.item.inventory.*;
import org.spongepowered.api.item.inventory.entity.PrimaryPlayerInventory;
import org.spongepowered.api.item.inventory.entity.StandardInventory;
import org.spongepowered.api.item.inventory.transaction.SlotTransaction;
Expand Down Expand Up @@ -100,7 +97,7 @@ public void onClickContainer(
final var cancelled = new AtomicBoolean(false);
final var containerSlots =
transactions.stream().filter(IS_STANDARD_INVENTORY.negate()).toList();
final var fallbackInventory = event.inventory().children().stream()
final var fallbackInventory = event.inventory().viewed().stream()
.filter(it -> it instanceof PrimaryPlayerInventory)
.findAny()
.or(() -> transactions.stream()
Expand Down

0 comments on commit b267885

Please sign in to comment.