Added the ability for players to "spawn" at their home location, when enabled it moves a player after they have died and revived to their home location.

This commit is contained in:
nossr50
2010-12-23 17:16:38 -08:00
parent 30d6b1ac51
commit 6a122fb0aa
2 changed files with 12 additions and 1 deletions

View File

@ -86,8 +86,14 @@ public class vMinecraftListener extends PluginListener {
//Use: Checks for exploits and runs the commands
//=====================================================================
public boolean onHealthChange(Player player,int oldValue,int newValue){
if (player.getHealth() > 1){
if (player.getHealth() > 1 && vMinecraftUsers.getProfile(player).isDead()){
vMinecraftUsers.getProfile(player).isDead(false);
if(vMinecraftSettings.getInstance().playerspawn())
{
Warp home = null;
home = etc.getDataSource().getHome(player.getName());
player.teleportTo(home.Location);
}
}
return false;
}