mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-29 23:57:42 +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)
|
if (!(cache == null && equipment == null)
|
||||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||||
itemChanged = true;
|
itemChanged = true;
|
||||||
if (!cache.isEmpty()) {
|
if (cache != null && !cache.isEmpty()) {
|
||||||
this.getAttributeMap().a(cache.a(slot));
|
this.getAttributeMap().a(cache.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!equipment.isEmpty()) {
|
if (equipment != null && !equipment.isEmpty()) {
|
||||||
this.getAttributeMap().b(equipment.a(slot));
|
this.getAttributeMap().b(equipment.a(slot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -445,11 +445,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
if (!(cache == null && equipment == null)
|
if (!(cache == null && equipment == null)
|
||||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||||
itemChanged = true;
|
itemChanged = true;
|
||||||
if (!cache.isEmpty()) {
|
if (cache != null && !cache.isEmpty()) {
|
||||||
this.getAttributeMap().a(cache.a(slot));
|
this.getAttributeMap().a(cache.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!equipment.isEmpty()) {
|
if (equipment != null && !equipment.isEmpty()) {
|
||||||
this.getAttributeMap().b(equipment.a(slot));
|
this.getAttributeMap().b(equipment.a(slot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,11 +436,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
if (!(cache == null && equipment == null)
|
if (!(cache == null && equipment == null)
|
||||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||||
itemChanged = true;
|
itemChanged = true;
|
||||||
if (!cache.isEmpty()) {
|
if (cache != null && !cache.isEmpty()) {
|
||||||
this.getAttributeMap().a(cache.a(slot));
|
this.getAttributeMap().a(cache.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!equipment.isEmpty()) {
|
if (equipment != null && !equipment.isEmpty()) {
|
||||||
this.getAttributeMap().b(equipment.a(slot));
|
this.getAttributeMap().b(equipment.a(slot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -441,11 +441,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
if (!(cache == null && equipment == null)
|
if (!(cache == null && equipment == null)
|
||||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||||
itemChanged = true;
|
itemChanged = true;
|
||||||
if (!cache.isEmpty()) {
|
if (cache != null && !cache.isEmpty()) {
|
||||||
this.getAttributeMap().a(cache.a(slot));
|
this.getAttributeMap().a(cache.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!equipment.isEmpty()) {
|
if (equipment != null && !equipment.isEmpty()) {
|
||||||
this.getAttributeMap().b(equipment.a(slot));
|
this.getAttributeMap().b(equipment.a(slot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -439,11 +439,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
ItemStack cache = equipmentCache.get(slot);
|
ItemStack cache = equipmentCache.get(slot);
|
||||||
if (!(cache == null && equipment == null)
|
if (!(cache == null && equipment == null)
|
||||||
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
|
||||||
if (!cache.isEmpty()) {
|
if (cache != null && !cache.isEmpty()) {
|
||||||
this.getAttributeMap().a(cache.a(slot));
|
this.getAttributeMap().a(cache.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!equipment.isEmpty()) {
|
if (equipment != null && !equipment.isEmpty()) {
|
||||||
this.getAttributeMap().b(equipment.a(slot));
|
this.getAttributeMap().b(equipment.a(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user