final ItemDefinition method1177(int i) {
        if (stackIDs != null && i > 1) {
            int k = -1;
            for (int l = 0; l < 10; l++) {
                if (i >= stackAmounts[l] && stackAmounts[l] != 0) {
                    k = stackIDs[l];
                }
            }

            if (k != -1) {
                return NPC.itemDefinitionForID(k);
            }
        }
        return this;
    }