entityTypesMonsters = MUtil.set(
+ 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
+ );
+
+ // -------------------------------------------- //
+ // DYNMAP
+ // -------------------------------------------- //
+
+ // Should the dynmap intagration be used?
+ public boolean dynmapUse = true;
+
+ // Should the dynmap updates be logged to console output?
+ public boolean dynmapUpdateLog = false;
+
+ // Name of the Factions layer
+ public String dynmapLayerName = "Factions";
+
+ // Should the layer be visible per default
+ public boolean dynmapLayerVisible = true;
+
+ // Ordering priority in layer menu (low goes before high - default is 0)
+ public int dynmapLayerPriority = 2;
+
+ // (optional) set minimum zoom level before layer is visible (0 = defalt, always visible)
+ public int dynmapLayerMinimumZoom = 0;
+
+ // Format for popup - substitute values for macros
+ //public String dynmapInfowindowFormat = "%regionname%
Flags
%flags%
";
+ public String dynmapDescription =
+ "\n" +
+ "%name%\n" +
+ "%description%\n" +
+ "\n" +
+ "Leader: %players.leader%\n" +
+ "Officers: %players.officers.count%\n" +
+ "Members: %players.members.count%\n" +
+ "Recruits: %players.recruits.count%\n" +
+ "TOTAL: %players.count%\n" +
+ "\n" +
+ "Age: %age%\n" +
+ "Bank: %money%\n" +
+ "\n" +
+ "Flags:\n" +
+ "%open.color% | %permanent.color% | %peaceful.color% | %infpower.color% | %powerloss.color%\n" +
+ "%pvp.color% | %friendlyfire.color% | %monsters.color% | %explosions.color%\n" +
+ "%offlineexplosions.color% | %firespread.color% | %endergrief.color%\n" +
+ "
";
+
+ // Enable the %money% macro. Only do this if you know your economy manager is thread safe.
+ public boolean dynmapDescriptionMoney = false;
+
+ // Allow players in faction to see one another on Dynmap (only relevant if Dynmap has 'player-info-protected' enabled)
+ public boolean dynmapVisibilityByFaction = true;
+
+ // Optional setting to limit which regions to show.
+ // If empty all regions are shown.
+ // Specify Faction either by name or UUID.
+ // To show all regions on a given world, add 'world:' to the list.
+ public Set dynmapVisibleFactions = new LinkedHashSet();
+
+ // Optional setting to hide specific Factions.
+ // Specify Faction either by name or UUID.
+ // To hide all regions on a given world, add 'world:' to the list.
+ public Set dynmapHiddenFactions = new LinkedHashSet();
+
+ // Region Style
+ public final static transient String DYNMAP_STYLE_LINE_COLOR = "#00FF00";
+ public final static transient double DYNMAP_STYLE_LINE_OPACITY = 0.8D;
+ public final static transient int DYNMAP_STYLE_LINE_WEIGHT = 3;
+ public final static transient String DYNMAP_STYLE_FILL_COLOR = "#00FF00";
+ public final static transient double DYNMAP_STYLE_FILL_OPACITY = 0.35D;
+ public final static transient String DYNMAP_STYLE_HOME_MARKER = "greenflag";
+ public final static transient boolean DYNMAP_STYLE_BOOST = false;
+
+ public DynmapStyle dynmapDefaultStyle = new DynmapStyle()
+ .setStrokeColor(DYNMAP_STYLE_LINE_COLOR)
+ .setLineOpacity(DYNMAP_STYLE_LINE_OPACITY)
+ .setLineWeight(DYNMAP_STYLE_LINE_WEIGHT)
+ .setFillColor(DYNMAP_STYLE_FILL_COLOR)
+ .setFillOpacity(DYNMAP_STYLE_FILL_OPACITY)
+ .setHomeMarker(DYNMAP_STYLE_HOME_MARKER)
+ .setBoost(DYNMAP_STYLE_BOOST);
+
+ // Optional per Faction style overrides. Any defined replace those in dynmapDefaultStyle.
+ // Specify Faction either by name or UUID.
+ public Map dynmapFactionStyles = MUtil.map(
+ "SafeZone", new DynmapStyle().setStrokeColor("#FF00FF").setFillColor("#FF00FF").setBoost(false),
+ "WarZone", new DynmapStyle().setStrokeColor("#FF0000").setFillColor("#FF0000").setBoost(false)
+ );
+
+}
\ No newline at end of file
diff --git a/src/com/massivecraft/factions/entity/MConfColl.java b/src/main/java/com/massivecraft/factions/entity/MConfColl.java
similarity index 62%
rename from src/com/massivecraft/factions/entity/MConfColl.java
rename to src/main/java/com/massivecraft/factions/entity/MConfColl.java
index 4829cb52..4fed8089 100644
--- a/src/com/massivecraft/factions/entity/MConfColl.java
+++ b/src/main/java/com/massivecraft/factions/entity/MConfColl.java
@@ -1,11 +1,10 @@
package com.massivecraft.factions.entity;
-import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions;
-import com.massivecraft.mcore.MCore;
-import com.massivecraft.mcore.store.Coll;
-import com.massivecraft.mcore.store.MStore;
+import com.massivecraft.massivecore.MassiveCore;
+import com.massivecraft.massivecore.store.Coll;
+import com.massivecraft.massivecore.store.MStore;
public class MConfColl extends Coll
{
@@ -17,7 +16,7 @@ public class MConfColl extends Coll
public static MConfColl get() { return i; }
private MConfColl()
{
- super(Const.COLLECTION_BASENAME_MCONF, MConf.class, MStore.getDb(ConfServer.dburi), Factions.get(), true, false);
+ super(Const.COLLECTION_MCONF, MConf.class, MStore.getDb(), Factions.get());
}
// -------------------------------------------- //
@@ -29,7 +28,7 @@ public class MConfColl extends Coll
{
super.init();
- MConf.i = this.get(MCore.INSTANCE);
+ MConf.i = this.get(MassiveCore.INSTANCE, true);
}
}
diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/main/java/com/massivecraft/factions/entity/MPlayer.java
similarity index 73%
rename from src/com/massivecraft/factions/entity/MPlayer.java
rename to src/main/java/com/massivecraft/factions/entity/MPlayer.java
index eb67daa6..d22f614f 100644
--- a/src/com/massivecraft/factions/entity/MPlayer.java
+++ b/src/main/java/com/massivecraft/factions/entity/MPlayer.java
@@ -1,6 +1,7 @@
package com.massivecraft.factions.entity;
-import com.massivecraft.mcore.store.SenderEntity;
+import com.massivecraft.factions.Perm;
+import com.massivecraft.massivecore.store.SenderEntity;
public class MPlayer extends SenderEntity
{
@@ -44,7 +45,15 @@ public class MPlayer extends SenderEntity
public void setMapAutoUpdating(boolean mapAutoUpdating) { this.mapAutoUpdating = mapAutoUpdating; this.changed(); }
private boolean usingAdminMode = false;
- public boolean isUsingAdminMode() { return this.usingAdminMode; }
+ public boolean isUsingAdminMode()
+ {
+ if (this.usingAdminMode && this.getSender() != null && !Perm.ADMIN.has(this.getSender(), false))
+ {
+ // If we are using admin mode but don't have permissions for it we deactivate it.
+ this.setUsingAdminMode(false);
+ }
+ return this.usingAdminMode;
+ }
public void setUsingAdminMode(boolean usingAdminMode) { this.usingAdminMode = usingAdminMode; this.changed(); }
}
diff --git a/src/com/massivecraft/factions/entity/MPlayerColl.java b/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java
similarity index 62%
rename from src/com/massivecraft/factions/entity/MPlayerColl.java
rename to src/main/java/com/massivecraft/factions/entity/MPlayerColl.java
index d011666f..7afd223d 100644
--- a/src/com/massivecraft/factions/entity/MPlayerColl.java
+++ b/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java
@@ -1,10 +1,9 @@
package com.massivecraft.factions.entity;
-import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions;
-import com.massivecraft.mcore.store.MStore;
-import com.massivecraft.mcore.store.SenderColl;
+import com.massivecraft.massivecore.store.MStore;
+import com.massivecraft.massivecore.store.SenderColl;
public class MPlayerColl extends SenderColl
{
@@ -16,7 +15,7 @@ public class MPlayerColl extends SenderColl
public static MPlayerColl get() { return i; }
private MPlayerColl()
{
- super(Const.COLLECTION_BASENAME_MPLAYER, MPlayer.class, MStore.getDb(ConfServer.dburi), Factions.get());
+ super(Const.COLLECTION_MPLAYER, MPlayer.class, MStore.getDb(), Factions.get());
}
}
diff --git a/src/com/massivecraft/factions/entity/UConf.java b/src/main/java/com/massivecraft/factions/entity/UConf.java
similarity index 77%
rename from src/com/massivecraft/factions/entity/UConf.java
rename to src/main/java/com/massivecraft/factions/entity/UConf.java
index 8a347d2a..2d9502b6 100644
--- a/src/com/massivecraft/factions/entity/UConf.java
+++ b/src/main/java/com/massivecraft/factions/entity/UConf.java
@@ -7,15 +7,16 @@ import java.util.Set;
import java.util.UUID;
import org.bukkit.command.CommandSender;
+import org.bukkit.event.EventPriority;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Rel;
-import com.massivecraft.factions.event.FactionsEventChunkChangeType;
-import com.massivecraft.mcore.store.Entity;
-import com.massivecraft.mcore.store.SenderEntity;
-import com.massivecraft.mcore.util.MUtil;
-import com.massivecraft.mcore.util.Txt;
+import com.massivecraft.factions.event.EventFactionsChunkChangeType;
+import com.massivecraft.massivecore.store.Entity;
+import com.massivecraft.massivecore.store.SenderEntity;
+import com.massivecraft.massivecore.util.MUtil;
+import com.massivecraft.massivecore.util.Txt;
public class UConf extends Entity
{
@@ -82,6 +83,12 @@ public class UConf extends Entity
public Map defaultFactionFlags = FFlag.getDefaultDefaults();
public Map> defaultFactionPerms = FPerm.getDefaultDefaults();
+ // -------------------------------------------- //
+ // MESSAGES
+ // -------------------------------------------- //
+
+ public boolean broadcastNameChange = false;
+
// -------------------------------------------- //
// POWER
// -------------------------------------------- //
@@ -126,15 +133,18 @@ public class UConf extends Entity
public double homesTeleportAllowedEnemyDistance = 32.0;
public boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
+ public boolean homesTeleportToOnDeathActive = false;
+ public EventPriority homesTeleportToOnDeathPriority = EventPriority.NORMAL;
+
// -------------------------------------------- //
// ASSORTED
// -------------------------------------------- //
public boolean permanentFactionsDisableLeaderPromotion = false;
- public int actionDeniedPainAmount = 2;
+ public double actionDeniedPainAmount = 2.0D;
public boolean disablePVPForFactionlessPlayers = false;
public boolean enablePVPAgainstFactionlessInAttackersLand = false;
- public double territoryShieldFactor = 0.3;
+ public double territoryShieldFactor = 0.3D;
// -------------------------------------------- //
// DENY COMMANDS
@@ -146,14 +156,49 @@ public class UConf extends Entity
// commands which will be prevented when in claimed territory of another faction
public Map> denyCommandsTerritoryRelation = MUtil.map(
Rel.ENEMY, MUtil.list(
+ // Essentials commands
"home",
+ "homes",
"sethome",
+ "createhome",
"tpahere",
"tpaccept",
+ "tpyes",
"tpa",
+ "call",
+ "tpask",
"warp",
"warps",
"spawn",
+ // Essentials e-alliases
+ "ehome",
+ "ehomes",
+ "esethome",
+ "ecreatehome",
+ "etpahere",
+ "etpaccept",
+ "etpyes",
+ "etpa",
+ "ecall",
+ "etpask",
+ "ewarp",
+ "ewarps",
+ "espawn",
+ // 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
"wtp",
"uspawn",
"utp",
@@ -174,11 +219,11 @@ public class UConf extends Entity
// INTEGRATION: LWC
// -------------------------------------------- //
- public Map lwcRemoveOnChange = MUtil.map(
- FactionsEventChunkChangeType.BUY, false,
- FactionsEventChunkChangeType.SELL, false,
- FactionsEventChunkChangeType.CONQUER, false,
- FactionsEventChunkChangeType.PILLAGE, false
+ public Map lwcRemoveOnChange = MUtil.map(
+ EventFactionsChunkChangeType.BUY, false,
+ EventFactionsChunkChangeType.SELL, false,
+ EventFactionsChunkChangeType.CONQUER, false,
+ EventFactionsChunkChangeType.PILLAGE, false
);
// -------------------------------------------- //
@@ -192,11 +237,11 @@ public class UConf extends Entity
public String econUniverseAccount = "";
- public Map econChunkCost = MUtil.map(
- FactionsEventChunkChangeType.BUY, 30.0,
- FactionsEventChunkChangeType.SELL, -20.0,
- FactionsEventChunkChangeType.CONQUER, -10.0,
- FactionsEventChunkChangeType.PILLAGE, -10.0
+ public Map econChunkCost = MUtil.map(
+ EventFactionsChunkChangeType.BUY, 30.0,
+ EventFactionsChunkChangeType.SELL, -20.0,
+ EventFactionsChunkChangeType.CONQUER, -10.0,
+ EventFactionsChunkChangeType.PILLAGE, -10.0
);
public double econCostCreate = 200.0;
diff --git a/src/com/massivecraft/factions/entity/UConfColl.java b/src/main/java/com/massivecraft/factions/entity/UConfColl.java
similarity index 59%
rename from src/com/massivecraft/factions/entity/UConfColl.java
rename to src/main/java/com/massivecraft/factions/entity/UConfColl.java
index 2898d610..76683eaf 100644
--- a/src/com/massivecraft/factions/entity/UConfColl.java
+++ b/src/main/java/com/massivecraft/factions/entity/UConfColl.java
@@ -1,10 +1,9 @@
package com.massivecraft.factions.entity;
-import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
-import com.massivecraft.mcore.MCore;
-import com.massivecraft.mcore.store.Coll;
-import com.massivecraft.mcore.store.MStore;
+import com.massivecraft.massivecore.MassiveCore;
+import com.massivecraft.massivecore.store.Coll;
+import com.massivecraft.massivecore.store.MStore;
public class UConfColl extends Coll
{
@@ -14,7 +13,7 @@ public class UConfColl extends Coll
public UConfColl(String name)
{
- super(name, UConf.class, MStore.getDb(ConfServer.dburi), Factions.get(), true, false);
+ super(name, UConf.class, MStore.getDb(), Factions.get());
}
// -------------------------------------------- //
@@ -25,8 +24,7 @@ public class UConfColl extends Coll
public void init()
{
super.init();
-
- this.get(MCore.INSTANCE);
+ this.get(MassiveCore.INSTANCE, true);
}
}
diff --git a/src/com/massivecraft/factions/entity/UConfColls.java b/src/main/java/com/massivecraft/factions/entity/UConfColls.java
similarity index 81%
rename from src/com/massivecraft/factions/entity/UConfColls.java
rename to src/main/java/com/massivecraft/factions/entity/UConfColls.java
index f0ab2fef..85e416e3 100644
--- a/src/com/massivecraft/factions/entity/UConfColls.java
+++ b/src/main/java/com/massivecraft/factions/entity/UConfColls.java
@@ -2,8 +2,8 @@ package com.massivecraft.factions.entity;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions;
-import com.massivecraft.mcore.Aspect;
-import com.massivecraft.mcore.MCore;
+import com.massivecraft.massivecore.Aspect;
+import com.massivecraft.massivecore.MassiveCore;
public class UConfColls extends XColls
{
@@ -33,7 +33,7 @@ public class UConfColls extends XColls
@Override
public String getBasename()
{
- return Const.COLLECTION_BASENAME_UCONF;
+ return Const.COLLECTION_UCONF;
}
@Override
@@ -41,7 +41,7 @@ public class UConfColls extends XColls
{
UConfColl coll = this.get(worldNameExtractable);
if (coll == null) return null;
- return coll.get(MCore.INSTANCE);
+ return coll.get(MassiveCore.INSTANCE);
}
}
diff --git a/src/com/massivecraft/factions/entity/UPlayer.java b/src/main/java/com/massivecraft/factions/entity/UPlayer.java
similarity index 92%
rename from src/com/massivecraft/factions/entity/UPlayer.java
rename to src/main/java/com/massivecraft/factions/entity/UPlayer.java
index 46b0a1af..9c810aa0 100644
--- a/src/com/massivecraft/factions/entity/UPlayer.java
+++ b/src/main/java/com/massivecraft/factions/entity/UPlayer.java
@@ -13,17 +13,17 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Lang;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.RelationParticipator;
-import com.massivecraft.factions.event.FactionsEventChunkChange;
-import com.massivecraft.factions.event.FactionsEventMembershipChange;
-import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
+import com.massivecraft.factions.event.EventFactionsChunkChange;
+import com.massivecraft.factions.event.EventFactionsMembershipChange;
+import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.util.RelationUtil;
-import com.massivecraft.mcore.mixin.Mixin;
-import com.massivecraft.mcore.ps.PS;
-import com.massivecraft.mcore.ps.PSFormatHumanSpace;
-import com.massivecraft.mcore.store.SenderEntity;
-import com.massivecraft.mcore.util.MUtil;
-import com.massivecraft.mcore.util.SenderUtil;
-import com.massivecraft.mcore.util.Txt;
+import com.massivecraft.massivecore.mixin.Mixin;
+import com.massivecraft.massivecore.ps.PS;
+import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
+import com.massivecraft.massivecore.store.SenderEntity;
+import com.massivecraft.massivecore.util.IdUtil;
+import com.massivecraft.massivecore.util.MUtil;
+import com.massivecraft.massivecore.util.Txt;
public class UPlayer extends SenderEntity implements EconomyParticipator
@@ -74,7 +74,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato
Faction faction = this.getFaction();
faction.uplayers.add(this);
- Factions.get().log(Txt.parse("postAttach added %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName()));
+ //Factions.get().log(Txt.parse("postAttach added %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName()));
}
@Override
@@ -87,7 +87,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato
Faction faction = this.getFaction();
faction.uplayers.remove(this);
- Factions.get().log(Txt.parse("preDetach removed %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName()));
+ //Factions.get().log(Txt.parse("preDetach removed %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName()));
}
// -------------------------------------------- //
@@ -260,7 +260,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato
factionNameDesc = faction.getName();
}
- Factions.get().log(Txt.parse("setFactionId moved %s aka %s from %s aka %s