Updated EssentialsSpawn to use the new config code

/spawn and /home now call the PlayerRespawnEvent to make it more compatible with other plugins.
This commit is contained in:
snowleo 2011-12-06 13:41:29 +01:00
parent f3b278eac2
commit 019b49ef11
21 changed files with 406 additions and 79 deletions

View file

@ -43,7 +43,8 @@ public class Commandhome extends EssentialsCommand
}
try
{
if ("bed".equalsIgnoreCase(homeName)) {
if ("bed".equalsIgnoreCase(homeName))
{
final Location bed = player.getBedSpawnLocation();
if (bed != null)
{
@ -58,18 +59,7 @@ public class Commandhome extends EssentialsCommand
final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user))
{
final Location loc = player.getBedSpawnLocation();
if (loc == null)
{
if (ess.getSettings().spawnIfNoHome())
{
user.getTeleport().respawn(ess.getSpawn(), charge);
}
}
else
{
user.getTeleport().teleport(loc, charge);
}
user.getTeleport().respawn(charge);
}
else if (homes.isEmpty())
{