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:
parent
86112380da
commit
8f9de1d2d5
@ -62,6 +62,7 @@ public class Conf {
|
|||||||
public static boolean homesEnabled = true;
|
public static boolean homesEnabled = true;
|
||||||
public static boolean homesMustBeInClaimedTerritory = true;
|
public static boolean homesMustBeInClaimedTerritory = true;
|
||||||
public static boolean homesTeleportToOnDeath = true;
|
public static boolean homesTeleportToOnDeath = true;
|
||||||
|
public static boolean homesRespawnFromNoPowerLossWorlds = true;
|
||||||
public static boolean homesTeleportCommandEnabled = true;
|
public static boolean homesTeleportCommandEnabled = true;
|
||||||
public static boolean homesTeleportAllowedFromEnemyTerritory = true;
|
public static boolean homesTeleportAllowedFromEnemyTerritory = true;
|
||||||
public static double homesTeleportAllowedEnemyDistance = 32;
|
public static double homesTeleportAllowedEnemyDistance = 32;
|
||||||
|
@ -334,7 +334,9 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||||
FPlayer me = FPlayer.get(event.getPlayer());
|
FPlayer me = FPlayer.get(event.getPlayer());
|
||||||
Location home = me.getFaction().getHome();
|
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);
|
event.setRespawnLocation(home);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user