Search in sources :

Example 16 with SlotTransaction

use of org.spongepowered.api.item.inventory.transaction.SlotTransaction in project LanternServer by LanternPowered.

the class ArmorQuickEquipInteractionBehavior method tryInteract.

@Override
public BehaviorResult tryInteract(BehaviorPipeline<Behavior> pipeline, BehaviorContext context) {
    final LanternPlayer player = (LanternPlayer) context.requireContext(ContextKeys.PLAYER);
    final ItemStack itemStack = context.requireContext(ContextKeys.USED_ITEM_STACK);
    final PeekedOfferTransactionResult peekResult = player.getInventory().getEquipment().peekOffer(itemStack.copy());
    if (peekResult.isSuccess()) {
        final List<SlotTransaction> transactions = new ArrayList<>(peekResult.getTransactions());
        final AbstractSlot slot = (AbstractSlot) context.getContext(ContextKeys.USED_SLOT).orElse(null);
        if (slot != null) {
            transactions.add(new SlotTransaction(slot, itemStack.createSnapshot(), LanternItemStack.toSnapshot(peekResult.getRejectedItem().orElse(null))));
        }
        final ChangeInventoryEvent.Equipment event = SpongeEventFactory.createChangeInventoryEventEquipment(context.getCurrentCause(), player.getInventory(), transactions);
        if (event.isCancelled()) {
            return BehaviorResult.CONTINUE;
        }
        event.getTransactions().stream().filter(Transaction::isValid).forEach(slotTransaction -> slotTransaction.getSlot().set(slotTransaction.getFinal().createStack()));
        return BehaviorResult.SUCCESS;
    }
    return BehaviorResult.CONTINUE;
}
Also used : AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ArrayList(java.util.ArrayList) ChangeInventoryEvent(org.spongepowered.api.event.item.inventory.ChangeInventoryEvent) PeekedOfferTransactionResult(org.lanternpowered.server.inventory.PeekedOfferTransactionResult) ItemStack(org.spongepowered.api.item.inventory.ItemStack) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer)

Example 17 with SlotTransaction

use of org.spongepowered.api.item.inventory.transaction.SlotTransaction in project LanternServer by LanternPowered.

the class AdvancementTest method onChangeInventory.

@SuppressWarnings("ConstantConditions")
@Listener
public void onChangeInventory(ChangeInventoryEvent event, @First Player player, @Getter("getTargetInventory") CarriedInventory<?> container) {
    if (!container.getName().get().equals("Furnace")) {
        return;
    }
    final Carrier carrier = container.getCarrier().orElse(null);
    if (!(carrier instanceof Furnace)) {
        return;
    }
    final Furnace furnace = (Furnace) carrier;
    final int passed = furnace.passedBurnTime().get();
    final int max = furnace.maxBurnTime().get();
    if (max <= 0 || passed >= max) {
        return;
    }
    for (SlotTransaction transaction : event.getTransactions()) {
        if (container.getInventoryProperty(transaction.getSlot(), SlotIndex.class).get().getValue() == 0) {
            if (transaction.getFinal().getType() == ItemTypes.DIRT) {
                player.getProgress(this.cookDirtAdvancement).grant();
            } else if (this.suicidalAdvancement != null && (transaction.getFinal().getType() == ItemTypes.TNT || transaction.getFinal().getType() == ItemTypes.TNT_MINECART)) {
                player.getProgress(this.suicidalAdvancement).grant();
            /*
                    final Explosion explosion = Explosion.builder()
                            .location(furnace.getLocation())
                            .shouldBreakBlocks(true)
                            .canCauseFire(true)
                            .shouldDamageEntities(true)
                            .radius(7)
                            .build();
                    explosion.getWorld().triggerExplosion(explosion);
                    */
            }
        }
    }
}
Also used : SlotIndex(org.spongepowered.api.item.inventory.property.SlotIndex) Carrier(org.spongepowered.api.item.inventory.Carrier) Furnace(org.spongepowered.api.block.tileentity.carrier.Furnace) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) Listener(org.spongepowered.api.event.Listener)

Example 18 with SlotTransaction

use of org.spongepowered.api.item.inventory.transaction.SlotTransaction in project LanternServer by LanternPowered.

the class VanillaContainerInteractionBehavior method handleNumberKey.

@Override
public void handleNumberKey(ClientContainer clientContainer, ClientSlot clientSlot, int number) {
    if (clientContainer.getPlayer() != this.container.getPlayerInventory().getCarrier().orElse(null) || !(clientSlot instanceof ClientSlot.Slot)) {
        return;
    }
    final ClientSlot hotbarSlot = clientContainer.getClientSlot(clientContainer.getHotbarSlotIndex(number - 1)).orElseThrow(() -> new IllegalStateException("Missing hotbar client slot: " + number));
    if (!(hotbarSlot instanceof ClientSlot.Slot)) {
        return;
    }
    final AbstractSlot slot1 = ((ClientSlot.Slot) clientSlot).getSlot();
    final AbstractSlot hotbarSlot1 = ((ClientSlot.Slot) hotbarSlot).getSlot();
    if (slot1 != hotbarSlot1) {
        final List<SlotTransaction> transactions = new ArrayList<>();
        final Transaction<ItemStackSnapshot> cursorTransaction;
        if (getCursorItem() == null) {
            cursorTransaction = new Transaction<>(ItemStackSnapshot.NONE, ItemStackSnapshot.NONE);
            final ItemStack itemStack = slot1.getRawItemStack();
            final ItemStack hotbarItemStack = hotbarSlot1.getRawItemStack();
            final ItemStackSnapshot itemStackSnapshot = LanternItemStack.toSnapshot(itemStack);
            final ItemStackSnapshot hotbarItemStackSnapshot = LanternItemStack.toSnapshot(hotbarItemStack);
            if (!(itemStackSnapshot != ItemStackSnapshot.NONE && (!hotbarSlot1.isValidItem(itemStack) || itemStackSnapshot.getQuantity() > hotbarSlot1.getMaxStackSize())) && !(hotbarItemStackSnapshot != ItemStackSnapshot.NONE && (!slot1.isValidItem(hotbarItemStack) || hotbarItemStack.getQuantity() > slot1.getMaxStackSize()))) {
                transactions.add(new SlotTransaction(slot1, itemStackSnapshot, hotbarItemStackSnapshot));
                transactions.add(new SlotTransaction(hotbarSlot1, hotbarItemStackSnapshot, itemStackSnapshot));
            }
        } else {
            final ItemStackSnapshot cursorItem = getCursorItem().createSnapshot();
            cursorTransaction = new Transaction<>(cursorItem, cursorItem);
        }
        final CauseStack causeStack = CauseStack.current();
        final ClickInventoryEvent.NumberPress event = SpongeEventFactory.createClickInventoryEventNumberPress(causeStack.getCurrentCause(), cursorTransaction, this.container, this.container.transformSlots(transactions), number - 1);
        finishInventoryEvent(event);
    }
}
Also used : CauseStack(org.lanternpowered.server.event.CauseStack) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ArrayList(java.util.ArrayList) ClickInventoryEvent(org.spongepowered.api.event.item.inventory.ClickInventoryEvent) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventorySlot(org.lanternpowered.server.inventory.AbstractInventorySlot) Slot(org.spongepowered.api.item.inventory.Slot) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternItemStackSnapshot(org.lanternpowered.server.inventory.LanternItemStackSnapshot) ItemStack(org.spongepowered.api.item.inventory.ItemStack) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack)

Example 19 with SlotTransaction

use of org.spongepowered.api.item.inventory.transaction.SlotTransaction in project LanternServer by LanternPowered.

the class VanillaContainerInteractionBehavior method handleDoubleClick.

@Override
public void handleDoubleClick(ClientContainer clientContainer, ClientSlot clientSlot) {
    final LanternPlayer player = clientContainer.getPlayer();
    if (player != this.container.getPlayerInventory().getCarrier().orElse(null) || !(clientSlot instanceof ClientSlot.Slot)) {
        return;
    }
    final AbstractSlot slot = ((ClientSlot.Slot) clientSlot).getSlot();
    final ItemStackSnapshot oldItem = LanternItemStack.toSnapshot(getCursorItem());
    ItemStackSnapshot newItem = oldItem;
    final List<SlotTransaction> transactions = new ArrayList<>();
    if (getCursorItem() != null && !(slot instanceof OutputSlot)) {
        final ItemStack cursorItem = getCursorItem().copy();
        int quantity = cursorItem.getQuantity();
        final int maxQuantity = cursorItem.getMaxStackQuantity();
        if (quantity < maxQuantity) {
            final AbstractInventory inventory;
            if (clientContainer instanceof PlayerClientContainer) {
                inventory = this.container.getPlayerInventory().getView(LanternPlayerInventory.View.ALL_PRIORITY_MAIN);
            } else {
                inventory = AbstractOrderedInventory.viewBuilder().inventory(this.container.getOpenInventory()).inventory(this.container.getPlayerInventory().getView(LanternPlayerInventory.View.PRIORITY_MAIN_AND_HOTBAR)).build();
            }
            // Try first to get enough unfinished stacks
            PeekedPollTransactionResult peekResult = inventory.peekPoll(maxQuantity - quantity, stack -> stack.getQuantity() < stack.getMaxStackQuantity() && ((LanternItemStack) cursorItem).similarTo(stack)).orElse(null);
            if (peekResult != null) {
                quantity += peekResult.getPolledItem().getQuantity();
                transactions.addAll(peekResult.getTransactions());
            }
            // Get the last items for the stack from a full stack
            if (quantity <= maxQuantity) {
                peekResult = this.container.peekPoll(maxQuantity - quantity, stack -> stack.getQuantity() >= stack.getMaxStackQuantity() && ((LanternItemStack) cursorItem).similarTo(stack)).orElse(null);
                if (peekResult != null) {
                    quantity += peekResult.getPolledItem().getQuantity();
                    transactions.addAll(peekResult.getTransactions());
                }
            }
            cursorItem.setQuantity(quantity);
            newItem = cursorItem.createSnapshot();
        }
    }
    final CauseStack causeStack = CauseStack.current();
    final Transaction<ItemStackSnapshot> cursorTransaction = new Transaction<>(oldItem, newItem);
    final ClickInventoryEvent.Double event = SpongeEventFactory.createClickInventoryEventDouble(causeStack.getCurrentCause(), cursorTransaction, this.container, this.container.transformSlots(transactions));
    finishInventoryEvent(event);
}
Also used : EventContextKeys(org.spongepowered.api.event.cause.EventContextKeys) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternPlayerInventory(org.lanternpowered.server.inventory.vanilla.LanternPlayerInventory) LanternItemStackSnapshot(org.lanternpowered.server.inventory.LanternItemStackSnapshot) CraftingResult(org.spongepowered.api.item.recipe.crafting.CraftingResult) ItemStack(org.spongepowered.api.item.inventory.ItemStack) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) ClickInventoryEvent(org.spongepowered.api.event.item.inventory.ClickInventoryEvent) Transaction(org.spongepowered.api.data.Transaction) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) ExtendedCraftingResult(org.lanternpowered.server.item.recipe.crafting.ExtendedCraftingResult) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) MatrixResult(org.lanternpowered.server.item.recipe.crafting.MatrixResult) Sponge(org.spongepowered.api.Sponge) CraftingGridInventory(org.spongepowered.api.item.inventory.crafting.CraftingGridInventory) Tuple(org.spongepowered.api.util.Tuple) Streams(com.google.common.collect.Streams) CraftingOutput(org.spongepowered.api.item.inventory.crafting.CraftingOutput) Collectors(java.util.stream.Collectors) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) Lantern(org.lanternpowered.server.game.Lantern) Transform(org.spongepowered.api.entity.Transform) GameMode(org.spongepowered.api.entity.living.player.gamemode.GameMode) ChangeInventoryEvent(org.spongepowered.api.event.item.inventory.ChangeInventoryEvent) CraftingInventory(org.spongepowered.api.item.inventory.crafting.CraftingInventory) World(org.spongepowered.api.world.World) Optional(java.util.Optional) AbstractOrderedInventory(org.lanternpowered.server.inventory.AbstractOrderedInventory) Player(org.spongepowered.api.entity.living.player.Player) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) ClientContainer(org.lanternpowered.server.inventory.client.ClientContainer) IInventory(org.lanternpowered.server.inventory.IInventory) Keys(org.spongepowered.api.data.key.Keys) PeekedSetTransactionResult(org.lanternpowered.server.inventory.PeekedSetTransactionResult) GameModes(org.spongepowered.api.entity.living.player.gamemode.GameModes) ArrayList(java.util.ArrayList) CauseStack(org.lanternpowered.server.event.CauseStack) PlayerInventoryContainer(org.lanternpowered.server.inventory.PlayerInventoryContainer) LanternContainer(org.lanternpowered.server.inventory.LanternContainer) PlayerClientContainer(org.lanternpowered.server.inventory.client.PlayerClientContainer) LanternWorld(org.lanternpowered.server.world.LanternWorld) CraftingMatrix(org.lanternpowered.server.item.recipe.crafting.CraftingMatrix) Nullable(javax.annotation.Nullable) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventorySlot(org.lanternpowered.server.inventory.AbstractInventorySlot) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) LanternEventHelper(org.lanternpowered.server.event.LanternEventHelper) PeekedPollTransactionResult(org.lanternpowered.server.inventory.PeekedPollTransactionResult) SpawnEntityEvent(org.spongepowered.api.event.entity.SpawnEntityEvent) Slot(org.spongepowered.api.item.inventory.Slot) Entity(org.spongepowered.api.entity.Entity) PeekedOfferTransactionResult(org.lanternpowered.server.inventory.PeekedOfferTransactionResult) SpawnTypes(org.spongepowered.api.event.cause.entity.spawn.SpawnTypes) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer) LanternHotbarInventory(org.lanternpowered.server.inventory.vanilla.LanternHotbarInventory) AbstractInventory(org.lanternpowered.server.inventory.AbstractInventory) CauseStack(org.lanternpowered.server.event.CauseStack) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ArrayList(java.util.ArrayList) ClickInventoryEvent(org.spongepowered.api.event.item.inventory.ClickInventoryEvent) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventory(org.lanternpowered.server.inventory.AbstractInventory) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) Transaction(org.spongepowered.api.data.Transaction) PlayerClientContainer(org.lanternpowered.server.inventory.client.PlayerClientContainer) PeekedPollTransactionResult(org.lanternpowered.server.inventory.PeekedPollTransactionResult) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventorySlot(org.lanternpowered.server.inventory.AbstractInventorySlot) Slot(org.spongepowered.api.item.inventory.Slot) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternItemStackSnapshot(org.lanternpowered.server.inventory.LanternItemStackSnapshot) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) ItemStack(org.spongepowered.api.item.inventory.ItemStack) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer)

Example 20 with SlotTransaction

use of org.spongepowered.api.item.inventory.transaction.SlotTransaction in project LanternServer by LanternPowered.

the class VanillaContainerInteractionBehavior method handleDrag.

@Override
public void handleDrag(ClientContainer clientContainer, List<ClientSlot> clientSlots, MouseButton mouseButton) {
    final LanternPlayer player = clientContainer.getPlayer();
    if (player != this.container.getPlayerInventory().getCarrier().orElse(null)) {
        return;
    }
    final List<AbstractSlot> slots = clientSlots.stream().filter(clientSlot -> clientSlot instanceof ClientSlot.Slot).map(clientSlot -> ((ClientSlot.Slot) clientSlot).getSlot()).collect(Collectors.toList());
    if (slots.size() != clientSlots.size()) {
        // TODO: Is this the behavior we want?
        return;
    }
    final ItemStack cursorItem = getCursorItem();
    if (cursorItem == null || cursorItem.isEmpty()) {
        return;
    }
    final CauseStack causeStack = CauseStack.current();
    if (mouseButton == MouseButton.LEFT) {
        final int quantity = cursorItem.getQuantity();
        final int slotCount = slots.size();
        final int itemsPerSlot = quantity / slotCount;
        final int rest = quantity - itemsPerSlot * slotCount;
        final List<SlotTransaction> transactions = new ArrayList<>();
        for (AbstractSlot slot : slots) {
            final ItemStack itemStack = cursorItem.copy();
            itemStack.setQuantity(itemsPerSlot);
            transactions.addAll(slot.peekOffer(itemStack).getTransactions());
        }
        ItemStackSnapshot newCursorItem = ItemStackSnapshot.NONE;
        if (rest > 0) {
            final ItemStack itemStack = cursorItem.copy();
            itemStack.setQuantity(rest);
            newCursorItem = LanternItemStackSnapshot.wrap(itemStack);
        }
        final ItemStackSnapshot oldCursorItem = cursorItem.createSnapshot();
        final Transaction<ItemStackSnapshot> cursorTransaction = new Transaction<>(oldCursorItem, newCursorItem);
        final ClickInventoryEvent.Drag.Primary event = SpongeEventFactory.createClickInventoryEventDragPrimary(causeStack.getCurrentCause(), cursorTransaction, this.container, transactions);
        finishInventoryEvent(event);
    } else if (mouseButton == MouseButton.RIGHT) {
        int quantity = cursorItem.getQuantity();
        final int size = Math.min(slots.size(), quantity);
        final List<SlotTransaction> transactions = new ArrayList<>();
        for (AbstractSlot slot : slots) {
            final ItemStack itemStack = cursorItem.copy();
            itemStack.setQuantity(1);
            transactions.addAll(slot.peekOffer(itemStack).getTransactions());
        }
        quantity -= size;
        ItemStackSnapshot newCursorItem = ItemStackSnapshot.NONE;
        if (quantity > 0) {
            final ItemStack itemStack = cursorItem.copy();
            itemStack.setQuantity(quantity);
            newCursorItem = LanternItemStackSnapshot.wrap(itemStack);
        }
        final ItemStackSnapshot oldCursorItem = getCursorItem().createSnapshot();
        final Transaction<ItemStackSnapshot> cursorTransaction = new Transaction<>(oldCursorItem, newCursorItem);
        final ClickInventoryEvent.Drag.Secondary event = SpongeEventFactory.createClickInventoryEventDragSecondary(causeStack.getCurrentCause(), cursorTransaction, this.container, this.container.transformSlots(transactions));
        finishInventoryEvent(event);
    } else {
    // TODO: Middle mouse drag mode
    }
}
Also used : EventContextKeys(org.spongepowered.api.event.cause.EventContextKeys) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternPlayerInventory(org.lanternpowered.server.inventory.vanilla.LanternPlayerInventory) LanternItemStackSnapshot(org.lanternpowered.server.inventory.LanternItemStackSnapshot) CraftingResult(org.spongepowered.api.item.recipe.crafting.CraftingResult) ItemStack(org.spongepowered.api.item.inventory.ItemStack) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) ClickInventoryEvent(org.spongepowered.api.event.item.inventory.ClickInventoryEvent) Transaction(org.spongepowered.api.data.Transaction) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) ExtendedCraftingResult(org.lanternpowered.server.item.recipe.crafting.ExtendedCraftingResult) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) MatrixResult(org.lanternpowered.server.item.recipe.crafting.MatrixResult) Sponge(org.spongepowered.api.Sponge) CraftingGridInventory(org.spongepowered.api.item.inventory.crafting.CraftingGridInventory) Tuple(org.spongepowered.api.util.Tuple) Streams(com.google.common.collect.Streams) CraftingOutput(org.spongepowered.api.item.inventory.crafting.CraftingOutput) Collectors(java.util.stream.Collectors) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) Lantern(org.lanternpowered.server.game.Lantern) Transform(org.spongepowered.api.entity.Transform) GameMode(org.spongepowered.api.entity.living.player.gamemode.GameMode) ChangeInventoryEvent(org.spongepowered.api.event.item.inventory.ChangeInventoryEvent) CraftingInventory(org.spongepowered.api.item.inventory.crafting.CraftingInventory) World(org.spongepowered.api.world.World) Optional(java.util.Optional) AbstractOrderedInventory(org.lanternpowered.server.inventory.AbstractOrderedInventory) Player(org.spongepowered.api.entity.living.player.Player) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) ClientContainer(org.lanternpowered.server.inventory.client.ClientContainer) IInventory(org.lanternpowered.server.inventory.IInventory) Keys(org.spongepowered.api.data.key.Keys) PeekedSetTransactionResult(org.lanternpowered.server.inventory.PeekedSetTransactionResult) GameModes(org.spongepowered.api.entity.living.player.gamemode.GameModes) ArrayList(java.util.ArrayList) CauseStack(org.lanternpowered.server.event.CauseStack) PlayerInventoryContainer(org.lanternpowered.server.inventory.PlayerInventoryContainer) LanternContainer(org.lanternpowered.server.inventory.LanternContainer) PlayerClientContainer(org.lanternpowered.server.inventory.client.PlayerClientContainer) LanternWorld(org.lanternpowered.server.world.LanternWorld) CraftingMatrix(org.lanternpowered.server.item.recipe.crafting.CraftingMatrix) Nullable(javax.annotation.Nullable) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventorySlot(org.lanternpowered.server.inventory.AbstractInventorySlot) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) LanternEventHelper(org.lanternpowered.server.event.LanternEventHelper) PeekedPollTransactionResult(org.lanternpowered.server.inventory.PeekedPollTransactionResult) SpawnEntityEvent(org.spongepowered.api.event.entity.SpawnEntityEvent) Slot(org.spongepowered.api.item.inventory.Slot) Entity(org.spongepowered.api.entity.Entity) PeekedOfferTransactionResult(org.lanternpowered.server.inventory.PeekedOfferTransactionResult) SpawnTypes(org.spongepowered.api.event.cause.entity.spawn.SpawnTypes) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer) LanternHotbarInventory(org.lanternpowered.server.inventory.vanilla.LanternHotbarInventory) AbstractInventory(org.lanternpowered.server.inventory.AbstractInventory) CauseStack(org.lanternpowered.server.event.CauseStack) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ArrayList(java.util.ArrayList) ClickInventoryEvent(org.spongepowered.api.event.item.inventory.ClickInventoryEvent) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) SlotTransaction(org.spongepowered.api.item.inventory.transaction.SlotTransaction) Transaction(org.spongepowered.api.data.Transaction) OutputSlot(org.spongepowered.api.item.inventory.slot.OutputSlot) AbstractSlot(org.lanternpowered.server.inventory.AbstractSlot) ClientSlot(org.lanternpowered.server.inventory.client.ClientSlot) AbstractInventorySlot(org.lanternpowered.server.inventory.AbstractInventorySlot) Slot(org.spongepowered.api.item.inventory.Slot) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternItemStackSnapshot(org.lanternpowered.server.inventory.LanternItemStackSnapshot) List(java.util.List) ArrayList(java.util.ArrayList) ItemStack(org.spongepowered.api.item.inventory.ItemStack) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer)

Aggregations

SlotTransaction (org.spongepowered.api.item.inventory.transaction.SlotTransaction)50 ItemStackSnapshot (org.spongepowered.api.item.inventory.ItemStackSnapshot)30 ArrayList (java.util.ArrayList)20 ItemStack (org.spongepowered.api.item.inventory.ItemStack)16 Inventory (org.spongepowered.api.item.inventory.Inventory)14 CraftingInventory (org.spongepowered.api.item.inventory.crafting.CraftingInventory)14 Entity (org.spongepowered.api.entity.Entity)13 Transaction (org.spongepowered.api.data.Transaction)11 ChangeInventoryEvent (org.spongepowered.api.event.item.inventory.ChangeInventoryEvent)11 ClickInventoryEvent (org.spongepowered.api.event.item.inventory.ClickInventoryEvent)11 Slot (org.spongepowered.api.item.inventory.Slot)11 Slot (net.minecraft.inventory.Slot)9 SPacketSetSlot (net.minecraft.network.play.server.SPacketSetSlot)9 AbstractSlot (org.lanternpowered.server.inventory.AbstractSlot)9 SpawnEntityEvent (org.spongepowered.api.event.entity.SpawnEntityEvent)9 IMixinContainer (org.spongepowered.common.interfaces.IMixinContainer)9 Nullable (javax.annotation.Nullable)8 ItemStack (net.minecraft.item.ItemStack)8 CauseStack (org.lanternpowered.server.event.CauseStack)8 List (java.util.List)7