mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-15 00:58:00 +02:00
Offhand/helmet should clone the item properly
This commit is contained in:
parent
2863d4b64c
commit
ae43427e51
@ -70,8 +70,9 @@ public class EquipmentEditor extends Editor {
|
|||||||
if (old != null && old.getType() != Material.AIR) {
|
if (old != null && old.getType() != Material.AIR) {
|
||||||
event.getPlayer().getWorld().dropItemNaturally(event.getPlayer().getLocation(), old);
|
event.getPlayer().getWorld().dropItemNaturally(event.getPlayer().getLocation(), old);
|
||||||
}
|
}
|
||||||
npc.getTrait(Equipment.class).set(finalSlot,
|
ItemStack newStack = hand.clone();
|
||||||
new ItemStack(event.getPlayer().getInventory().getItemInMainHand().getType(), 1));
|
newStack.setAmount(1);
|
||||||
|
npc.getTrait(Equipment.class).set(finalSlot, newStack);
|
||||||
hand.setAmount(hand.getAmount() - 1);
|
hand.setAmount(hand.getAmount() - 1);
|
||||||
event.getPlayer().getInventory().setItemInMainHand(hand);
|
event.getPlayer().getInventory().setItemInMainHand(hand);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user