Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 2, 2013
1 parent 87050c3 commit eea753c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/net/citizensnpcs/api/trait/trait/Equipment.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void onSpawn() {
if (equipment[0] != null)
enderman.setCarriedMaterial(equipment[0].getData());
} else {
LivingEntity entity = (LivingEntity) npc.getBukkitEntity();
LivingEntity entity = npc.getBukkitEntity();
EntityEquipment equip = getEquipmentFromEntity(entity);
if (equipment[0] != null)
equip.setItemInHand(equipment[0]);
Expand Down Expand Up @@ -126,7 +126,7 @@ public void set(int slot, ItemStack item) {
throw new UnsupportedOperationException("Slot can only be 0 for enderman");
((Enderman) npc.getBukkitEntity()).setCarriedMaterial(item.getData());
} else {
EntityEquipment equip = getEquipmentFromEntity((LivingEntity) npc.getBukkitEntity());
EntityEquipment equip = getEquipmentFromEntity(npc.getBukkitEntity());
switch (slot) {
case 0:
equip.setItemInHand(item);
Expand All @@ -146,8 +146,9 @@ public void set(int slot, ItemStack item) {
default:
throw new IllegalArgumentException("Slot must be between 0 and 4");
}
if (npc.getBukkitEntity() instanceof Player)
if (npc.getBukkitEntity() instanceof Player) {
((Player) npc.getBukkitEntity()).updateInventory();
}
}
equipment[slot] = item;
}
Expand Down

0 comments on commit eea753c

Please sign in to comment.