From 1111254e46e9cd48f5455d4ec01899d4b15890b7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 16 Mar 2013 09:13:21 +0000 Subject: Fix potion effect errors --- Essentials/src/com/earth2me/essentials/MetaItemStack.java | 11 ++++------- Essentials/src/com/earth2me/essentials/Potions.java | 1 + Essentials/src/messages.properties | 3 ++- Essentials/src/messages_cs.properties | 3 ++- Essentials/src/messages_da.properties | 3 ++- Essentials/src/messages_de.properties | 3 ++- Essentials/src/messages_en.properties | 3 ++- Essentials/src/messages_es.properties | 3 ++- Essentials/src/messages_fi.properties | 3 ++- Essentials/src/messages_fr.properties | 3 ++- Essentials/src/messages_it.properties | 3 ++- Essentials/src/messages_nl.properties | 3 ++- Essentials/src/messages_pl.properties | 3 ++- Essentials/src/messages_pt.properties | 3 ++- Essentials/src/messages_se.properties | 3 ++- 15 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index 11e19aaca..8d930e1ef 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -349,21 +349,18 @@ public class MetaItemStack pEffectType = Potions.getByName(split[1]); if (pEffectType != null && pEffectType.getName() != null) { - if (hasMetaPermission(sender, "potions." + pEffectType.getName().toLowerCase(Locale.ENGLISH), false, false, ess)) + if (hasMetaPermission(sender, "potions." + pEffectType.getName().toLowerCase(Locale.ENGLISH), true, false, ess)) { validPotionEffect = true; - canceledEffect = false; } else { - canceledEffect = true; - sender.sendMessage(_("invalidPotionEffect", pEffectType.getName().toLowerCase(Locale.ENGLISH))); + throw new Exception(_("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH))); } } else { - sender.sendMessage(_("invalidPotionEffect", split[1])); - canceledEffect = true; + throw new Exception(_("invalidPotionEffect", split[1])); } } else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equalsIgnoreCase("p"))) @@ -383,7 +380,7 @@ public class MetaItemStack } } - if (isValidPotion() && !canceledEffect) + if (isValidPotion()) { PotionMeta pmeta = (PotionMeta)stack.getItemMeta(); pEffect = pEffectType.createEffect(duration, power); diff --git a/Essentials/src/com/earth2me/essentials/Potions.java b/Essentials/src/com/earth2me/essentials/Potions.java index 7d3858183..cba132bda 100644 --- a/Essentials/src/com/earth2me/essentials/Potions.java +++ b/Essentials/src/com/earth2me/essentials/Potions.java @@ -47,6 +47,7 @@ public class Potions ALIASPOTIONS.put("instaheal", PotionEffectType.HEAL); POTIONS.put("harm", PotionEffectType.HARM); + ALIASPOTIONS.put("harming", PotionEffectType.HARM); ALIASPOTIONS.put("injure", PotionEffectType.HARM); ALIASPOTIONS.put("damage", PotionEffectType.HARM); ALIASPOTIONS.put("inflict", PotionEffectType.HARM); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 7d615d8bf..6dc005631 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name! invalidMob=Invalid mob type. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Invalid server! invalidSignLine=\u00a74Line\u00a7c {0} \u00a74on sign is invalid. invalidWarpName=\u00a74Invalid warp name! @@ -520,3 +519,5 @@ youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail rea playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 482d76444..d28dc4fca 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -181,7 +181,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Nespravny typ moba. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Nespravny server! invalidSignLine=Radek {0} je chybne vyplnen. invalidWarpName=\u00a74Invalid warp name @@ -523,3 +522,5 @@ youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby j playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index f0475f036..cb7a62c0a 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Ugyldig mob type. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Ugyldig server! invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index ba595c671..29dbb84a2 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Ung\u00fcltiger Monstername. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Ung\u00fcltiger Server! invalidSignLine=Die Zeile {0} auf dem Schild ist falsch. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 7d615d8bf..6dc005631 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name! invalidMob=Invalid mob type. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Invalid server! invalidSignLine=\u00a74Line\u00a7c {0} \u00a74on sign is invalid. invalidWarpName=\u00a74Invalid warp name! @@ -520,3 +519,5 @@ youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail rea playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 2e417c79c..1f9dddab6 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Nombre de casa invalido invalidMob=Mob invalido. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Servidor invalido! invalidSignLine=Linea {0} en el signo es invalida. invalidWarpName=\u00a74Nombre de warp invalido @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f p playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index 5f5a3b48d..e10ddc8b9 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Kelvoton mobin tyyppi. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Kelvoton palvelin! invalidSignLine=Kyltin rivi {0} on viallinen. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cSinulla on {0} viesti(\u00e4)!\u00a7f Kirjoita \u00a77/mai playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 4e39d6e9e..7d8a3998b 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Nom de r\u00e9sindence invalide invalidMob=Mauvais type de cr\u00e9ature. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Serveur non valide. invalidSignLine=La ligne {0} du panneau est invalide. invalidWarpName=\u00a74Nom de warp invalide @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index b5c2bbd50..d4eaafecf 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Tipo mob non valido. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Server non valido! invalidSignLine=Riga {0} non corretta. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f p playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 52d56b928..1fa324c70 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Ongeldig mob type. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Ongeldige server! invalidSignLine=Regel {0} op het bordje is ongeldig. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7 playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index c12294df4..f05c8cd7a 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Niepoprawna nazwa domu. invalidMob=Niepoprawny typ moba. invalidNumber=Niepoprawny Numer invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Niepoprawny serwer! invalidSignLine=\u00a74Linia\u00a7c {0} \u00a74na znaku jest bledna. invalidWarpName=\u00a74Niepoprawna nazwa warpa. @@ -520,3 +519,5 @@ youHaveNewMail=\u00a77Masz\u00a7c {0} \u00a77wiadomosci! Wpisz \u00a7c/mail read playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a77Gracz\u00a7c {0} \u00a77zostal zbanowany na adres IP {1}\u00a77. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index ddd2d3678..0996288f6 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Invalid home name invalidMob=Tipo de mob inv\u00e1lido. invalidNumber=Invalid Number invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Servidor inv\u00e1lido! invalidSignLine=Linha {0} da placa e inv\u00e1lida. invalidWarpName=\u00a74Invalid warp name @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail re playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index 8d535037f..c9e6e29bb 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -178,7 +178,6 @@ invalidHomeName=\u00a74Ogiltigt hemnamn invalidMob=Ogiltig monstertyp. invalidNumber=Felaktigt nummer invalidPotion=\u00a74Invalid Potion -invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion invalidServer=Ogiltig server! invalidSignLine=Rad {0} p\u00e5 skylten \u00e4r ogiltig. invalidWarpName=\u00a74Ogiltigt warpnamn @@ -520,3 +519,5 @@ youHaveNewMail=\u00a7cDu har {0} meddelanden!\u00a7f Skriv \u00a77/mail read\u00 playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}. playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. +noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion +invalidPotionEffect=\u00a74Invalid potion effect \u00a7c{0} -- cgit v1.2.3