2013-04-22 09:37:53 +02:00
|
|
|
package com.massivecraft.factions.entity;
|
|
|
|
|
2013-04-22 09:51:19 +02:00
|
|
|
import java.util.HashSet;
|
2013-04-22 10:43:40 +02:00
|
|
|
import java.util.LinkedHashSet;
|
2013-04-22 09:51:19 +02:00
|
|
|
import java.util.Set;
|
2013-08-09 10:06:28 +02:00
|
|
|
import java.util.TreeSet;
|
2013-04-22 09:51:19 +02:00
|
|
|
|
2013-04-22 09:41:48 +02:00
|
|
|
import org.bukkit.ChatColor;
|
2013-08-23 10:14:23 +02:00
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.entity.EntityType;
|
2013-04-22 09:51:19 +02:00
|
|
|
import org.bukkit.event.EventPriority;
|
2013-04-22 09:41:48 +02:00
|
|
|
|
2013-04-24 16:50:19 +02:00
|
|
|
import com.massivecraft.factions.Factions;
|
2013-04-23 12:54:34 +02:00
|
|
|
import com.massivecraft.factions.listeners.FactionsListenerChat;
|
2013-04-22 09:37:53 +02:00
|
|
|
import com.massivecraft.mcore.store.Entity;
|
2013-08-23 10:14:23 +02:00
|
|
|
import com.massivecraft.mcore.util.MUtil;
|
2013-04-22 09:37:53 +02:00
|
|
|
|
|
|
|
public class MConf extends Entity<MConf>
|
|
|
|
{
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// META
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-22 15:05:00 +02:00
|
|
|
protected static transient MConf i;
|
2013-04-22 16:26:44 +02:00
|
|
|
public static MConf get() { return i; }
|
2013-04-22 09:37:53 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
2013-04-23 12:14:36 +02:00
|
|
|
// OVERRIDE: ENTITY
|
2013-04-22 09:37:53 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
@Override
|
|
|
|
public MConf load(MConf that)
|
|
|
|
{
|
|
|
|
super.load(that);
|
|
|
|
|
2013-04-24 16:50:19 +02:00
|
|
|
if (!Factions.get().isDatabaseInitialized()) return this;
|
|
|
|
|
2013-04-23 12:54:34 +02:00
|
|
|
FactionsListenerChat.get().setup();
|
2013-04-23 12:14:36 +02:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
2013-04-22 09:41:48 +02:00
|
|
|
|
2013-04-22 09:51:19 +02:00
|
|
|
// -------------------------------------------- //
|
2013-04-24 08:39:26 +02:00
|
|
|
// TASKS
|
2013-04-22 09:51:19 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
public double taskPlayerPowerUpdateMinutes = 1;
|
|
|
|
public double taskPlayerDataRemoveMinutes = 5;
|
|
|
|
public double taskEconLandRewardMinutes = 20;
|
2013-04-24 08:39:26 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// REMOVE DATA
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean removePlayerDataWhenBanned = true;
|
|
|
|
public double removePlayerDataAfterInactiveDays = 20.0;
|
2013-04-23 12:14:36 +02:00
|
|
|
|
2013-04-24 20:17:20 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// CLAIM LIMITS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
// if someone is doing a radius claim and the process fails to claim land this many times in a row, it will exit
|
|
|
|
public int radiusClaimFailureLimit = 9;
|
|
|
|
|
|
|
|
// the maximum radius allowed when using the claim command.
|
|
|
|
public int radiusClaimRadiusLimit = 5;
|
|
|
|
|
2013-04-22 09:51:19 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// CHAT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
// We offer a simple standard way to set the format
|
|
|
|
public boolean chatSetFormat = false;
|
|
|
|
public EventPriority chatSetFormatAt = EventPriority.LOWEST;
|
2013-04-24 19:01:17 +02:00
|
|
|
public String chatSetFormatTo = "<{factions_relcolor}§l{factions_roleprefix}§r{factions_relcolor}{factions_name|rp}§f%1$s> %2$s";
|
2013-04-22 09:51:19 +02:00
|
|
|
|
|
|
|
// We offer a simple standard way to parse the chat tags
|
|
|
|
public boolean chatParseTags = true;
|
|
|
|
public EventPriority chatParseTagsAt = EventPriority.LOW;
|
|
|
|
|
|
|
|
// HeroChat: The Faction Channel
|
|
|
|
public String herochatFactionName = "Faction";
|
|
|
|
public String herochatFactionNick = "F";
|
|
|
|
public String herochatFactionFormat = "{color}[&l{nick}&r{color} &l{factions_roleprefix}&r{color}{factions_title|rp}{sender}{color}] &f{msg}";
|
|
|
|
public ChatColor herochatFactionColor = ChatColor.GREEN;
|
|
|
|
public int herochatFactionDistance = 0;
|
|
|
|
public boolean herochatFactionIsShortcutAllowed = false;
|
|
|
|
public boolean herochatFactionCrossWorld = true;
|
|
|
|
public boolean herochatFactionMuted = false;
|
|
|
|
public Set<String> herochatFactionWorlds = new HashSet<String>();
|
|
|
|
|
|
|
|
// HeroChat: The Allies Channel
|
|
|
|
public String herochatAlliesName = "Allies";
|
|
|
|
public String herochatAlliesNick = "A";
|
2013-04-24 19:01:17 +02:00
|
|
|
public String herochatAlliesFormat = "{color}[&l{nick}&r&f {factions_relcolor}&l{factions_roleprefix}&r{factions_relcolor}{factions_name|rp}{sender}{color}] &f{msg}";
|
2013-04-22 09:51:19 +02:00
|
|
|
public ChatColor herochatAlliesColor = ChatColor.DARK_PURPLE;
|
|
|
|
public int herochatAlliesDistance = 0;
|
|
|
|
public boolean herochatAlliesIsShortcutAllowed = false;
|
|
|
|
public boolean herochatAlliesCrossWorld = true;
|
|
|
|
public boolean herochatAlliesMuted = false;
|
|
|
|
public Set<String> herochatAlliesWorlds = new HashSet<String>();
|
|
|
|
|
2013-04-22 10:05:03 +02:00
|
|
|
// -------------------------------------------- //
|
2013-04-23 12:14:36 +02:00
|
|
|
// COLORS
|
2013-04-22 10:05:03 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
public ChatColor colorMember = ChatColor.GREEN;
|
|
|
|
public ChatColor colorAlly = ChatColor.DARK_PURPLE;
|
|
|
|
public ChatColor colorTruce = ChatColor.LIGHT_PURPLE;
|
|
|
|
public ChatColor colorNeutral = ChatColor.WHITE;
|
|
|
|
public ChatColor colorEnemy = ChatColor.RED;
|
|
|
|
|
|
|
|
public ChatColor colorNoPVP = ChatColor.GOLD;
|
|
|
|
public ChatColor colorFriendlyFire = ChatColor.DARK_RED;
|
|
|
|
//public ChatColor colorWilderness = ChatColor.DARK_GREEN;
|
|
|
|
|
2013-04-22 10:05:03 +02:00
|
|
|
// -------------------------------------------- //
|
2013-04-23 12:14:36 +02:00
|
|
|
// PREFIXES
|
2013-04-22 10:05:03 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
public String prefixLeader = "**";
|
|
|
|
public String prefixOfficer = "*";
|
|
|
|
public String prefixMember = "+";
|
|
|
|
public String prefixRecruit = "-";
|
2013-04-22 10:05:03 +02:00
|
|
|
|
2013-04-22 10:43:40 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// DERPY OVERRIDES
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// TODO: Should worldsNoPowerLoss rather be a bukkit permission node?
|
2013-04-24 08:59:43 +02:00
|
|
|
// TODO: These are derpy because they possibly use an invalid design approach.
|
2013-04-22 10:43:40 +02:00
|
|
|
// After universe support is added. Would some of these be removed?
|
|
|
|
// Could it also be more customizeable using some sort of permission lookup map?
|
|
|
|
|
|
|
|
// mainly for other plugins/mods that use a fake player to take actions, which shouldn't be subject to our protections
|
|
|
|
public Set<String> playersWhoBypassAllProtection = new LinkedHashSet<String>();
|
|
|
|
|
|
|
|
public Set<String> worldsNoClaiming = new LinkedHashSet<String>();
|
2013-08-09 10:06:28 +02:00
|
|
|
public Set<String> getWorldsNoClaiming()
|
|
|
|
{
|
|
|
|
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
|
|
|
|
ret.addAll(this.worldsNoClaiming);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-04-22 10:43:40 +02:00
|
|
|
public Set<String> worldsNoPowerLoss = new LinkedHashSet<String>();
|
2013-08-09 10:06:28 +02:00
|
|
|
public Set<String> getWorldsNoPowerLoss()
|
|
|
|
{
|
|
|
|
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
|
|
|
|
ret.addAll(this.worldsNoPowerLoss);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-04-22 10:43:40 +02:00
|
|
|
public Set<String> worldsIgnorePvP = new LinkedHashSet<String>();
|
2013-08-09 10:06:28 +02:00
|
|
|
public Set<String> getWorldsIgnlorePvP()
|
|
|
|
{
|
|
|
|
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
|
|
|
|
ret.addAll(this.worldsIgnorePvP);
|
|
|
|
return ret;
|
|
|
|
}
|
2013-04-23 12:14:36 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// EXPLOITS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean handleExploitObsidianGenerators = true;
|
|
|
|
public boolean handleExploitEnderPearlClipping = true;
|
|
|
|
public boolean handleExploitTNTWaterlog = false;
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// LOGGING
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public boolean logFactionCreate = true;
|
|
|
|
public boolean logFactionDisband = true;
|
|
|
|
public boolean logFactionJoin = true;
|
|
|
|
public boolean logFactionKick = true;
|
|
|
|
public boolean logFactionLeave = true;
|
|
|
|
public boolean logLandClaims = true;
|
|
|
|
public boolean logLandUnclaims = true;
|
|
|
|
public boolean logMoneyTransactions = true;
|
|
|
|
public boolean logPlayerCommands = true;
|
2013-08-23 10:14:23 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// ENUMERATIONS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-08-29 10:48:17 +02:00
|
|
|
public Set<Material> materialsEditOnInteract = MUtil.set(
|
2013-08-23 10:14:23 +02:00
|
|
|
Material.DIODE_BLOCK_OFF,
|
|
|
|
Material.DIODE_BLOCK_ON,
|
|
|
|
Material.NOTE_BLOCK,
|
|
|
|
Material.CAULDRON,
|
|
|
|
Material.SOIL
|
|
|
|
);
|
|
|
|
|
2013-08-29 10:48:17 +02:00
|
|
|
public Set<Material> materialsEditTools = MUtil.set(
|
2013-08-23 10:14:23 +02:00
|
|
|
Material.FIREBALL,
|
|
|
|
Material.FLINT_AND_STEEL,
|
|
|
|
Material.BUCKET,
|
|
|
|
Material.WATER_BUCKET,
|
|
|
|
Material.LAVA_BUCKET
|
|
|
|
);
|
|
|
|
|
2013-08-29 10:48:17 +02:00
|
|
|
public Set<Material> materialsDoor = MUtil.set(
|
2013-08-23 10:14:23 +02:00
|
|
|
Material.WOODEN_DOOR,
|
|
|
|
Material.TRAP_DOOR,
|
|
|
|
Material.FENCE_GATE
|
|
|
|
);
|
|
|
|
|
2013-08-29 10:48:17 +02:00
|
|
|
public Set<Material> materialsContainer = MUtil.set(
|
2013-08-23 10:14:23 +02:00
|
|
|
Material.DISPENSER,
|
|
|
|
Material.CHEST,
|
|
|
|
Material.FURNACE,
|
|
|
|
Material.BURNING_FURNACE,
|
|
|
|
Material.JUKEBOX,
|
|
|
|
Material.BREWING_STAND,
|
|
|
|
Material.ENCHANTMENT_TABLE,
|
|
|
|
Material.ANVIL,
|
|
|
|
Material.BEACON,
|
|
|
|
Material.TRAPPED_CHEST,
|
|
|
|
Material.HOPPER,
|
|
|
|
Material.DROPPER
|
|
|
|
);
|
|
|
|
|
2013-08-29 10:48:17 +02:00
|
|
|
public Set<EntityType> entityTypesMonsters = MUtil.set(
|
2013-08-23 10:14:23 +02:00
|
|
|
EntityType.BLAZE,
|
|
|
|
EntityType.CAVE_SPIDER,
|
|
|
|
EntityType.CREEPER,
|
|
|
|
EntityType.ENDERMAN,
|
|
|
|
EntityType.ENDER_DRAGON,
|
|
|
|
EntityType.GHAST,
|
|
|
|
EntityType.GIANT,
|
|
|
|
EntityType.MAGMA_CUBE,
|
|
|
|
EntityType.PIG_ZOMBIE,
|
|
|
|
EntityType.SILVERFISH,
|
|
|
|
EntityType.SKELETON,
|
|
|
|
EntityType.SLIME,
|
|
|
|
EntityType.SPIDER,
|
|
|
|
EntityType.WITCH,
|
|
|
|
EntityType.WITHER,
|
|
|
|
EntityType.ZOMBIE
|
|
|
|
);
|
2013-04-22 09:37:53 +02:00
|
|
|
|
|
|
|
}
|