summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <md_5@bigpond.com>2012-05-27 17:36:04 +1000
committermd_5 <md_5@bigpond.com>2012-05-27 17:36:04 +1000
commit851c564e6775bbfdcfed127a7dde60ed14e5d679 (patch)
tree7f33ad843fb69666ef8e7bba6e804f64d250e8fa
parentf94ec6622f212a6b5975c590e69fbeba81c349e2 (diff)
downloadEssentials-851c564e6775bbfdcfed127a7dde60ed14e5d679.tar
Essentials-851c564e6775bbfdcfed127a7dde60ed14e5d679.tar.gz
Essentials-851c564e6775bbfdcfed127a7dde60ed14e5d679.tar.lz
Essentials-851c564e6775bbfdcfed127a7dde60ed14e5d679.tar.xz
Essentials-851c564e6775bbfdcfed127a7dde60ed14e5d679.zip
Don't allow armor to be used as a hat.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhat.java17
-rw-r--r--Essentials/src/messages.properties1
-rw-r--r--Essentials/src/messages_cs.properties1
-rw-r--r--Essentials/src/messages_da.properties1
-rw-r--r--Essentials/src/messages_de.properties1
-rw-r--r--Essentials/src/messages_en.properties1
-rw-r--r--Essentials/src/messages_es.properties1
-rw-r--r--Essentials/src/messages_fr.properties1
-rw-r--r--Essentials/src/messages_it.properties1
-rw-r--r--Essentials/src/messages_nl.properties1
-rw-r--r--Essentials/src/messages_pl.properties1
-rw-r--r--Essentials/src/messages_pt.properties1
12 files changed, 22 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
index 24d464275..ed82fd16d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
@@ -21,12 +21,17 @@ public class Commandhat extends EssentialsCommand
if (user.getItemInHand().getType() != Material.AIR)
{
final ItemStack hand = user.getItemInHand();
- final PlayerInventory inv = user.getInventory();
- final ItemStack head = inv.getHelmet();
- inv.removeItem(hand);
- inv.setHelmet(hand);
- inv.setItemInHand(head);
- user.sendMessage(_("hatPlaced"));
+ 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
{
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 84f4734e6..ea765213f 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -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!
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index dc64cb5e1..0265dab23 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -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!
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 076e5a956..380f04ced 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -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!
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 6aa916542..5558ab978 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -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!
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 84f4734e6..ea765213f 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -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!
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index aa735be29..56016f96e 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -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!
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 9be26fa00..a101355ba 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -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!
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index 0bf67362e..19659a76a 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -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!
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 7a6827d2f..17aa50829 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -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!
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index b7740ac12..1ca936863 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -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!
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 9e91d1aa3..2a6260f1c 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -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!