[1.11] Fix null checks in shouldCauseReequipAnimation (#3482)

This commit is contained in:
Ben Staddon 2016-12-03 18:47:57 +00:00 committed by LexManos
parent a913a8a0f9
commit 6921ee54f5

View file

@ -669,12 +669,15 @@ public class ForgeHooksClient
}
private static int slotMainHand = 0;
// FIXME
public static boolean shouldCauseReequipAnimation(ItemStack from, ItemStack to, int slot)
public static boolean shouldCauseReequipAnimation(@Nonnull ItemStack from, @Nonnull ItemStack to, int slot)
{
if (from == null && to != null) return true;
if (from == null && to == null) return false;
if (from != null && to == null) return true;
boolean fromInvalid = from.func_190926_b();
boolean toInvalid = to.func_190926_b();
if (fromInvalid && toInvalid) return false;
if (fromInvalid || toInvalid) return true;
boolean changed = false;
if (slot != -1)
{