Java Code Examples for net.minecraft.inventory.ItemStackHelper#getAndSplit()

The following examples show how to use net.minecraft.inventory.ItemStackHelper#getAndSplit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TileEntitySenderBaseInvenotried.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int i, int i1) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, i, i1);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 2
Source File: TileEntityProcessorBaseInventoried.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int i, int i1) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, i, i1);
    if (!itemstack.isEmpty()) {
        this.markDirty();
    }
    return itemstack;
}
 
Example 3
Source File: TileEntityTFStorage.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 4
Source File: TileEntityTofuBattery.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 5
Source File: TileEntityMapleCauldron.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 6
Source File: TileEntityDistillation.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
	ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

	if (!itemstack.isEmpty()) {
		this.markDirty();
	}

	return itemstack;
}
 
Example 7
Source File: TileEntityStoneMortar.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventorySlotItemStack, index, count);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 8
Source File: TileEntityBarrel.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
	ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

	if (!itemstack.isEmpty()) {
		this.markDirty();
	}

	return itemstack;
}
 
Example 9
Source File: TileEntityCampfirePot.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    ItemStack itemstack = ItemStackHelper.getAndSplit(inventory, index, count);

    if (!itemstack.isEmpty()) {
        this.markDirty();
    }

    return itemstack;
}
 
Example 10
Source File: GenericInventory.java    From OpenModsLib with MIT License 5 votes vote down vote up
@Override
@Nonnull
public ItemStack decrStackSize(int index, int count) {
	final ItemStack result = ItemStackHelper.getAndSplit(this.inventoryContents, index, count);

	if (!result.isEmpty())
		onInventoryChanged(index);

	return result;
}
 
Example 11
Source File: TileEntitySaltFurnace.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
    return ItemStackHelper.getAndSplit(this.furnaceItemStacks, index, count);
}
 
Example 12
Source File: TileEntityMinecoprocessor.java    From Minecoprocessors with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemStack decrStackSize(int index, int count) {
  markDirty();
  return ItemStackHelper.getAndSplit(codeItemStacks, index, count);
}