make sure player isnt dead before healing

This commit is contained in:
Necrodoom 2013-02-18 16:19:15 +02:00 committed by KHobbits
parent 3ddbeea45a
commit e63276242c
15 changed files with 19 additions and 1 deletions

View File

@ -40,7 +40,7 @@ public class Commandgod extends EssentialsCommand
private void godPlayer(User player, boolean enabled) private void godPlayer(User player, boolean enabled)
{ {
player.setGodModeEnabled(enabled); player.setGodModeEnabled(enabled);
if (enabled) if (enabled && player.getHealth() != 0)
{ {
player.setHealth(player.getMaxHealth()); player.setHealth(player.getMaxHealth());
player.setFoodLevel(20); player.setFoodLevel(20);

View File

@ -69,6 +69,10 @@ public class Commandheal extends EssentialsCommand
private void healPlayer(final Player player) private void healPlayer(final Player player)
{ {
if (player.getHealth() == 0)
{
throw new Exception(_("healDead"));
}
player.setHealth(player.getMaxHealth()); player.setHealth(player.getMaxHealth());
player.setFoodLevel(20); player.setFoodLevel(20);
player.setFireTicks(0); player.setFireTicks(0);

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a76Enjoy your new hat!
hatRemoved=\u00a76Your hat has been removed. hatRemoved=\u00a76Your hat has been removed.
haveBeenReleased=\u00a76You have been released. haveBeenReleased=\u00a76You have been released.
heal=\u00a76You have been healed. heal=\u00a76You have been healed.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a76Healed\u00a7c {0}\u00a76. healOther=\u00a76Healed\u00a7c {0}\u00a76.
helpConsole=To view help from the console, type ?. helpConsole=To view help from the console, type ?.
helpFrom=\u00a76Commands from {0}: helpFrom=\u00a76Commands from {0}:

View File

@ -124,6 +124,7 @@ hatPlaced=\u00a7eEnjoy your new hat!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Byl jsi uvolnen haveBeenReleased=\u00a77Byl jsi uvolnen
heal=\u00a77Byl jsi uzdraven. heal=\u00a77Byl jsi uzdraven.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Uzdravil jsi hrace {0}. healOther=\u00a77Uzdravil jsi hrace {0}.
helpConsole=Pokud chces videt napovedu z konzole, napis ?. helpConsole=Pokud chces videt napovedu z konzole, napis ?.
helpFrom=\u00a77Prikazy od{0}: helpFrom=\u00a77Prikazy od{0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eEnjoy your new hat!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Du er blevet l\u00f8sladt haveBeenReleased=\u00a77Du er blevet l\u00f8sladt
heal=\u00a77Du er blevet healed. heal=\u00a77Du er blevet healed.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Healed {0}. healOther=\u00a77Healed {0}.
helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?.
helpFrom=\u00a77Commands from {0}: helpFrom=\u00a77Commands from {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eEnjoy your new hat!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Du wurdest frei gelassen. haveBeenReleased=\u00a77Du wurdest frei gelassen.
heal=\u00a77Du wurdest geheilt. heal=\u00a77Du wurdest geheilt.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77{0} geheilt. healOther=\u00a77{0} geheilt.
helpConsole=Um die Hilfe der Konsole zu sehen, schreibe ?. helpConsole=Um die Hilfe der Konsole zu sehen, schreibe ?.
helpFrom=\u00a77Commands from {0}: helpFrom=\u00a77Commands from {0}:

View File

@ -121,7 +121,9 @@ hatPlaced=\u00a76Enjoy your new hat!
hatRemoved=\u00a76Your hat has been removed. hatRemoved=\u00a76Your hat has been removed.
haveBeenReleased=\u00a76You have been released. haveBeenReleased=\u00a76You have been released.
heal=\u00a76You have been healed. heal=\u00a76You have been healed.
healDead=\u00a7cYou cannot heal someone who is dead!
healOther=\u00a76Healed\u00a7c {0}\u00a76. healOther=\u00a76Healed\u00a7c {0}\u00a76.
healDead=\u00a74You cannot heal someone who is dead!
helpConsole=To view help from the console, type ?. helpConsole=To view help from the console, type ?.
helpFrom=\u00a76Commands from {0}: helpFrom=\u00a76Commands from {0}:
helpLine=\u00a76/{0}\u00a7r: {1} helpLine=\u00a76/{0}\u00a7r: {1}

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eDisfruta tu nuevo sombrero!
hatRemoved=\u00a7eTu sombrero a sido removido. hatRemoved=\u00a7eTu sombrero a sido removido.
haveBeenReleased=\u00a77Has sido liberado. haveBeenReleased=\u00a77Has sido liberado.
heal=\u00a77Has sido curado. heal=\u00a77Has sido curado.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Has curado a {0}. healOther=\u00a77Has curado a {0}.
helpConsole=Para obtener ayuda de la consola, escribe ?. helpConsole=Para obtener ayuda de la consola, escribe ?.
helpFrom=\u00a77Comandos de {0}: helpFrom=\u00a77Comandos de {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eNauti uudesta hatustasi!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Sinut on vapautettu haveBeenReleased=\u00a77Sinut on vapautettu
heal=\u00a77Sinut on parannettu. heal=\u00a77Sinut on parannettu.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Paransit pelaajan {0}. healOther=\u00a77Paransit pelaajan {0}.
helpConsole=Katsoaksesi apua konsolista, kirjoita ?. helpConsole=Katsoaksesi apua konsolista, kirjoita ?.
helpFrom=\u00a77Komennot {0}: helpFrom=\u00a77Komennot {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eProfitez bien de votre nouveau chapeau !
hatRemoved=\u00a7eVotre chapeau a \u00e9t\u00e9 retir\u00e9. hatRemoved=\u00a7eVotre chapeau a \u00e9t\u00e9 retir\u00e9.
haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9. haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9.
heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9. healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9.
helpConsole=Pour voir l''aide tapez ? helpConsole=Pour voir l''aide tapez ?
helpFrom=\u00a77Commands from {0}: helpFrom=\u00a77Commands from {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eEnjoy your new hat!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Sei stato scarcerato. haveBeenReleased=\u00a77Sei stato scarcerato.
heal=\u00a77Sei stato curato. heal=\u00a77Sei stato curato.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77{0} e'' stato curato. healOther=\u00a77{0} e'' stato curato.
helpConsole=Digitare ? per la guida. helpConsole=Digitare ? per la guida.
helpFrom=\u00a77Comandi da {0}: helpFrom=\u00a77Comandi da {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eGeniet van je nieuwe hoed!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Je bent bevrijdt haveBeenReleased=\u00a77Je bent bevrijdt
heal=\u00a77Je bent genezen. heal=\u00a77Je bent genezen.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Je geneezde {0}. healOther=\u00a77Je geneezde {0}.
helpConsole=type ? om de consolehelp weer te geven. helpConsole=type ? om de consolehelp weer te geven.
helpFrom=\u00a77Commands from {0}: helpFrom=\u00a77Commands from {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eCiesz sie nowym kapeluszem!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Zostales wypuszczony. haveBeenReleased=\u00a77Zostales wypuszczony.
heal=\u00a77Uleczony heal=\u00a77Uleczony
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Uleczono {0}. healOther=\u00a77Uleczono {0}.
helpConsole=Aby uzyskac pomoc z konsoli, wpisz \u0093????. helpConsole=Aby uzyskac pomoc z konsoli, wpisz \u0093????.
helpFrom=\u00a77Komendy od {0}: helpFrom=\u00a77Komendy od {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eAproveite o seu novo chapeu!
hatRemoved=\u00a7eYour hat has been removed. hatRemoved=\u00a7eYour hat has been removed.
haveBeenReleased=\u00a77Voc\u00ea foi liberado. haveBeenReleased=\u00a77Voc\u00ea foi liberado.
heal=\u00a77Voc\u00ea foi curado. heal=\u00a77Voc\u00ea foi curado.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77Curado {0}. healOther=\u00a77Curado {0}.
helpConsole=Para ver ajuda do console, digite ?. helpConsole=Para ver ajuda do console, digite ?.
helpFrom=\u00a77Comandos a partir de {0}: helpFrom=\u00a77Comandos a partir de {0}:

View File

@ -121,6 +121,7 @@ hatPlaced=\u00a7eNjut av din nya hatt!
hatRemoved=\u00a7eDin hatt har tagits bort. hatRemoved=\u00a7eDin hatt har tagits bort.
haveBeenReleased=\u00a77Du har blivit friad haveBeenReleased=\u00a77Du har blivit friad
heal=\u00a77Du har blivit l\u00e4kt. heal=\u00a77Du har blivit l\u00e4kt.
healDead=\u00a74You cannot heal someone who is dead!
healOther=\u00a77L\u00e4kte {0}. healOther=\u00a77L\u00e4kte {0}.
helpConsole=F\u00f6r att visa hj\u00e4lp fr\u00e5n konsolen, skriv ?. helpConsole=F\u00f6r att visa hj\u00e4lp fr\u00e5n konsolen, skriv ?.
helpFrom=\u00a77Kommandon fr\u00e5n {0}: helpFrom=\u00a77Kommandon fr\u00e5n {0}: