2013-04-22 16:26:44 +02:00
|
|
|
package com.massivecraft.factions.entity;
|
|
|
|
|
2013-04-23 09:17:30 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2013-04-22 16:58:22 +02:00
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
2013-04-24 13:50:02 +02:00
|
|
|
import java.util.UUID;
|
2013-04-22 16:58:22 +02:00
|
|
|
|
2013-04-25 13:25:15 +02:00
|
|
|
import org.bukkit.command.CommandSender;
|
2013-07-24 18:29:55 +02:00
|
|
|
import org.bukkit.event.EventPriority;
|
2013-04-25 13:25:15 +02:00
|
|
|
|
2013-04-22 16:58:22 +02:00
|
|
|
import com.massivecraft.factions.FFlag;
|
|
|
|
import com.massivecraft.factions.FPerm;
|
|
|
|
import com.massivecraft.factions.Rel;
|
2014-06-04 16:47:01 +02:00
|
|
|
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
|
2014-06-04 14:02:23 +02:00
|
|
|
import com.massivecraft.massivecore.store.Entity;
|
|
|
|
import com.massivecraft.massivecore.store.SenderEntity;
|
|
|
|
import com.massivecraft.massivecore.util.MUtil;
|
|
|
|
import com.massivecraft.massivecore.util.Txt;
|
2013-04-22 16:26:44 +02:00
|
|
|
|
|
|
|
public class UConf extends Entity<UConf>
|
|
|
|
{
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// META
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-22 16:58:22 +02:00
|
|
|
public static UConf get(Object oid)
|
2013-04-22 16:26:44 +02:00
|
|
|
{
|
2013-04-22 16:58:22 +02:00
|
|
|
return UConfColls.get().get2(oid);
|
2013-04-22 16:26:44 +02:00
|
|
|
}
|
|
|
|
|
2013-04-25 12:18:39 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// UNIVERSE ENABLE SWITCH
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean enabled = true;
|
|
|
|
|
2013-04-25 13:25:15 +02:00
|
|
|
public static boolean isDisabled(Object universe)
|
|
|
|
{
|
|
|
|
return isDisabled(universe, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getDisabledMessage(Object universe)
|
|
|
|
{
|
|
|
|
UConf uconf = UConf.get(universe);
|
|
|
|
return Txt.parse("<i>Factions are disabled in the <h>%s <i>universe.", uconf.getUniverse());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isDisabled(Object universe, Object inform)
|
|
|
|
{
|
|
|
|
UConf uconf = UConf.get(universe);
|
|
|
|
if (uconf.enabled) return false;
|
|
|
|
|
|
|
|
if (inform instanceof CommandSender)
|
|
|
|
{
|
|
|
|
((CommandSender)inform).sendMessage(getDisabledMessage(universe));
|
|
|
|
}
|
|
|
|
else if (inform instanceof SenderEntity)
|
|
|
|
{
|
|
|
|
((SenderEntity<?>)inform).sendMessage(getDisabledMessage(universe));
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-04-24 13:50:02 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// SPECIAL FACTION IDS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public String factionIdNone = UUID.randomUUID().toString();
|
|
|
|
public String factionIdSafezone = UUID.randomUUID().toString();
|
|
|
|
public String factionIdWarzone = UUID.randomUUID().toString();
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// DEFAULTS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-24 16:50:19 +02:00
|
|
|
public String defaultPlayerFactionId = this.factionIdNone;
|
2013-04-24 13:50:02 +02:00
|
|
|
public Rel defaultPlayerRole = Rel.RECRUIT;
|
2013-04-24 14:31:10 +02:00
|
|
|
public double defaultPlayerPower = 0.0;
|
2013-04-24 13:50:02 +02:00
|
|
|
|
|
|
|
public boolean defaultFactionOpen = false;
|
|
|
|
public Map<FFlag, Boolean> defaultFactionFlags = FFlag.getDefaultDefaults();
|
|
|
|
public Map<FPerm, Set<Rel>> defaultFactionPerms = FPerm.getDefaultDefaults();
|
2013-04-24 07:51:48 +02:00
|
|
|
|
2014-01-05 11:55:45 +01:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// MESSAGES
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean broadcastNameChange = false;
|
|
|
|
|
2013-04-23 17:01:43 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// POWER
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public double powerMax = 10.0;
|
|
|
|
public double powerMin = 0.0;
|
|
|
|
public double powerPerHour = 2.0;
|
|
|
|
public double powerPerDeath = -2.0;
|
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
public boolean canLeaveWithNegativePower = true;
|
|
|
|
|
2013-04-24 14:31:10 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// CORE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public int factionMemberLimit = 0;
|
2013-04-25 20:21:23 +02:00
|
|
|
public double factionPowerMax = 0.0;
|
2013-04-24 14:31:10 +02:00
|
|
|
|
2013-04-24 19:01:17 +02:00
|
|
|
public int factionNameLengthMin = 3;
|
|
|
|
public int factionNameLengthMax = 16;
|
|
|
|
public boolean factionNameForceUpperCase = false;
|
2013-04-24 14:31:10 +02:00
|
|
|
|
2013-04-24 08:39:26 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// CLAIMS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-25 20:21:23 +02:00
|
|
|
public boolean claimsMustBeConnected = true;
|
2013-04-24 08:39:26 +02:00
|
|
|
public boolean claimingFromOthersAllowed = true;
|
2013-05-29 14:31:09 +02:00
|
|
|
public boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = false;
|
2013-04-24 08:39:26 +02:00
|
|
|
public int claimsRequireMinFactionMembers = 1;
|
|
|
|
public int claimedLandsMax = 0;
|
|
|
|
|
2013-04-23 18:07:17 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// HOMES
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean homesEnabled = true;
|
|
|
|
public boolean homesMustBeInClaimedTerritory = true;
|
|
|
|
public boolean homesTeleportCommandEnabled = true;
|
|
|
|
public boolean homesTeleportAllowedFromEnemyTerritory = true;
|
|
|
|
public boolean homesTeleportAllowedFromDifferentWorld = true;
|
|
|
|
public double homesTeleportAllowedEnemyDistance = 32.0;
|
|
|
|
public boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
|
|
|
|
|
2013-07-24 18:29:55 +02:00
|
|
|
public boolean homesTeleportToOnDeathActive = false;
|
|
|
|
public EventPriority homesTeleportToOnDeathPriority = EventPriority.NORMAL;
|
|
|
|
|
2013-04-24 14:31:10 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// ASSORTED
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean permanentFactionsDisableLeaderPromotion = false;
|
2013-09-15 01:08:20 +02:00
|
|
|
public double actionDeniedPainAmount = 2.0D;
|
2013-04-24 14:31:10 +02:00
|
|
|
public boolean disablePVPForFactionlessPlayers = false;
|
|
|
|
public boolean enablePVPAgainstFactionlessInAttackersLand = false;
|
2013-09-15 01:08:20 +02:00
|
|
|
public double territoryShieldFactor = 0.3D;
|
2013-04-24 14:31:10 +02:00
|
|
|
|
2013-04-23 09:17:30 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// DENY COMMANDS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
// commands which will be prevented if the player is a member of a permanent faction
|
|
|
|
public List<String> denyCommandsPermanentFactionMember = new ArrayList<String>();
|
|
|
|
|
|
|
|
// commands which will be prevented when in claimed territory of another faction
|
2013-04-23 12:31:07 +02:00
|
|
|
public Map<Rel, List<String>> denyCommandsTerritoryRelation = MUtil.map(
|
2013-04-25 20:21:23 +02:00
|
|
|
Rel.ENEMY, MUtil.list(
|
2014-04-12 11:03:36 +02:00
|
|
|
// Essentials commands
|
2013-04-25 20:21:23 +02:00
|
|
|
"home",
|
2014-04-12 11:03:36 +02:00
|
|
|
"homes",
|
2013-04-25 20:21:23 +02:00
|
|
|
"sethome",
|
2014-04-12 11:03:36 +02:00
|
|
|
"createhome",
|
2013-04-25 20:21:23 +02:00
|
|
|
"tpahere",
|
|
|
|
"tpaccept",
|
2014-04-04 02:34:23 +02:00
|
|
|
"tpyes",
|
2013-04-25 20:21:23 +02:00
|
|
|
"tpa",
|
2014-04-12 11:03:36 +02:00
|
|
|
"call",
|
|
|
|
"tpask",
|
2013-04-25 20:21:23 +02:00
|
|
|
"warp",
|
|
|
|
"warps",
|
|
|
|
"spawn",
|
2014-04-12 11:03:36 +02:00
|
|
|
// Essentials e-alliases
|
2014-01-25 20:35:20 +01:00
|
|
|
"ehome",
|
2014-04-12 11:03:36 +02:00
|
|
|
"ehomes",
|
2014-01-25 20:35:20 +01:00
|
|
|
"esethome",
|
2014-04-12 11:03:36 +02:00
|
|
|
"ecreatehome",
|
2014-01-25 20:35:20 +01:00
|
|
|
"etpahere",
|
|
|
|
"etpaccept",
|
2014-04-04 02:34:23 +02:00
|
|
|
"etpyes",
|
2014-01-25 20:35:20 +01:00
|
|
|
"etpa",
|
2014-04-12 11:03:36 +02:00
|
|
|
"ecall",
|
|
|
|
"etpask",
|
2014-01-25 20:35:20 +01:00
|
|
|
"ewarp",
|
|
|
|
"ewarps",
|
|
|
|
"espawn",
|
2014-04-12 11:03:36 +02:00
|
|
|
// Essentials fallback alliases
|
|
|
|
"essentials:home",
|
|
|
|
"essentials:homes",
|
|
|
|
"essentials:sethome",
|
|
|
|
"essentials:createhome",
|
|
|
|
"essentials:tpahere",
|
|
|
|
"essentials:tpaccept",
|
|
|
|
"essentials:tpyes",
|
|
|
|
"essentials:tpa",
|
|
|
|
"essentials:call",
|
|
|
|
"essentials:tpask",
|
|
|
|
"essentials:warp",
|
|
|
|
"essentials:warps",
|
|
|
|
"essentials:spawn",
|
|
|
|
// Other plugins
|
2013-04-25 20:21:23 +02:00
|
|
|
"wtp",
|
|
|
|
"uspawn",
|
|
|
|
"utp",
|
|
|
|
"mspawn",
|
|
|
|
"mtp",
|
|
|
|
"fspawn",
|
|
|
|
"ftp",
|
|
|
|
"jspawn",
|
|
|
|
"jtp"
|
|
|
|
),
|
2013-04-23 12:31:07 +02:00
|
|
|
Rel.NEUTRAL, new ArrayList<String>(),
|
|
|
|
Rel.TRUCE, new ArrayList<String>(),
|
|
|
|
Rel.ALLY, new ArrayList<String>(),
|
|
|
|
Rel.MEMBER, new ArrayList<String>()
|
2013-04-23 09:17:30 +02:00
|
|
|
);
|
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// INTEGRATION: LWC
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2014-06-04 16:47:01 +02:00
|
|
|
public Map<EventFactionsChunkChangeType, Boolean> lwcRemoveOnChange = MUtil.map(
|
|
|
|
EventFactionsChunkChangeType.BUY, false,
|
|
|
|
EventFactionsChunkChangeType.SELL, false,
|
|
|
|
EventFactionsChunkChangeType.CONQUER, false,
|
|
|
|
EventFactionsChunkChangeType.PILLAGE, false
|
2013-04-24 11:30:00 +02:00
|
|
|
);
|
2013-04-24 08:39:26 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INTEGRATION: ECONOMY
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean econEnabled = false;
|
|
|
|
|
|
|
|
// TODO: Rename to include unit.
|
|
|
|
public double econLandReward = 0.00;
|
|
|
|
|
|
|
|
public String econUniverseAccount = "";
|
|
|
|
|
2014-06-04 16:47:01 +02:00
|
|
|
public Map<EventFactionsChunkChangeType, Double> econChunkCost = MUtil.map(
|
|
|
|
EventFactionsChunkChangeType.BUY, 30.0,
|
|
|
|
EventFactionsChunkChangeType.SELL, -20.0,
|
|
|
|
EventFactionsChunkChangeType.CONQUER, -10.0,
|
|
|
|
EventFactionsChunkChangeType.PILLAGE, -10.0
|
2013-04-24 11:16:37 +02:00
|
|
|
);
|
2013-04-24 08:39:26 +02:00
|
|
|
|
2013-04-25 20:21:23 +02:00
|
|
|
public double econCostCreate = 200.0;
|
2013-04-24 08:39:26 +02:00
|
|
|
public double econCostSethome = 0.0;
|
|
|
|
public double econCostJoin = 0.0;
|
|
|
|
public double econCostLeave = 0.0;
|
|
|
|
public double econCostKick = 0.0;
|
|
|
|
public double econCostInvite = 0.0;
|
|
|
|
public double econCostDeinvite = 0.0;
|
|
|
|
public double econCostHome = 0.0;
|
2013-04-24 19:01:17 +02:00
|
|
|
public double econCostName = 0.0;
|
2013-04-24 08:39:26 +02:00
|
|
|
public double econCostDescription = 0.0;
|
|
|
|
public double econCostTitle = 0.0;
|
|
|
|
public double econCostOpen = 0.0;
|
|
|
|
|
|
|
|
public Map<Rel, Double> econRelCost = MUtil.map(
|
|
|
|
Rel.ENEMY, 0.0,
|
|
|
|
Rel.ALLY, 0.0,
|
|
|
|
Rel.TRUCE, 0.0,
|
|
|
|
Rel.NEUTRAL, 0.0
|
|
|
|
);
|
|
|
|
|
|
|
|
//Faction banks, to pay for land claiming and other costs instead of individuals paying for them
|
|
|
|
public boolean bankEnabled = true;
|
|
|
|
//public static boolean bankMembersCanWithdraw = false; //Have to be at least moderator to withdraw or pay money to another faction
|
|
|
|
public boolean bankFactionPaysCosts = true; //The faction pays for faction command costs, such as sethome
|
|
|
|
public boolean bankFactionPaysLandCosts = true; //The faction pays for land claiming costs.
|
2013-04-24 07:51:48 +02:00
|
|
|
|
2013-04-22 16:58:22 +02:00
|
|
|
}
|