New conf.json option "homesRespawnFromNoPowerLossWorlds" (defaults to true) to go with Oli's recent commit, so server owners have an option whether or not players should respawn to faction homes when they die in "worldsNoPowerLoss" worlds

This commit is contained in:
Brettflan 2011-06-30 05:15:16 -05:00
parent 86112380da
commit 8f9de1d2d5
2 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,7 @@ public class Conf {
public static boolean homesEnabled = true;
public static boolean homesMustBeInClaimedTerritory = true;
public static boolean homesTeleportToOnDeath = true;
public static boolean homesRespawnFromNoPowerLossWorlds = true;
public static boolean homesTeleportCommandEnabled = true;
public static boolean homesTeleportAllowedFromEnemyTerritory = true;
public static double homesTeleportAllowedEnemyDistance = 32;

View File

@ -334,7 +334,9 @@ public class FactionsPlayerListener extends PlayerListener{
public void onPlayerRespawn(PlayerRespawnEvent event) {
FPlayer me = FPlayer.get(event.getPlayer());
Location home = me.getFaction().getHome();
if (Conf.homesEnabled && Conf.homesTeleportToOnDeath && home != null && !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName())) {
if ( Conf.homesEnabled && Conf.homesTeleportToOnDeath && home != null &&
(Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))
) {
event.setRespawnLocation(home);
}
}