Skip to content

Commit

Permalink
Fix bug with equipment offhand applying
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 25, 2016
1 parent 2cf2f88 commit 076a0da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
@TraitName("equipment")
public class Equipment extends Trait {
private final ItemStack[] equipment = new ItemStack[7];
private final ItemStack[] equipment = new ItemStack[6];

public Equipment() {
super("equipment");
Expand Down Expand Up @@ -130,8 +130,6 @@ public void onSpawn() {
equip.setItemInOffHand(equipment[5]);
}
if (npc.getEntity() instanceof Player) {
((Player) npc.getEntity()).getInventory()
.setExtraContents(new ItemStack[] { equipment[EquipmentSlot.EXTRA.getIndex()] });
((Player) npc.getEntity()).updateInventory();
}
}
Expand Down Expand Up @@ -388,7 +386,6 @@ public void setLeggingsDropChance(float arg0) {
public enum EquipmentSlot {
BOOTS(4),
CHESTPLATE(2),
EXTRA(6),
HAND(0),
HELMET(1),
LEGGINGS(3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public void onSpawn() {

private ItemStack[] parseContents(DataKey key) throws NPCLoadException {
ItemStack[] contents = new ItemStack[72];
for (DataKey slotKey : key.getIntegerSubKeys())
for (DataKey slotKey : key.getIntegerSubKeys()) {
contents[Integer.parseInt(slotKey.name())] = ItemStorage.loadItemStack(slotKey);
}
return contents;
}

Expand Down

0 comments on commit 076a0da

Please sign in to comment.