From 2220cc1819ebca198d35590c63279cd1f035e74d Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 30 Jan 2016 12:17:52 -0800 Subject: [PATCH] Fix Living Armor check NPE. Again. (#584) I reversed some logic. don't code when tired, kids. --- changelog.txt | 1 + .../java/WayofTime/bloodmagic/livingArmour/LivingArmour.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 53b3ad19..2547126d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Version 2.0.0-12 - Tweaked the Incense altar and added its recipe. - Fixed Blood Light sigil not providing the right coloured particles - Added the ability for the divination sigil to look up information about the incense altar. +- Fix another NPE when checking of a player has a full set of Living Armor ------------------------------------------------------ Version 2.0.0-11 diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java index c8ca8965..e993c9f9 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java @@ -244,7 +244,7 @@ public class LivingArmour implements ILivingArmour public static boolean hasFullSet(EntityPlayer player) { for (int slot = 0; slot < player.inventory.armorInventory.length; slot++) { ItemStack slotStack = player.inventory.armorItemInSlot(slot); - if (slotStack != null && !(slotStack.getItem() instanceof ItemLivingArmour)) + if (slotStack == null || !(slotStack.getItem() instanceof ItemLivingArmour)) return false; }