Paste 7lDgT

Submitted on 3 August 2015 at 21:47 UTC
787 views

Section 1 (java)

@Override
    public ItemStack decrStackSize (int slot, int amount) {
        if (contents[slot] != null) {
            ItemStack ret;
            if (contents[slot].stackSize <= amount) { //not enough items
                ret = contents[slot];
                contents[slot] = null;
            } else { //enough items
                ret = contents[slot].splitStack(amount);
                if (contents[slot].stackSize == 0) contents[slot] = null;
            }
            this.markDirty();
            return ret;
        }
        return null;
    }

Raw · Download

Pastee