New conf.json option "homesTeleportIgnoreEnemiesIfInOwnTerritory" (default true). If disabled, players will no longer be able to teleport to their faction home while close to an enemy even if they are in their own territory
This commit is contained in:
parent
66bc427454
commit
5b73ebc456
@ -68,6 +68,7 @@ public class Conf {
|
||||
public static boolean homesTeleportAllowedFromEnemyTerritory = true;
|
||||
public static boolean homesTeleportAllowedFromDifferentWorld = true;
|
||||
public static double homesTeleportAllowedEnemyDistance = 32;
|
||||
public static boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
|
||||
|
||||
public static boolean disablePVPForFactionlessPlayers = false;
|
||||
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3;
|
||||
|
@ -57,7 +57,11 @@ public class FCommandHome extends FBaseCommand {
|
||||
Faction faction = Board.getFactionAt(new FLocation(player.getLocation()));
|
||||
|
||||
// if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby
|
||||
if (Conf.homesTeleportAllowedEnemyDistance > 0 && ! faction.isSafeZone() && ! me.isInOwnTerritory()) {
|
||||
if (
|
||||
Conf.homesTeleportAllowedEnemyDistance > 0
|
||||
&& !faction.isSafeZone()
|
||||
&& (!me.isInOwnTerritory() || (me.isInOwnTerritory() && !Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory))
|
||||
) {
|
||||
Location loc = player.getLocation();
|
||||
World w = loc.getWorld();
|
||||
double x = loc.getX();
|
||||
|
Loading…
Reference in New Issue
Block a user