final NPCComposite method1149() {
        int j = -1;
        if (anInt2099 == -1) {
            if (anInt2077 != -1) {
                j = Class21.settings[anInt2077];
            }
        } else {
            j = Class142_Sub27_Sub14.method1892(anInt2099);
        }
        if (~j > -1 || j >= -1 + anIntArray2085.length || anIntArray2085[j] == -1) {
            int k = anIntArray2085[-1 + anIntArray2085.length];
            if (k == -1) {
                return null;
            } else {
                return Class21.npcCompositeForID(k);
            }
        }
        return Class21.npcCompositeForID(anIntArray2085[j]);
    }