2011-07-18 22:06:02 +02:00
package com.massivecraft.factions ;
2011-02-06 13:36:11 +01:00
import java.util.* ;
2011-10-09 14:53:38 +02:00
2011-02-06 13:36:11 +01:00
import org.bukkit.* ;
2011-07-18 22:06:02 +02:00
2013-04-10 10:53:53 +02:00
import com.massivecraft.mcore.SimpleConfig ;
2013-04-10 11:07:47 +02:00
import com.massivecraft.mcore.util.MUtil ;
2011-10-23 20:50:49 +02:00
2013-04-10 10:53:53 +02:00
public class ConfServer extends SimpleConfig
2011-10-08 22:03:44 +02:00
{
2013-04-09 13:18:05 +02:00
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static transient ConfServer i = new ConfServer ( ) ;
public static ConfServer get ( ) { return i ; }
2013-04-10 10:53:53 +02:00
public ConfServer ( ) { super ( Factions . get ( ) ) ; }
2013-04-09 13:18:05 +02:00
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
2013-04-11 08:49:14 +02:00
public static List < String > baseCommandAliases = MUtil . list ( " f " ) ;
public static String dburi = " default " ;
2011-10-09 14:53:38 +02:00
2011-02-12 18:05:05 +01:00
// Colors
public static ChatColor colorMember = ChatColor . GREEN ;
2011-10-25 21:18:08 +02:00
public static ChatColor colorAlly = ChatColor . DARK_PURPLE ;
public static ChatColor colorTruce = ChatColor . LIGHT_PURPLE ;
2011-02-12 18:05:05 +01:00
public static ChatColor colorNeutral = ChatColor . WHITE ;
public static ChatColor colorEnemy = ChatColor . RED ;
2011-10-21 19:20:33 +02:00
2011-10-24 09:28:08 +02:00
public static ChatColor colorNoPVP = ChatColor . GOLD ;
public static ChatColor colorFriendlyFire = ChatColor . DARK_RED ;
2011-10-22 17:03:49 +02:00
//public static ChatColor colorWilderness = ChatColor.DARK_GREEN;
2011-10-08 22:03:44 +02:00
2011-10-24 02:33:30 +02:00
public static Map < FFlag , Boolean > factionFlagDefaults ;
public static Map < FFlag , Boolean > factionFlagIsChangeable ;
2011-10-24 01:37:51 +02:00
public static Map < FPerm , Set < Rel > > factionPermDefaults ;
2013-01-06 21:44:29 +01:00
public static Rel factionRankDefault = Rel . RECRUIT ;
2011-10-23 20:50:49 +02:00
2011-02-12 18:05:05 +01:00
// Power
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double powerPlayerMax = 10 . 0 ;
public static double powerPlayerMin = - 10 . 0 ;
2012-01-04 00:30:07 +01:00
public static double powerPlayerStarting = 10 . 0 ; // New players start out with this power level
2011-02-12 18:05:05 +01:00
public static double powerPerMinute = 0 . 2 ; // Default health rate... it takes 5 min to heal one power
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double powerPerDeath = 4 . 0 ; // A death makes you lose 4 power
2011-11-29 00:07:29 +01:00
public static boolean scaleNegativePower = false ; // Power regeneration rate increase as power decreases
2012-03-13 14:27:03 +01:00
public static double scaleNegativeDivisor = 40 . 0 ; // Divisor for inverse power regeneration curve
2011-06-01 13:54:00 +02:00
public static boolean powerRegenOffline = false ; // does player power regenerate even while they're offline?
2011-10-14 23:45:39 +02:00
public static double powerOfflineLossPerDay = 0 . 0 ; // players will lose this much power per day offline
2011-09-22 13:33:34 +02:00
public static double powerOfflineLossLimit = 0 . 0 ; // players will no longer lose power from being offline once their power drops to this amount or less
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double powerFactionMax = 0 . 0 ; // if greater than 0, the cap on how much power a faction can have (additional power from players beyond that will act as a "buffer" of sorts)
2011-02-06 13:36:11 +01:00
2011-10-23 17:55:53 +02:00
public static String prefixLeader = " ** " ;
public static String prefixOfficer = " * " ;
2013-01-06 21:44:29 +01:00
public static String prefixMember = " + " ;
public static String prefixRecruit = " - " ;
2011-02-06 13:36:11 +01:00
2011-02-12 18:05:05 +01:00
public static int factionTagLengthMin = 3 ;
2011-02-13 16:37:21 +01:00
public static int factionTagLengthMax = 10 ;
public static boolean factionTagForceUpperCase = false ;
2011-02-06 13:36:11 +01:00
2011-10-08 22:03:44 +02:00
public static boolean newFactionsDefaultOpen = false ;
2011-05-29 23:28:29 +02:00
2012-02-24 13:30:28 +01:00
// when faction membership hits this limit, players will no longer be able to join using /f join; default is 0, no limit
public static int factionMemberLimit = 0 ;
2011-09-13 05:46:20 +02:00
// what faction ID to start new players in when they first join the server; default is 0, "no faction"
2011-10-08 22:03:44 +02:00
public static String newPlayerStartingFactionID = " 0 " ;
2011-09-13 05:46:20 +02:00
2011-10-24 09:28:08 +02:00
//public static boolean showMapFactionKey = true;
//public static boolean showNeutralFactionsOnMap = true;
//public static boolean showEnemyFactionsOnMap = true;
2011-05-29 23:28:29 +02:00
2011-05-29 23:41:50 +02:00
// Disallow joining/leaving/kicking while power is negative
2011-10-15 19:46:09 +02:00
public static boolean canLeaveWithNegativePower = true ;
2011-05-29 23:41:50 +02:00
2011-02-12 18:05:05 +01:00
// Configuration on the Faction tag in chat messages.
2012-05-02 04:45:10 +02:00
public static boolean chatSetFormat = false ;
public static String chatSetFormatTo = " <{faction_relcolor}§l{faction_roleprefix}§r{faction_relcolor}{faction_tag_pr} " + ChatColor . WHITE . toString ( ) + " %s> %s " ;
public static boolean chatParseTags = true ;
2012-08-26 00:54:15 +02:00
public static boolean chatParseTagsColored = false ;
2012-05-02 04:45:10 +02:00
public static Map < String , String > chatSingleFormats = new HashMap < String , String > ( ) ;
public static String chatTagFormat = " %s " + ChatColor . WHITE ; // This one is almost deprecated now right? or is it?
// Herochat
2012-08-26 00:54:15 +02:00
public static String herochatFactionName = " Faction " ;
public static String herochatFactionNick = " F " ;
public static String herochatFactionFormat = " {color}[&l{nick}&r{color} &l{faction_roleprefix}&r{color}{faction_title_pr}{sender}{color}] &f{msg} " ;
public static ChatColor herochatFactionColor = ChatColor . GREEN ;
public static int herochatFactionDistance = 0 ;
public static boolean herochatFactionIsShortcutAllowed = false ;
public static boolean herochatFactionCrossWorld = true ;
public static boolean herochatFactionMuted = false ;
public static Set < String > herochatFactionWorlds = new HashSet < String > ( ) ;
public static String herochatAlliesName = " Allies " ;
public static String herochatAlliesNick = " A " ;
public static String herochatAlliesFormat = " {color}[&l{nick}&r&f {faction_relcolor}&l{faction_roleprefix}&r{faction_relcolor}{faction_tag_pr}{sender}{color}] &f{msg} " ;
public static ChatColor herochatAlliesColor = ChatColor . DARK_PURPLE ;
public static int herochatAlliesDistance = 0 ;
public static boolean herochatAlliesIsShortcutAllowed = false ;
public static boolean herochatAlliesCrossWorld = true ;
public static boolean herochatAlliesMuted = false ;
public static Set < String > herochatAlliesWorlds = new HashSet < String > ( ) ;
public static String herochatAllyName = " Allies " ;
2012-11-10 01:22:39 +01:00
public static boolean broadcastDescriptionChanges = false ;
2011-10-14 23:45:39 +02:00
public static double autoLeaveAfterDaysOfInactivity = 10 . 0 ;
2012-02-26 23:55:58 +01:00
public static double autoLeaveRoutineRunsEveryXMinutes = 5 . 0 ;
2011-12-18 09:37:40 +01:00
public static boolean removePlayerDataWhenBanned = true ;
2011-09-08 13:24:55 +02:00
public static boolean worldGuardChecking = false ;
Additional logging, with new conf.json settings to enable/disable logging of specific events:
"logFactionCreate": true, - log faction creation
"logFactionDisband": true, - log factions being disbanded, by command or by circumstance
"logFactionJoin": true, - log player joining a faction
"logFactionKick": true, - log player being kicked from a faction
"logFactionLeave": true, - log player leaving a faction
"logLandClaims": true, - log land being claimed (including safe zone and war zone)
"logLandUnclaims": true, - log land being unclaimed (including safe zone and war zone)
"logMoneyTransactions": true, - log money being deposited, withdrawn, and otherwise transferred in relation to faction banks
Also a fix for a potential NPE from players logging out and Spout appearance handler referencing them afterwards
2011-10-23 19:50:02 +02:00
2012-01-15 19:41:33 +01:00
//LWC
public static boolean lwcIntegration = false ;
public static boolean onUnclaimResetLwcLocks = false ;
public static boolean onCaptureResetLwcLocks = false ;
Additional logging, with new conf.json settings to enable/disable logging of specific events:
"logFactionCreate": true, - log faction creation
"logFactionDisband": true, - log factions being disbanded, by command or by circumstance
"logFactionJoin": true, - log player joining a faction
"logFactionKick": true, - log player being kicked from a faction
"logFactionLeave": true, - log player leaving a faction
"logLandClaims": true, - log land being claimed (including safe zone and war zone)
"logLandUnclaims": true, - log land being unclaimed (including safe zone and war zone)
"logMoneyTransactions": true, - log money being deposited, withdrawn, and otherwise transferred in relation to faction banks
Also a fix for a potential NPE from players logging out and Spout appearance handler referencing them afterwards
2011-10-23 19:50:02 +02:00
// server logging options
public static boolean logFactionCreate = true ;
public static boolean logFactionDisband = true ;
public static boolean logFactionJoin = true ;
public static boolean logFactionKick = true ;
public static boolean logFactionLeave = true ;
public static boolean logLandClaims = true ;
public static boolean logLandUnclaims = true ;
public static boolean logMoneyTransactions = true ;
2012-03-10 02:26:40 +01:00
public static boolean logPlayerCommands = true ;
2012-03-19 12:55:00 +01:00
// prevent some potential exploits
public static boolean handleExploitObsidianGenerators = true ;
public static boolean handleExploitEnderPearlClipping = true ;
2012-03-19 13:59:41 +01:00
public static boolean handleExploitInteractionSpam = true ;
New setting "handleExploitTNTWaterlog" (default false/disabled) which, if enabled, will cause TNT which explodes in liquid to actually destroy a single adjacent block in all 6 directions. This will only apply to blocks which can be destroyed by TNT normally, specifically anything other than air, bedrock, water, lava, obsidian, and enchanting tables. The destruction of these blocks will be handled as if they had been mined, dropping the appropriate item.
TNT in water/lava doesn't normally destroy any surrounding blocks, which is usually desired behavior. That's the reason this setting is disabled by default. However, it is available because it provides a method to get through waterwalls with enough persistence, and it makes cheap (non-obsidian) TNT cannons require minor maintenance between shots. Both are useful things for my server.
2012-03-19 17:18:39 +01:00
public static boolean handleExploitTNTWaterlog = false ;
2012-03-19 12:55:00 +01:00
2011-03-23 17:39:56 +01:00
public static boolean homesEnabled = true ;
2011-06-19 10:56:21 +02:00
public static boolean homesMustBeInClaimedTerritory = true ;
2011-03-23 17:39:56 +01:00
public static boolean homesTeleportToOnDeath = true ;
2011-06-30 12:15:16 +02:00
public static boolean homesRespawnFromNoPowerLossWorlds = true ;
2011-06-29 01:29:14 +02:00
public static boolean homesTeleportCommandEnabled = true ;
2012-01-27 22:22:32 +01:00
public static boolean homesTeleportCommandEssentialsIntegration = true ;
2011-10-13 12:17:23 +02:00
public static boolean homesTeleportCommandSmokeEffectEnabled = true ;
2011-06-19 10:56:21 +02:00
public static boolean homesTeleportAllowedFromEnemyTerritory = true ;
2011-07-09 14:21:47 +02:00
public static boolean homesTeleportAllowedFromDifferentWorld = true ;
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double homesTeleportAllowedEnemyDistance = 32 . 0 ;
2011-07-20 22:45:36 +02:00
public static boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true ;
2011-06-21 04:15:41 +02:00
2011-10-24 11:07:06 +02:00
public static Rel friendlyFireFromRel = Rel . TRUCE ;
2011-06-19 10:49:46 +02:00
public static boolean disablePVPForFactionlessPlayers = false ;
2011-08-12 17:08:11 +02:00
public static boolean enablePVPAgainstFactionlessInAttackersLand = false ;
2011-06-23 03:10:42 +02:00
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3 ;
2011-08-05 10:50:47 +02:00
2011-10-24 03:02:25 +02:00
//public static boolean peacefulMembersDisablePowerLoss = true;
2011-06-21 04:15:41 +02:00
2012-01-19 04:21:26 +01:00
public static boolean permanentFactionsDisableLeaderPromotion = false ;
2011-06-21 04:15:41 +02:00
public static boolean claimsMustBeConnected = false ;
2012-07-30 23:28:23 +02:00
public static boolean claimingFromOthersAllowed = true ;
2011-07-20 21:45:18 +02:00
public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true ;
2011-07-25 20:16:32 +02:00
public static int claimsRequireMinFactionMembers = 1 ;
2012-01-31 23:30:24 +01:00
public static int claimedLandsMax = 0 ;
2012-03-13 11:54:48 +01:00
// if someone is doing a radius claim and the process fails to claim land this many times in a row, it will exit
public static int radiusClaimFailureLimit = 9 ;
2011-10-24 03:02:25 +02:00
//public static double considerFactionsReallyOfflineAfterXMinutes = 0.0;
2011-06-21 07:20:36 +02:00
2011-10-24 01:37:51 +02:00
public static int actionDeniedPainAmount = 2 ;
2012-01-19 06:31:33 +01:00
// commands which will be prevented if the player is a member of a permanent faction
2012-03-11 19:36:03 +01:00
public static Set < String > permanentFactionMemberDenyCommands = new LinkedHashSet < String > ( ) ;
2012-01-19 06:31:33 +01:00
2011-08-04 07:07:38 +02:00
// commands which will be prevented when in claimed territory of another faction
2012-03-11 19:36:03 +01:00
public static Set < String > territoryNeutralDenyCommands = new LinkedHashSet < String > ( ) ;
2013-04-10 11:07:47 +02:00
public static Set < String > territoryEnemyDenyCommands = MUtil . set ( " home " , " sethome " , " spawn " , " tpahere " , " tpaccept " , " tpa " , " warp " ) ;
2011-08-04 07:07:38 +02:00
2011-06-02 01:32:09 +02:00
public static double territoryShieldFactor = 0 . 3 ;
2011-07-20 19:22:03 +02:00
2011-08-23 06:31:37 +02:00
// for claimed areas where further faction-member ownership can be defined
2013-04-10 12:52:22 +02:00
public static boolean pistonProtectionThroughDenyBuild = true ;
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
2011-08-20 03:36:23 +02:00
// Spout features
2011-10-13 21:09:47 +02:00
public static boolean spoutFactionTagsOverNames = true ; // show faction tags over names over player heads
public static boolean spoutFactionTitlesOverNames = true ; // whether to include player's title in that
2012-03-25 21:07:11 +02:00
public static boolean spoutHealthBarUnderNames = true ; // Show healthbar under player names.
public static String spoutHealthBarLeft = " {c}[ " ;
public static String spoutHealthBarSolid = " | " ;
public static String spoutHealthBarBetween = " &8 " ;
public static String spoutHealthBarEmpty = " | " ;
public static String spoutHealthBarRight = " {c}] " ;
public static double spoutHealthBarSolidsPerEmpty = 1d ;
public static String spoutHealthBarColorTag = " {c} " ;
public static int spoutHealthBarWidth = 30 ;
2013-04-10 12:52:22 +02:00
public static Map < Double , String > spoutHealthBarColorUnderQuota = MUtil . map (
1 . 0d , " &2 " ,
0 . 8d , " &a " ,
0 . 5d , " &e " ,
0 . 4d , " &6 " ,
0 . 3d , " &c " ,
0 . 2d , " &4 "
) ;
2012-05-09 03:24:07 +02:00
public static boolean spoutCapes = true ; // Show faction capes
2012-05-16 22:31:42 +02:00
public static int spoutTerritoryDisplayPosition = 1 ; // permanent territory display, instead of by chat; 0 = disabled, 1 = top left, 2 = top center, 3+ = top right
2011-10-13 21:09:47 +02:00
public static float spoutTerritoryDisplaySize = 1 . 0f ; // text scale (size) for territory display
public static boolean spoutTerritoryDisplayShowDescription = true ; // whether to show the faction description, not just the faction tag
2012-05-16 22:29:00 +02:00
public static boolean spoutTerritoryAccessShow = true ; // show occasional territory access info as well ("access granted" or "access restricted" if relevant)
2011-10-13 21:09:47 +02:00
public static boolean spoutTerritoryNoticeShow = true ; // show additional brief territory notice near center of screen, to be sure player notices transition
public static int spoutTerritoryNoticeTop = 40 ; // how far down the screen to place the additional notice
public static boolean spoutTerritoryNoticeShowDescription = false ; // whether to show the faction description in the notice, not just the faction tag
public static float spoutTerritoryNoticeSize = 1 . 5f ; // text scale (size) for notice
public static float spoutTerritoryNoticeLeaveAfterSeconds = 2 . 00f ; // how many seconds before the notice goes away
2011-08-20 03:36:23 +02:00
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
// Economy settings
2011-10-12 17:25:01 +02:00
public static boolean econEnabled = false ;
public static String econUniverseAccount = " " ;
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double econCostClaimWilderness = 30 . 0 ;
public static double econCostClaimFromFactionBonus = 30 . 0 ;
public static double econClaimAdditionalMultiplier = 0 . 5 ;
public static double econClaimRefundMultiplier = 0 . 7 ;
2012-01-19 04:10:40 +01:00
public static double econClaimUnconnectedFee = 0 . 0 ;
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double econCostCreate = 100 . 0 ;
public static double econCostSethome = 30 . 0 ;
public static double econCostJoin = 0 . 0 ;
public static double econCostLeave = 0 . 0 ;
public static double econCostKick = 0 . 0 ;
public static double econCostInvite = 0 . 0 ;
public static double econCostHome = 0 . 0 ;
public static double econCostTag = 0 . 0 ;
public static double econCostDesc = 0 . 0 ;
public static double econCostTitle = 0 . 0 ;
public static double econCostList = 0 . 0 ;
public static double econCostMap = 0 . 0 ;
public static double econCostPower = 0 . 0 ;
public static double econCostShow = 0 . 0 ;
public static double econCostOpen = 0 . 0 ;
public static double econCostAlly = 0 . 0 ;
2011-10-24 11:07:06 +02:00
public static double econCostTruce = 0 . 0 ;
Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value.
2011-08-02 01:05:01 +02:00
public static double econCostNeutral = 0 . 0 ;
2011-10-24 11:07:06 +02:00
public static double econCostEnemy = 0 . 0 ;
2012-11-28 06:51:37 +01:00
public static int econLandRewardTaskRunsEveryXMinutes = 20 ;
2013-01-27 02:59:00 +01:00
public static double econLandReward = 0 . 00 ;
2011-03-23 17:39:56 +01:00
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
//Faction banks, to pay for land claiming and other costs instead of individuals paying for them
public static boolean bankEnabled = true ;
2011-10-24 11:56:41 +02:00
//public static boolean bankMembersCanWithdraw = false; //Have to be at least moderator to withdraw or pay money to another faction
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
public static boolean bankFactionPaysCosts = true ; //The faction pays for faction command costs, such as sethome
public static boolean bankFactionPaysLandCosts = true ; //The faction pays for land claiming costs.
2012-03-11 19:36:03 +01:00
// mainly for other plugins/mods that use a fake player to take actions, which shouldn't be subject to our protections
public static Set < String > playersWhoBypassAllProtection = new LinkedHashSet < String > ( ) ;
public static Set < String > worldsNoClaiming = new LinkedHashSet < String > ( ) ;
public static Set < String > worldsNoPowerLoss = new LinkedHashSet < String > ( ) ;
public static Set < String > worldsIgnorePvP = new LinkedHashSet < String > ( ) ;
2011-10-23 22:08:57 +02:00
// TODO: A better solution Would be to have One wilderness faction per world.
2012-03-11 19:36:03 +01:00
//public static Set<String> worldsNoWildernessProtection = new LinkedHashSet<String>();
2011-05-29 23:28:29 +02:00
2011-10-08 22:03:44 +02:00
static
{
2011-10-24 02:33:30 +02:00
factionFlagDefaults = new LinkedHashMap < FFlag , Boolean > ( ) ;
for ( FFlag flag : FFlag . values ( ) )
2011-10-23 22:08:57 +02:00
{
factionFlagDefaults . put ( flag , flag . defaultDefaultValue ) ;
}
2011-10-23 20:50:49 +02:00
2011-10-24 01:37:51 +02:00
factionPermDefaults = new LinkedHashMap < FPerm , Set < Rel > > ( ) ;
for ( FPerm perm : FPerm . values ( ) )
2011-10-23 23:17:02 +02:00
{
factionPermDefaults . put ( perm , perm . defaultDefaultValue ) ;
}
2012-05-02 04:45:10 +02:00
chatSingleFormats . put ( " pl " , " %s " ) ;
chatSingleFormats . put ( " pr " , " %s " ) ;
chatSingleFormats . put ( " pb " , " %s " ) ;
2011-02-06 13:36:11 +01:00
}
}
2011-03-23 12:00:38 +01:00