Skip to content

Commit

Permalink
Offhand/helmet should clone the item properly
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Apr 4, 2016
1 parent 99a1795 commit fe0e8ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/net/citizensnpcs/editor/EquipmentEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public void run() {
if (old != null && old.getType() != Material.AIR) {
event.getPlayer().getWorld().dropItemNaturally(event.getPlayer().getLocation(), old);
}
npc.getTrait(Equipment.class).set(finalSlot,
new ItemStack(event.getPlayer().getInventory().getItemInMainHand().getType(), 1));
ItemStack newStack = hand.clone();
newStack.setAmount(1);
npc.getTrait(Equipment.class).set(finalSlot, newStack);
hand.setAmount(hand.getAmount() - 1);
event.getPlayer().getInventory().setItemInMainHand(hand);
}
Expand Down

0 comments on commit fe0e8ed

Please sign in to comment.