Skip to content

Commit

Permalink
Integrate upstream dynmap integration fixes #169
Browse files Browse the repository at this point in the history
  • Loading branch information
markhughes committed Sep 4, 2017
1 parent 6e0441f commit 2a89441
Show file tree
Hide file tree
Showing 11 changed files with 1,094 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/redstoneore/legacyfactions/Factions.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.redstoneore.legacyfactions.flag.Flags;
import net.redstoneore.legacyfactions.integration.Integrations;
import net.redstoneore.legacyfactions.integration.bstats.BStatsIntegration;
import net.redstoneore.legacyfactions.integration.dynmap.DynmapIntegration;
import net.redstoneore.legacyfactions.integration.essentials.EssentialsIntegration;
import net.redstoneore.legacyfactions.integration.metrics.MetricsIntegration;
import net.redstoneore.legacyfactions.integration.novucsftop.NovucsFactionsTopIntegration;
Expand Down Expand Up @@ -234,7 +235,8 @@ public void enable() throws Exception {
MetricsIntegration.get(),
BStatsIntegration.get(),
VentureChatIntegration.get(),
NovucsFactionsTopIntegration.get()
NovucsFactionsTopIntegration.get(),
DynmapIntegration.get()
);

// Sync expansions
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/redstoneore/legacyfactions/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,11 @@ public enum Lang {
WARMUPS_ALREADY("&cYou are already warming up."),
WARMUPS_CANCELLED("&cYou have cancelled your warmup."),

// -------------------------------------------------- //
// Integration: Dynmap
// -------------------------------------------------- //

DYNMAP_TITLE("<h>Dynmap Integration: <i>"),

// -------------------------------------------------- //
// Expansion: FactionsFly
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/net/redstoneore/legacyfactions/entity/Conf.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.redstoneore.legacyfactions.entity.persist.Persist;
import net.redstoneore.legacyfactions.expansion.chat.FactionsChatConfig;
import net.redstoneore.legacyfactions.expansion.fly.FactionsFlyConfig;
import net.redstoneore.legacyfactions.integration.dynmap.DynmapConfig;
import net.redstoneore.legacyfactions.util.MiscUtil;
import net.redstoneore.legacyfactions.util.cross.CrossEntityType;
import net.redstoneore.legacyfactions.util.cross.CrossMaterial;
Expand Down Expand Up @@ -1055,6 +1056,12 @@ public class Conf {
public static Set<String> worldsIgnorePvP = new LinkedHashSet<>();
public static Set<String> worldsNoWildernessProtection = new LinkedHashSet<>();

// -------------------------------------------------- //
// INTEGRATION: DYNMAP
// -------------------------------------------------- //

public static DynmapConfig dynmap = new DynmapConfig();

// -------------------------------------------------- //
// BUFFERS
// -------------------------------------------------- //
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package net.redstoneore.legacyfactions.integration.dynmap;

import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

import net.redstoneore.legacyfactions.util.MiscUtil;

public class DynmapConfig {

// -------------------------------------------------- //
// STATIC FIELDS
// -------------------------------------------------- //

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;

// -------------------------------------------------- //
// FIELDS
// -------------------------------------------------- //

public boolean enabled = true;

public String layerName = "Factions";

public boolean layerVisible = true;

public int layerPriority = 2;

public int layerMinimumZoom = 0;

public String description =
"<div class=\"infowindow\">\n" +
"<span style=\"font-weight: bold; font-size: 150%;\">%factions_faction_name%</span></br>\n" +
"<span style=\"font-style: italic; font-size: 110%;\">%factions_faction_description_blankwild%</span></br>\n" +
"</br>\n" +
"<span style=\"font-weight: bold;\">Leader:</span> %factions_faction_admin%</br>\n" +
"<span style=\"font-weight: bold;\">Members:</span> %factions_faction_count_members%</br>\n" +
"</div>";

public boolean descriptionMoney = false;

public boolean visibilityByFaction = true;

public Set<String> visibleFactions = new LinkedHashSet<>();

public Set<String> hiddenFactions = new LinkedHashSet<>();

public DynmapStyle defaultStyle = 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<String, DynmapStyle> factionStyles = MiscUtil.newMap(
"SafeZone", new DynmapStyle().setStrokeColor("#FF00FF").setFillColor("#FF00FF").setBoost(false),
"WarZone", new DynmapStyle().setStrokeColor("#FF0000").setFillColor("#FF0000").setBoost(false)
);
}
Loading

0 comments on commit 2a89441

Please sign in to comment.