1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-22 22:34:43 +02:00

why do we even remove the items?

derp
This commit is contained in:
snowleo
2013-02-17 15:34:49 +01:00
parent af10a2050a
commit 69e941670f

View File

@@ -39,12 +39,11 @@ public class Commandhat extends EssentialsCommand
{ {
if (user.getItemInHand().getType() != Material.AIR) if (user.getItemInHand().getType() != Material.AIR)
{ {
final ItemStack hand = user.getItemInHand().clone(); final ItemStack hand = user.getItemInHand();
if (hand.getType().getMaxDurability() == 0) if (hand.getType().getMaxDurability() == 0)
{ {
final PlayerInventory inv = user.getInventory(); final PlayerInventory inv = user.getInventory();
final ItemStack head = inv.getHelmet(); final ItemStack head = inv.getHelmet();
inv.removeItem(hand);
inv.setHelmet(hand); inv.setHelmet(hand);
inv.setItemInHand(head); inv.setItemInHand(head);
user.sendMessage(_("hatPlaced")); user.sendMessage(_("hatPlaced"));