mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-04-16 17:16:08 +02:00
Null checks
This commit is contained in:
parent
f895169e92
commit
07d2c970d0
@ -419,11 +419,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!(cache == null && equipment == null)
|
||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||
itemChanged = true;
|
||||
if (!cache.isEmpty()) {
|
||||
if (cache != null && !cache.isEmpty()) {
|
||||
this.getAttributeMap().a(cache.a(slot));
|
||||
}
|
||||
|
||||
if (!equipment.isEmpty()) {
|
||||
if (equipment != null && !equipment.isEmpty()) {
|
||||
this.getAttributeMap().b(equipment.a(slot));
|
||||
}
|
||||
}
|
||||
|
@ -445,11 +445,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!(cache == null && equipment == null)
|
||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||
itemChanged = true;
|
||||
if (!cache.isEmpty()) {
|
||||
if (cache != null && !cache.isEmpty()) {
|
||||
this.getAttributeMap().a(cache.a(slot));
|
||||
}
|
||||
|
||||
if (!equipment.isEmpty()) {
|
||||
if (equipment != null && !equipment.isEmpty()) {
|
||||
this.getAttributeMap().b(equipment.a(slot));
|
||||
}
|
||||
}
|
||||
|
@ -436,11 +436,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!(cache == null && equipment == null)
|
||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||
itemChanged = true;
|
||||
if (!cache.isEmpty()) {
|
||||
if (cache != null && !cache.isEmpty()) {
|
||||
this.getAttributeMap().a(cache.a(slot));
|
||||
}
|
||||
|
||||
if (!equipment.isEmpty()) {
|
||||
if (equipment != null && !equipment.isEmpty()) {
|
||||
this.getAttributeMap().b(equipment.a(slot));
|
||||
}
|
||||
}
|
||||
|
@ -441,11 +441,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!(cache == null && equipment == null)
|
||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||
itemChanged = true;
|
||||
if (!cache.isEmpty()) {
|
||||
if (cache != null && !cache.isEmpty()) {
|
||||
this.getAttributeMap().a(cache.a(slot));
|
||||
}
|
||||
|
||||
if (!equipment.isEmpty()) {
|
||||
if (equipment != null && !equipment.isEmpty()) {
|
||||
this.getAttributeMap().b(equipment.a(slot));
|
||||
}
|
||||
}
|
||||
|
@ -439,11 +439,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
ItemStack cache = equipmentCache.get(slot);
|
||||
if (!(cache == null && equipment == null)
|
||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||
if (!cache.isEmpty()) {
|
||||
if (cache != null && !cache.isEmpty()) {
|
||||
this.getAttributeMap().a(cache.a(slot));
|
||||
}
|
||||
|
||||
if (!equipment.isEmpty()) {
|
||||
if (equipment != null && !equipment.isEmpty()) {
|
||||
this.getAttributeMap().b(equipment.a(slot));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user