Search in sources :

Example 6 with InventoryAdvanced

use of mods.railcraft.common.util.inventory.InventoryAdvanced in project Railcraft by Railcraft.

the class InventoryTest method moveOneItemTo.

@Test
void moveOneItemTo() {
    ItemStack srcStack = new ItemStack(Items.APPLE, 32);
    InventoryAdvanced invSrc = new InventoryAdvanced(6);
    InventoryAdvanced invDest = new InventoryAdvanced(6);
    invSrc.setInventorySlotContents(3, srcStack);
    ItemStack resultStack = invSrc.moveOneItemTo(invDest);
    Assertions.assertEquals(31, srcStack.getCount());
    Assertions.assertEquals(1, resultStack.getCount());
    Assertions.assertEquals(1, invDest.countItems());
}
Also used : InventoryAdvanced(mods.railcraft.common.util.inventory.InventoryAdvanced) ItemStack(net.minecraft.item.ItemStack) Test(org.junit.jupiter.api.Test)

Aggregations

InventoryAdvanced (mods.railcraft.common.util.inventory.InventoryAdvanced)6 Test (org.junit.jupiter.api.Test)6 ItemStack (net.minecraft.item.ItemStack)5 IInventoryComposite (mods.railcraft.common.util.inventory.IInventoryComposite)1 InventoryComposite (mods.railcraft.common.util.inventory.InventoryComposite)1 InventoryBasic (net.minecraft.inventory.InventoryBasic)1 EnumFacing (net.minecraft.util.EnumFacing)1 ICapabilityProvider (net.minecraftforge.common.capabilities.ICapabilityProvider)1 InvWrapper (net.minecraftforge.items.wrapper.InvWrapper)1