mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Don't allow armor to be used as a hat.
This commit is contained in:
parent
0559b935e9
commit
45c1e347b0
@ -21,12 +21,17 @@ public class Commandhat extends EssentialsCommand
|
||||
if (user.getItemInHand().getType() != Material.AIR)
|
||||
{
|
||||
final ItemStack hand = user.getItemInHand();
|
||||
if (hand.getType().getMaxDurability() == 0)
|
||||
{
|
||||
final PlayerInventory inv = user.getInventory();
|
||||
final ItemStack head = inv.getHelmet();
|
||||
inv.removeItem(hand);
|
||||
inv.setHelmet(hand);
|
||||
inv.setItemInHand(head);
|
||||
user.sendMessage(_("hatPlaced"));
|
||||
} else {
|
||||
user.sendMessage(_("hatArmor"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -431,3 +431,4 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -434,3 +434,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished.
|
||||
tps=Current TPS = {0}
|
||||
hatPlaced=\u00a7eEnjoy your new hat!
|
||||
hatFail=\u00a7cYou must have something to wear in your hand.
|
||||
hatArmor=\u00a7cError, you cannot use armor as a hat!
|
||||
|
Loading…
Reference in New Issue
Block a user