(ItemStack aStack, boolean aCheckIFluidContainerItems)
| 847 | } |
| 848 | |
| 849 | public static ItemStack container(ItemStack aStack, boolean aCheckIFluidContainerItems) { |
| 850 | if (invalid(aStack)) return NI; |
| 851 | // Decrease Durability by 1 for these Items. |
| 852 | if (ItemsGT.CONTAINER_DURABILITY.contains(aStack, T)) return copyMeta(meta_(aStack) + 1, aStack); |
| 853 | // Use normal Container Item Mechanics. |
| 854 | if (item_(aStack).hasContainerItem(aStack)) return copy(item_(aStack).getContainerItem(aStack)); |
| 855 | // These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items. |
| 856 | if (IL.Cell_Empty.exists()) { |
| 857 | if (IL.Cell_Empty.equal(aStack, F, T)) return NI; |
| 858 | if (IL.Cell_Empty.equal(aStack, T, T)) return IL.Cell_Empty.get(1); |
| 859 | } |
| 860 | if (IL.SC2_Teapot_Empty.exists()) { |
| 861 | if (IL.SC2_Teapot_Empty.equal(aStack, F, T)) return NI; |
| 862 | if (IL.SC2_Teapot_Empty.equal(aStack, T, T)) return IL.SC2_Teapot_Empty.get(1); |
| 863 | } |
| 864 | if (IL.SC2_Teacup_Empty.exists()) { |
| 865 | if (IL.SC2_Teacup_Empty.equal(aStack, F, T)) return NI; |
| 866 | if (IL.SC2_Teacup_Empty.equal(aStack, T, T)) return IL.SC2_Teacup_Empty.get(1); |
| 867 | } |
| 868 | if (aCheckIFluidContainerItems && item_(aStack) instanceof IFluidContainerItem && ((IFluidContainerItem)item_(aStack)).getCapacity(aStack) > 0) { |
| 869 | ItemStack tStack = amount(1, aStack); |
| 870 | ((IFluidContainerItem)item_(aStack)).drain(tStack, Integer.MAX_VALUE, T); |
| 871 | if (tStack.stackSize <= 0) return NI; |
| 872 | if (tStack.getTagCompound() == null) return tStack; |
| 873 | if (tStack.getTagCompound().hasNoTags()) tStack.setTagCompound(null); |
| 874 | return tStack; |
| 875 | } |
| 876 | return NI; |
| 877 | } |
| 878 | |
| 879 | public static ItemStack container(ItemStack aStack, boolean aCheckIFluidContainerItems, int aSize) { |
| 880 | return amount(aSize, container(aStack, aCheckIFluidContainerItems)); |
no test coverage detected