From 249846d6aecdd9d7663c0a42a36d9289e93fa3d1 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Mon, 12 Sep 2011 22:46:20 -0500 Subject: [PATCH] New conf.json setting "newPlayerStartingFactionID" which can be used to have new players start out in a specific faction --- src/com/massivecraft/factions/Conf.java | 3 +++ src/com/massivecraft/factions/FPlayer.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index ede5d5f9..dffe45cf 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -39,6 +39,9 @@ public class Conf { public static boolean newFactionsDefaultOpen = true; + // what faction ID to start new players in when they first join the server; default is 0, "no faction" + public static int newPlayerStartingFactionID = 0; + public static boolean showMapFactionKey = true; public static boolean showNeutralFactionsOnMap = true; public static boolean showEnemyFactionsOnMap = true; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 8e1ac0b3..8ac986f7 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -67,6 +67,10 @@ public class FPlayer { this.autoSafeZoneEnabled = false; this.autoWarZoneEnabled = false; this.loginPvpDisabled = (Conf.noPVPDamageToOthersForXSecondsAfterLogin > 0) ? true : false; + + if (Conf.newPlayerStartingFactionID > 0 && Faction.exists(Conf.newPlayerStartingFactionID)) { + this.factionId = Conf.newPlayerStartingFactionID; + } } public void resetFactionData() {