Cyclops Core

Cyclops Core

111M Downloads

Unnecessary areItemStacksIdentical method

josephcsible opened this issue ยท 3 comments

commented

/**
* If the given itemstacks are completely identical, including their stack size.
* @param a The first itemstack.
* @param b The second itemstack.
* @return If they are completely equal.
*/
public static boolean areItemStacksIdentical(ItemStack a, ItemStack b) {
return ItemStack.areItemStacksEqual(a, b) && ((a.isEmpty() && b.isEmpty()) || (!a.isEmpty() && a.getCount() == b.getCount()));
}

What's the point of this, specifically everything after the && on line 190? I see no case when ItemStack.areItemStacksEqual would return true but this method would return false.

commented

Either ItemStack.areItemStacksEqual used to not take into account stacksizes in the past, or I didn't check the implementation properly. Eitherway, the part after && can indeed be removed.

commented

Can the entire method be deprecated for removal in 1.13?

commented

Yep, good idea.