mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
[1.11] Fix null checks in shouldCauseReequipAnimation (#3482)
This commit is contained in:
1 parent
a913a8a0f9
commit
6921ee54f5
1 file changed
+8
-5
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user