private void sortGroupIds() { List<int[]> groupUniqueIds = new ArrayList<>(); for (int i = 0; i < getGroupCount(); i++) { groupUniqueIds.add(groupIndex.get(i).getGroupUniqueIds(new int[groupVarNames.size() + 1])); sortedGroupIds.add(i); } sortedGroupIds.sort((i1, i2) -> { int[] gui1 = groupUniqueIds.get(i1); int[] gui2 = groupUniqueIds.get(i2); for (int i = 0; i < gui1.length; i++) { int comp = Integer.compare(gui1[i], gui2[i]); if (comp != 0) { return comp; } } return gui1.length - gui2.length; }); }
@Override @Nonnull public IntList getValidItemStacksPacked() { if (packed == null) { packed = new IntArrayList(); for (ItemStack stack : basicStacks) packed.add(RecipeItemHelper.pack(stack)); packed.sort(IntComparators.NATURAL_COMPARATOR); } return packed; }
@Override public IntList getValidItemStacksPacked() { if (matchingStacksPacked == null) { matchingStacksPacked = new IntArrayList(this.matchingStacks.length); for (final ItemStack stack : this.matchingStacks) { matchingStacksPacked.add(RecipeItemHelper.pack(stack)); } matchingStacksPacked.sort(IntComparators.NATURAL_COMPARATOR); } return matchingStacksPacked; }
@Override @Nonnull public IntList getValidItemStacksPacked() { if (packed != null) return packed; packed = new IntArrayList(); for (ItemStack stack : getMatchingStacks()) packed.add(RecipeItemHelper.pack(stack)); packed.sort(IntComparators.NATURAL_COMPARATOR); return packed; }
@Override @Nonnull @SideOnly(Side.CLIENT) public IntList getValidItemStacksPacked() { if (this.itemIds == null || itemIds.size() != orbs.size()) { this.itemIds = new IntArrayList(orbs.size()); for (ItemStack itemstack : orbs) this.itemIds.add(RecipeItemHelper.pack(itemstack)); this.itemIds.sort(IntComparators.NATURAL_COMPARATOR); } return this.itemIds; }
@Override @Nonnull @SideOnly(Side.CLIENT) public IntList getValidItemStacksPacked() { if (this.itemIds == null || itemIds.size() != types.size()) { this.itemIds = new IntArrayList(types.size()); for (BackpackType type : types) this.itemIds.add(RecipeItemHelper.pack(IronBackpacksAPI.getStack(type, specialty))); this.itemIds.sort(IntComparators.NATURAL_COMPARATOR); } return this.itemIds; }
@Override @Nonnull @SideOnly(Side.CLIENT) public IntList getValidItemStacksPacked() { if (this.itemIds == null || this.itemIds.size() != ores.size()) { this.itemIds = new IntArrayList(this.ores.size()); for (ItemStack itemstack : this.ores) { if (itemstack.getMetadata() == OreDictionary.WILDCARD_VALUE) { NonNullList<ItemStack> lst = NonNullList.create(); itemstack.getItem().getSubItems(CreativeTabs.SEARCH, lst); for (ItemStack item : lst) { this.itemIds.add(RecipeItemHelper.pack(item)); } } else { this.itemIds.add(RecipeItemHelper.pack(itemstack)); } } this.itemIds.sort(IntComparators.NATURAL_COMPARATOR); } return this.itemIds; }