From 8f9de1d2d5438b29f1750e07c1a5e93bf7094bca Mon Sep 17 00:00:00 2001 From: Brettflan Date: Thu, 30 Jun 2011 05:15:16 -0500 Subject: [PATCH] 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 --- src/org/mcteam/factions/Conf.java | 1 + src/org/mcteam/factions/listeners/FactionsPlayerListener.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/mcteam/factions/Conf.java b/src/org/mcteam/factions/Conf.java index 64d86743..0e23c9de 100644 --- a/src/org/mcteam/factions/Conf.java +++ b/src/org/mcteam/factions/Conf.java @@ -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; diff --git a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java index 23505b6d..89e90b43 100644 --- a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java @@ -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); } }