Disable re-equip animation.

This commit is contained in:
raoulvdberge
2018-07-30 12:20:39 +02:00
parent 3685660ddd
commit 39858c1a10
2 changed files with 6 additions and 9 deletions

View File

@@ -88,6 +88,11 @@ public class ItemFilter extends ItemBase {
RenderUtils.addCombinedFluidsToTooltip(tooltip, false, fluids.getFilteredFluids());
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
return false;
}
public static int getCompare(ItemStack stack) {
return (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_COMPARE)) ? stack.getTagCompound().getInteger(NBT_COMPARE) : (IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
}

View File

@@ -122,15 +122,7 @@ public abstract class ItemNetworkItem extends ItemEnergyItem implements INetwork
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
if (oldStack.getItem() == newStack.getItem()) {
if (isValid(oldStack) && isValid(newStack)) {
if (getX(oldStack) == getX(newStack) && getY(oldStack) == getY(newStack) && getZ(oldStack) == getZ(newStack) && getDimensionId(oldStack) == getDimensionId(newStack)) {
return false;
}
}
}
return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged);
return false;
}
public boolean isValid(ItemStack stack) {