public static boolean areStacksEqual(ItemStack stack1, ItemStack stack2, boolean checkMeta, boolean checkNBT, boolean checkOreDict, boolean checkModSimilarity){
if(stack1 == null && stack2 == null) return true;
if(stack1 == null && stack2 != null || stack1 != null && stack2 == null) return false;
if(checkModSimilarity) {
UniqueIdentifier id1 = GameRegistry.findUniqueIdentifierFor(stack1.getItem());
if(id1 == null || id1.modId == null) return false;
String modId1 = id1.modId;
UniqueIdentifier id2 = GameRegistry.findUniqueIdentifierFor(stack2.getItem());
if(id2 == null || id2.modId == null) return false;
String modId2 = id2.modId;
return modId1.equals(modId2);
}
if(checkOreDict) {